Suppose the default text on Buttons, StaticText of wxpython GUI are governed by a parameter (or parameters), I want to change the appearance when the parameter(s) change. Here is a simple example:

```
import wx

class Example(wx.Frame):

    def __init__(self, title):
        super().__init__(None, title=title)
        self.panel = wx.Panel(self)
        self.prefix = "Prefix-Alpha"
        self.initUI()
        self.Centre()

    def initUI(self):
        sizer = wx.GridSizer(3, 1, 10, 10)

        self.create_button1(sizer)
        self.create_button2(sizer)
        self.create_button3(sizer)

        self.panel.SetSizer(sizer)

    def create_button1(self, sizer):
        button1 = wx.Button(self.panel, label=self.prefix + "-Button 1")
        sizer.Add(button1, 1, wx.ALIGN_CENTER_VERTICAL|wx.EXPAND)

    def create_button2(self, sizer):
        button2 = wx.Button(self.panel, label=self.prefix + "-Button 2")
        sizer.Add(button2, 1, wx.ALIGN_CENTER_VERTICAL|wx.EXPAND)

    def create_button3(self, sizer):
        button3 = wx.Button(self.panel, label="Change Prefix")
        sizer.Add(button3, 1, wx.ALIGN_CENTER_VERTICAL|wx.EXPAND)
        button3.Bind(wx.EVT_BUTTON, self.on_change_prefix)

    def on_change_prefix(self, e):
        if self.prefix == "Prefix-Alpha":
            self.prefix = "Prefix-Beta"
        else:
            self.prefix = "Prefix-Alpha"
        # how to change the appearance of button1 and button2?

if __name__ == '__main__':
    app = wx.App()
    Example("Simple Example").Show()
    app.MainLoop()

```

[![enter image description here](https://i.stack.imgur.com/wJHrm.png)](https://i.stack.imgur.com/wJHrm.png)

As you can see, the text on button1 and button2 is governed by the variable `self.prefix`, I want the prefix change when I click button `Change Prefix`. How do I achieve this with minimal modification of the original code? 

One way I can think of is that change `button1` and `button2` as `self.button1` and `self.button2`, and then trigger `self.button1.SetValue()` and `self.button2.SetValue()` when click `change prefix` button. I don't like this method, because in my real production, there are many widgets to manage, not just two. **I am looking for a method just `re-initUI` or something very concise, is that possible?**

A flash of close and open the window/frame is also accepted.