The Cpanel
class uses either Tkinter or Jupyter to programmatically construct and render a control panel from the various setting functions called in user code and manage user interactions at runtime.
The Tkinter frontend subclasses Tkinter.Tk
and the Jupyter frontend subclasses Ipywidgets.VBox
. In either case, the class should not be instantiated directly. Use model.launchCpanel()
instead.
It is not recommended to directly access individual GUI elements, but if necessary these can be found in Param.element
once the control panel is initialized.
Initialization Parameters
model — Helipad, required
The model object.
Methods
Click a method name for more detailed documentation.
renderParam( param, item )
Constructs a Tkinter or Ipywidgets widget from a
Param
object, depending on the active frontend.
Object Properties
progress — ttk.ProgressBar|Ipywidgets.FloatProgress
The GUI element for the progress bar. Subclasses either
ttk.ProgressBar
orIpywidgets.FloatProgress
, depending on the frontend, and provides a standard set of methodsdeterminate()
,update()
,start()
,stop()
, anddone()
to handle updating the progressbar state.runButton — tkinter.Button|Ipywidgets.Button
The GUI element for the start/stop/pause button. Subclasses either
Tkinter.Button
orIpywidgets.Button
, depending on the frontend, and provides a standard set ofrun()
,pause()
, andterminate()
methods to handle changing the button text and action.
Hooks
Click a hook name for more detailed documentation.
CpanelBottom( cpanel, bg )
Allows low-level access to either the Tkinter or the Jupyter control panel. Allows the insertion of widgets β either a Tkinter frame (or any subclass of it) or an Ipywidget, as appropriate β at the bottom of the control panel, as shown by the red stripe.
CpanelAboveParams( cpanel, bg )
Allows low-level access to either the Tkinter or the Jupyter control panel. Allows the insertion of widgets β either a Tkinter frame (or any subclass of it) or an Ipywidget, as appropriate β above the global parameters panel, as shown by the red stripe.
CpanelAboveItemParams( cpanel, bg )
Allows low-level access to either the Tkinter or the Jupyter control panel. Allows the insertion of widgets β either a Tkinter frame (or any subclass of it) or an Ipywidget, as appropriate β above the item parameters panel, as shown by the red stripe.
CpanelTop( cpanel, bg )
Allows low-level access to either the Tkinter or the Jupyter control panel. Allows the insertion of widgets β either a Tkinter frame (or any subclass of it) or an Ipywidget, as appropriate β at the top of the control panel, as shown by the red stripe.
CpanelAboveShocks( cpanel, bg )
Allows low-level access to either the Tkinter or the Jupyter control panel. Allows the insertion of widgets β either a Tkinter frame (or any subclass of it) or an Ipywidget, as appropriate β above the Shocks panel, as shown by the red stripe.
CpanelPostInit( cpanel )
Runs after the control panel has been built. Can be used to modify control panel elements or add additional elements.
Notes and Examples