I'm writing a program in wxpython, and to make GUI parts that are built in different modules I made a module called
runtime, where all the GUI parts get stored on runtime.
This is how it looks:
mainFrame = anotherGUIPart = InputDialog = SomethingElse = None
For example, when I need to make a ListControl to update itself, I use
#anotherGUIPart.py class AnotherGUIPart(wx.Panel): def __init__(self, *args, **kwargs): wx.Panel.__init__(self, *args, **kwargs) self.listCtrl = wx.ListCtrl(self, style=wx.LC_REPORT | wx.LC_SINGLE_SEL) ... def UpdateList(self): self.listCtrl.DeleteAllItems() ... #Somewhere where I need to update the list import runtime runtime.anotherGUIPart.UpdateList()
Is this a good practice?
If not, what are alternatives?