Working on a program (found here, the files are longer, so posting them here would take up much space). My problem with it is that the main panel of gui_step_1.py is way off center from where it should be.
I have tried numerous things, including adding it to a sizer to straighten it out, but because of my program structure (MVC) I can’t do that because I instantiate controller in gui_step_1.py and controller does not inherit panel, frame, or anything related to wx (just a normal class).
What I need is pretty obvious once you see my program: I need step1 (instance of controller in gui_step_1.py) centered on the window.
Thanks for the help!
I didn’t sort through everything, but I think
self.v.Center()in yourcontrollerclass ingui_step_1.pyis repositioning a Panel within its Frame instead of centering the Frame. Get rid of that, and things seem to line up properly. If you want to add the panel to a sizer, you’ll probably have to retrieve it from thecontrollerclass.The trouble you’re having with the interface is more a symptom of a design problem, though. Your view frame creates instances of two different classes, which create instances of widgets which are children of the frame. Although you’re trying to use MVC, it shouldn’t be changing the way you add a widget to a frame.