File: selection.py

package info (click to toggle)
magicgui 0.9.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 21,796 kB
  • sloc: python: 11,202; makefile: 11; sh: 9
file content (20 lines) | stat: -rw-r--r-- 395 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""# Multiple selection widget

A selection widget allowing multiple selections by the user.
"""

from magicgui import magicgui


@magicgui(
    pick_some={
        "choices": ("first", "second", "third", "fourth"),
        "allow_multiple": True,
    }
)
def my_widget(pick_some=("first")):
    """Dropdown selection function."""
    print("you selected", pick_some)


my_widget.show(run=True)