coalispr.tk_gui.gui_widgets.opt2

Classes

Subcommand_frame

Labelframe with radio buttons to select one of the subcommands that

Option_widget

Frame with a labeled input widget for a command option, to be added

Module Contents

class coalispr.tk_gui.gui_widgets.opt2.Subcommand_frame(master, subcommand_choices, subcoms)

Bases: ttkbootstrap.Frame

Labelframe with radio buttons to select one of the subcommands that are available for the main command.

choices
Type:

list

widget_group

Collection of frames, one for each subcommand, forming an Option_widget (value) with choices valid for that subcommand (key).

Type:

dict

current_widget

Key of visible/raised/chosen subcommand Option_widget

Type:

str

subcom_var
Type:

tk.StringVar

labframe

frame to contain subcommand radio buttons.

Type:

ttk.Labelframe

grid_column
Type:

int

choices
subcommands_info
widget_group
current_widget = ''
subcom_var
labframe
grid_column = 0
add_widget(key, opt_widget)

Include a Option_widget for subcommand (key) to collection of frames from which one is raised/made visible when radio button of linked subcommand has been picked.

reset_current_combo_widget()

Return combo widget to empty value.

change_subcommand()

Pass subcommand linked to chosen radio button on so that related Option_widget is made visible in Options_frame.

set_subcommand(key)

Make Option_widget for chosen subcommand visible in Options_frame.

class coalispr.tk_gui.gui_widgets.opt2.Option_widget(opt_frame, master, subcom, choice_var, is_required, is_one_of_list)

Bases: ttkbootstrap.Frame

Frame with a labeled input widget for a command option, to be added to the command Options_frame.

parent
Type:

Options_frame

args
argvar

String variable controlled by Option_widget.

Type:

tkStringVar

is_one_of_list_

Flag to show input widget should be linked to a Subcommand_frame.

Type:

bool

handle

Name of the option, part of label on Option_widget

Type:

str

arg

ArgumentParser ‘arg’, used as key or part of label on Option_widget

Type:

str

enabled

Flag to set state of input widget

Type:

bool

tip_text

Help information linked to option.

Type:

str

input
Type:

str

colr

Colour setting

Type:

str

default_value
Type:

str

label0

Option name (handle)

Type:

ttk.Label

label1

Option arg

Type:

ttk.Label

choice
Type:

input widget

parent
args
argvar
is_one_of_list_
handle
arg
enabled
tip_text
input
colr = 'danger'
default_value = '  '
label0
label1
choice
get_input_widget(key)

Return Input_widget with requested (key) input widget.

key

String denoting what kind of widget to generate.

Type:

str

is_one_of_list()

Return boolean indicating whether subcommand is one of a group from which only one can be chosen at the time; determines association of the Option_widget with a Subcommand_frame.

var_changed(event=None, int_value=False)

Register chosen options.

unbind_mousewheel(combo)

Turn off picking a combo box value by mouse scrolling.

validate_int(value)

Check whether number input is an int

validate_name(value)

Check whether input is a simple name.

validate_region(value)

Check whether input region will be parsable.

on_invalid()

Show message when input is invalid.

create_combo()

Return ttk.Combobox, pick from available choices.

create_comboE()

Return ttk.Combobox, input allowed (or pick from available choices).

create_entry()

Return ttk.Entry, for a number.

create_entry2()

Return ttk.Entry, for a region

create_checkbtn()

Return ttk.Checkbutton.