-
Notifications
You must be signed in to change notification settings - Fork 52
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Example code:
https://pyapp-kit.github.io/magicgui/generated_examples/applications/callable/
Version on macports:
py313-magicgui @0.10.0 (python)
Problem:
Shows double run buttons.
When I write my own example with default set to None, it shows the "run" button initially, but it disappears if I select "f" then None. A better behaviour would be for the run button to be disabled on None or remove it initially.
My testcode:
from magicgui import magicgui
def f(x:int, y:str) -> str:
return f"f({x},{y})"
def g(x:int, y:int) -> str:
return f"g({x},{y})"
@magicgui(call_button=True, func={"choices": ["f", "g"]})
def example(func=None):
pass
def update(name: str):
if len(example) > 1:
del example[1]
if name is not None:
example.insert(1, magicgui(globals()[name]))
def main():
example.func.changed.connect(update)
example.show(run=True)
if __name__ == '__main__':
main()
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working