ControlBuilder

class lib.gui.control_helper.ControlBuilder(parent, option, option_columns, label_width, checkbuttons_frame, style, blank_nones)

Bases: object

Builds and returns a frame containing a tkinter control with label This should only be called from the ControlPanel class

Parameters:
  • parent (tkinter object) – Parent tkinter object

  • option (ControlPanelOption object) – Holds all of the required option information

  • option_columns (int) – Number of options to put on a single row for check-buttons/radio-buttons

  • label_width (int) – Sets the width of the control label

  • checkbuttons_frame (tkinter.frame) – If a check-button frame is passed in, then check-buttons will be placed in this frame rather than the main options frame

  • style (str) – The name of the style to use for the control panel. Styles are configured when TkInter initializes. The style name is the common prefix prior to the widget name. Provide an empty string to use the OS style

  • blank_nones (bool) – Sets selected values to an empty string rather than None if this is true.

Methods Summary

build_control()

Build the correct control type for the option passed through

build_control_label()

Label for control

build_one_control()

Build and place the option controls

control_frame(parent)

Frame to hold control and it's label

control_to_checkframe()

Add check-buttons to the check-button frame

control_to_optionsframe()

Standard non-check buttons sit in the main options frame

set_tk_var(blank_nones)

Correct variable type for control

slider_check_float(value)

Validate a slider's text entry box for float values.

slider_check_int(value)

Validate a slider's text entry box for integer values.

slider_control()

A slider control with corresponding Entry box

Methods Documentation

build_control()

Build the correct control type for the option passed through

build_control_label()

Label for control

build_one_control()

Build and place the option controls

control_frame(parent)

Frame to hold control and it’s label

control_to_checkframe()

Add check-buttons to the check-button frame

control_to_optionsframe()

Standard non-check buttons sit in the main options frame

set_tk_var(blank_nones)

Correct variable type for control

static slider_check_float(value)

Validate a slider’s text entry box for float values. :param value: The slider text entry value to validate :type value: str

static slider_check_int(value)

Validate a slider’s text entry box for integer values.

Parameters:

value (str) – The slider text entry value to validate

slider_control()

A slider control with corresponding Entry box

build_control()

Build the correct control type for the option passed through

build_control_label()

Label for control

build_one_control()

Build and place the option controls

control_frame(parent)

Frame to hold control and it’s label

control_to_checkframe()

Add check-buttons to the check-button frame

control_to_optionsframe()

Standard non-check buttons sit in the main options frame

set_tk_var(blank_nones)

Correct variable type for control

static slider_check_float(value)

Validate a slider’s text entry box for float values. :param value: The slider text entry value to validate :type value: str

static slider_check_int(value)

Validate a slider’s text entry box for integer values.

Parameters:

value (str) – The slider text entry value to validate

slider_control()

A slider control with corresponding Entry box