-
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Widget should not inherit from VBox #132
Comments
Just one clarifying comment - it's still possible to offer a base class that does rely on ipywidgets. What I'm advocating here is that beneath that there should be an abstract base class that is completely independent of the technology for the front-end (and could even be used outside a Jupyter context, for example to wrap pyds9 to drive DS9 or other GUI tools). The ipywidgets base class could then inherit from that ABC. |
This is naturally superseded by #162 because by using Protocol, we will no longer enforce how each backend actually does the implementation, VBox or not. |
This was brought up by @astrofrog in relation to #93, #126, #131, and spacetelescope/jdaviz#445 .
Need inputs from @mwcraig and @eteq .
Idea (from Tom R)
I think for the single viewer, Imviz, we might want
astrowidgets
to actually wrap the whole Imviz/JupyterApplication, rather than the viewer instance, where we can get a reference to the viewer to use in the rest of the wrapper.Imviz
here is from spacetelescope/jdaviz#429 :So basically you don’t need to worry about the
ipywidgets.VBox
stuff. We show the GUI using regularjdaviz
and the wrapper just exposes theastrowidgets
API and translates it on-the-fly to what is needed forjdaviz
but doesn’t deal with any UI aspect (so no mouseover, noVBox
, etc).Pros
UI is now completely handled by the chosen backend, thus freeing
astrowidgets
of the burden and might make #122 implementation less complicated.Cons
In the idea above, we won't be able to do the cursor positioning like this anymore:
astrowidgets/astrowidgets/core.py
Lines 857 to 873 in 8fed923
Things like this is also no longer possible:
astrowidgets/astrowidgets/core.py
Lines 169 to 177 in 8fed923
By farming out all GUI controls to backends, while #122 implementation here might be less complicated, it might also not be entirely possible to simply "switch backend" transparently. For instance, Ginga implementation might still rely on VBox and will implement the cursor positioning in its own subclass, which is not available in other backends.
https://xkcd.com/927/
The text was updated successfully, but these errors were encountered: