Provide widgets for Parameters of itself and up to one additional
Parameterized instance or class.
A subclass that defines a Parameter p can display it appropriately
for manipulation by the user simply by calling
pack_param('p'). The GUI display and the actual Parameter value
are automatically synchronized (though see technical notes in
TkParameterizedBase's documentation for more details).
--------------------- The Parameter's
| | 'representation'
| [label] [widget] |<----frame
| |
---------------------
In the same way, an instance of this class can be used to display
the Parameters of an existing object. By passing in extraPO=x,
where x is an existing Parameterized instance or class, a
Parameter q of x can also be displayed in the GUI by calling
pack_param('q').
For representation in the GUI, Parameter values might need to be
converted between their real values and strings used for display
(e.g. for a ClassSelector, the options are really class objects,
but the user is presented with a list of strings to choose
from). Such translation is handled and documented in the
TkParameterizedBase; the default behaviors can be overridden if
required.
(Note that this class simply adds widget drawing to
TkParameterizedBase. More detail about the shadowing of
Parameters is available in the documentation for
TkParameterizedBase.)
|
|
|
|
|
__init__(self,
master,
extraPO=None,
self_first=True,
msg_handler=None,
**params)
Initialize this object with the arguments and attributes
described below: |
source code
|
|
|
|
__pretty_print(self,
s)
Convert a Parameter name s to a string suitable for display,
if pretty_parameters is True. |
source code
|
|
|
|
__update_dynamic_menu_entry(self,
param_name)
Keep track of status of dynamic entry. |
source code
|
|
|
|
_create_boolean_widget(self,
frame,
name,
widget_options)
Return a Tkinter.Checkbutton to represent parameter 'name'. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
_create_string_widget(self,
frame,
name,
widget_options)
Return a Tkinter.Entry to represent parameter 'name'. |
source code
|
|
|
|
_create_widget(self,
name,
master,
widget_options={},
on_change=None,
on_modify=None)
Return widget,label for parameter 'name', each having the master supplied |
source code
|
|
|
|
|
|
|
|
|
|
_param_right_click(self,
event,
param_name)
Display a popup menu when user right clicks on a parameter. |
source code
|
|
|
|
|
|
|
| _set_widget_status(self,
param_name,
status) |
source code
|
|
|
|
| _switch_dynamic(self,
name=None,
dynamic=False) |
source code
|
|
|
|
_tkvar_set(self,
param_name,
val)
Calls superclass's version, but adds help text for the
currently selected item of SelectorParameters. |
source code
|
|
|
|
|
|
|
gui_get_param(self,
param_name)
Simulate getting the parameter in the GUI. |
source code
|
|
|
|
gui_set_param(self,
param_name,
val)
Simulate setting the parameter in the GUI. |
source code
|
|
|
|
hide_param(self,
name)
Hide the representation of Parameter 'name'. |
source code
|
|
|
|
pack_param(self,
name,
parent=None,
widget_options={},
on_change=None,
on_modify=None,
**pack_options)
Create a widget for the Parameter name, configured according
to widget_options, and pack()ed according to the pack_options. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inherited from TkParameterizedBase:
__getattribute__,
__repr__,
__setattr__,
change_PO,
get_parameter_object,
get_parameter_value,
get_source_po,
set_parameter_value
Inherited from parameterized.Parameterized:
__getstate__,
__setstate__,
__str__,
debug,
defaults,
force_new_dynamic_value,
get_param_values,
get_value_generator,
inspect_value,
message,
print_param_values,
script_repr,
set_dynamic_time_fn,
state_pop,
state_push,
verbose,
warning
Inherited from object:
__delattr__,
__hash__,
__new__,
__reduce__,
__reduce_ex__
|