python - Accessing methods of nested widgets -
I mvc is working on optimizing my design in this context The intent to simplify the API, which is quite frustrating, the Iv has prepared the overall widgets (things themselves and / pub messages) in an attempt to make things the same.
For example, I have a main top-level Guinea class that contains a number of widgets including wxFrame notebook, notebooks contain many tabs, some of which are notebooks containing composite widgets. So call me the
self.gui.nb.sub_nb.composite_widget.method ()
to call one of these overall widgets to the controller To make a suitable abstract for the visualization, I have made reference to these widgets (whose methods should be called in the controller), such as
self.composite_widget = self.nb. Sub_nb.composite_widget ()
so that the call in the controller is now simplified
self.gui.composite_widget.method ()
< / Pre>Is this an acceptable way of creating an abstract layer for the GUI?
OK, there is definitely a way to handle this issue. I use methods to call methods in the old way. The main problem with some people like Pybob-better Py-Dispatcher using multi-dot method calling is that it is difficult to debug if you have to change any method name.
Comments
Post a Comment