def add_option(self, key, default, *, reset=True):
"""Add a new option without adding widgets to the setting dialog.
``section[key]`` will be *default* unless something else is
specified.
If *reset* is True, the setting dialog's reset button sets this
option to *default*.
.. note::
The *reset* argument should be False for settings that
cannot be changed with the dialog. That way, clicking the
reset button resets only the settings that are shown in the
dialog.
"""
self._infos[key] = types.SimpleNamespace(
default=default, # not validated
reset=reset,
callbacks=[],
errorvar=tkinter.BooleanVar(), # true when the triangle is showing
)
评论列表
文章目录