Open
Description
❓ Questions and Help
Let's say I have a simple function that I want made into a GUI, but I want to display some text to the user as a label that isn't treated as a user input. For example it might be instructions to the user. I'm not sure how to do this with magicgui
. It doesn't seem to use the docstring, nor is there any argument to @magicgui
that helps here. I could created a Label
widget as a string argument that is immutable, but that gives me a confusing function signature.
With this example, how could I add the label "Here is some descriptive text I want to show my users"
to the top of the form?
from typing import Annotated, Literal
from magicgui import magicgui
@magicgui
def my_function(
param_a: int,
param_b: Annotated[int, {'widget_type': "Slider", 'max': 100}] = 42,
param_c: Literal["First", "Second", "Third"] = "Second"
):
"""Here is some descriptive text I want to show my users"""
print("param_a:", param_a)
print("param_b:", param_b)
print("param_c:", param_c)
my_function.show(run=True)
- I have searched the documentation
Metadata
Metadata
Assignees
Labels
No labels