Message299519
Above, I left out the last step, "* remove old general block".
The old configdialog had an unwritten and undocumented template and rules for pages on the dialog. It went something like the following.
# def create_widgets():
* Pick names for the pages. They are both tab labels and page ids.
* Send names to tabbed_pages.
* Call create_page_name functions.
# def load_configs():
* Call each load_name_config.
# def create_page_name(): for each name.
* Extract frame from tabbed_pages using name.
* Define tk vars.
* Create subframes and widgets
* Pack widgets
# def var_changed_var_name(), for each tk var
* Perhaps send change to changes dict.
# def other_method():, for each name, semi-sorted
# def load_name_config() for each name.
# Tack on extensions mostly ignoring the above.
What I said in the message above is that we have redefined the template well enough to follow it. We have a mostly abstract template.
class NamePage(Frame):
def __init__(self, master):
super().__init__(master)
self.create_page_name()
self.load_name_cfg()
...
Note that the parameter is 'master', not 'parent', as is standard for widgets. It is also not saved, as it is not needed. TkVars for the page can use self as master.
I considered making that an actual base class. But there is little common code; it does not quite fit FontPage; and would require uniform 'create_page' and 'load_cfg' names. The more specific names are easier to find with ^F ;-).
I do want to add a comment block above FontPage giving the design. I also want to change FontPage to use self as master for tk vars and other widgets.
Lets freeze the General page block until this is done. |
|
Date |
User |
Action |
Args |
2017-07-30 20:29:18 | terry.reedy | set | recipients:
+ terry.reedy, cheryl.sabella |
2017-07-30 20:29:18 | terry.reedy | set | messageid: <1501446558.15.0.458400148823.issue31050@psf.upfronthosting.co.za> |
2017-07-30 20:29:18 | terry.reedy | link | issue31050 messages |
2017-07-30 20:29:17 | terry.reedy | create | |
|