File: change_label.py

package info (click to toggle)
magicgui 0.10.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,880 kB
  • sloc: python: 11,573; makefile: 11; sh: 9
file content (17 lines) | stat: -rw-r--r-- 384 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""# Custom text labels for widgets

An example showing how to create custom text labels for your widgets.
"""

from magicgui import magicgui


# use a different label than the default (the parameter name) in the UI
@magicgui(x={"label": "widget to set x"})
def example(x=1, y="hi"):
    """Example function."""
    return x, y


example.changed.connect(print)
example.show(run=True)