Clearer mapping between the widget types and Python's types?
❓ Questions and Help
[ x ] I have searched the documentation
I needed a slice widget for today's fancy new GUI and quickly stumbled upon the widget list in the docs. I'm not sure why, but for the life of me I couldn't understand how to get a SliceEdit widget into my app. It took me too long to realize that I can simply annotate my parameter as a slice. I think it could be helpful if for each widget type the docs would point directly to the corresponding Python object. I believe there was an opposite Python -> widget table somewhere, but I can't find it now.
yeah, I totally agree. will work on it. I think the "reverse" table (if you can even call it that) might be this.
I'll include this in whatever docs I write up, but generally speaking magicgui picks a widget like this:
- a type is determined using the type annotation if provided, then falling back to the type of the default value, then falling back to
str - type is converted to widget (this is the part that really needs clarification) using as-of-yet poorly documented logic in
magicgui.type_map
however... one "trick" worth mentioning is that if you see a widget in magicgui.widgets, you should be able to use it with the widget_type argument to magicgui
thanks for flagging this. will try to write something up soon.