pyapp-kit / magicgui

build GUIs from type annotations

Home Page:https://pyapp-kit.github.io/magicgui/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: add context manager to temporarily change the widget associated with a type

tlambert03 opened this issue · comments

@Czaki had a good request: a context manager like the following:

with type_registered(MyType, widget_type=MyWdgClass):
    ...

that would restore any previously existing association with MyType when the context is exited