I started to get involved in a project written in python and wxPython (for the GUI). My task is to debug and add a few features to the GUI.
The widgets are organised mainly with sizers, and the application as a whole only looks good at a certain screen size and resolution.
First thing I did was to group some elements under some panels and separate them with splitter (
wx.SplitterWindow). But the hierarchy of the widgets changed; in one line of code I had to change from:
class CustomGrid(wx.grid.Grid): def __init__(self, parent, name, config): # ... self.data = self.GetParent().data
class CustomGrid(wx.grid.Grid): def __init__(self, parent, name, config): # ... self.data = self.GetParent().GetParent().GetParent().data
That's ugly. In another instance a widget class get inserted in two different places and the data is not located at the same parent level.
I am suspecting that there is something wrong with the architecture here. How to/Should I separate the data from the GUI?
Any tips and/or links to blogs or other questions would be nice to get started with. Also how to state my question better? (I'm looking forward to learning the proper lingo and perhaps edit the title!)