Skip to main content
Ctrl+K
squap 0.0.6 documentation - Home squap 0.0.6 documentation - Home
  • Beginner guide
  • User Guide
  • squap API reference
  • Developer Guide
  • Examples
  • Beginner guide
  • User Guide
  • squap API reference
  • Developer Guide
  • Examples

Section Navigation

  • Plotting
    • Plotting Functions
    • Infinite Lines
    • Other Plot Objects
    • Plot Window Control
    • Starting And Animation
    • Plot Widget
    • Curves
  • Plotting In 3D
    • Plotting In 3D
    • Other Plot Objects In 3D
    • Plot Window Control
    • Widgets And Objects For 3D Plots
    • Curves In 3D
  • User Input
    • Input boxes
      • Slider
      • Checkbox
      • Inputbox
      • Button
      • Dropdown
      • Rate Slider
      • Color Picker
      • General Box
    • Input Widget Controls
    • Mouse And Keyboard Input
    • Input Table
  • Other Functions
    • Customisation
    • Window Controls
    • Exporting
    • Helper Functions
    • Other Objects
  • squap API reference
  • User Input
  • Input boxes
  • Dropdown

Dropdown#

squap.add_dropdown(
name,
options,
init_index=0,
option_names=None,
var_name=None,
print_value=False,
row=None,
)[source]#

Adds a dropdown to the main input widget, or to all input tables if there are more.

Parameters:
  • name (str) – The name in front of the dropwdown.

  • options (Iterable) – A list of all options the created variable can be, where option_names[index] is the value given to the variable, if the dropwdown is set to index.

  • init_index (int) – The index that the dropwdown is initially set to.

  • option_names (list of str, optional) – A list of all options shown in the dropwdown menu. If option_names is not provided it will be set to options.

  • var_name (str, optional) – The name of the created variable. If var_name is not provided, the variable will be named name.

  • print_value (bool) – Whether to print the value of the dropwdown when it changes. Defaults to False.

  • row (int, optional) – Row to which the dropwdown is added. Defaults to first empty row.

Returns:

The created dropwdown widget(s).

Return type:

Dropdown or list of Dropdown

class squap.widgets.InputTable.Dropdown#
Dropdown.bind(func)#

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.

Dropdown.unbind(func)#

Unbind function. Is used internally when removing a box.

Parameters:

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

Dropdown.set_value(value)#

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.

Dropdown.value()#

Return the current value of var.var_name

Dropdown.set_index(index)#

Sets the index to index.

Dropdown.index()#

Returns the current index.

Dropdown.change_params(**kwargs)#

Changes the parameters of the dropdown. Only keyword arguments are accepted, and takes all arguments that squap.add_dropdown() accepts, except init_value and row.

Dropdown.print_val()#

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

Dropdown.remove()#

Remove this box.

previous

Button

next

Rate Slider

On this page
  • add_dropdown()
  • squap.widgets.InputTable.Dropdown
    • squap.widgets.InputTable.Dropdown.Dropdown.bind()
    • squap.widgets.InputTable.Dropdown.Dropdown.unbind()
    • squap.widgets.InputTable.Dropdown.Dropdown.set_value()
    • squap.widgets.InputTable.Dropdown.Dropdown.value()
    • squap.widgets.InputTable.Dropdown.Dropdown.set_index()
    • squap.widgets.InputTable.Dropdown.Dropdown.index()
    • squap.widgets.InputTable.Dropdown.Dropdown.change_params()
    • squap.widgets.InputTable.Dropdown.Dropdown.print_val()
    • squap.widgets.InputTable.Dropdown.Dropdown.remove()

© Copyright 2026, R. Mulder.

Created using Sphinx 8.2.3.

Built with the PyData Sphinx Theme 0.16.1.