General Box#

This is the general class all input boxes inherit from. For all input boxes see this page.

class squap.widgets.Box(parent)[source]#

General class for each squap box.

Parameters:

parent (InputTable) – The parent InputTable.

row#

Row of the box. Is used when removing it after it has been created.

Type:

int

textbox#

The QLabel object corresponding to this box.

Type:

QLabel

bind(func)[source]#

Bind function func to this box, meaning that when the value of the box is changed, the function is called.

Parameters:

func (callable) – function to bind to this box.

unbind(func)[source]#

Unbind function. Is used internally when removing a box.

Parameters:

func (callable) – function to unbind from this box.

set_value(value)[source]#

Set the value of the box and var.var_name to value. Note that for a slider, the new slider position will be the closest possible position to value, and the new value of var.var_name will be the value corresponding to the new slider position.

value()[source]#

Return the current value of var.var_name

change_params(**kwargs)[source]#

Change box parameters. kwargs can usually be the same arguments that are given to the __init__ function of this box, except init_value and row.

print_val()[source]#

Print the current value of the box. Used for the print_value keyword argument.

remove()[source]#

Remove this box.