Skip to content
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

Clicking on a ToggleButtons widget should run interact #24595

Closed
jdemeyer opened this issue Jan 26, 2018 · 10 comments
Closed

Clicking on a ToggleButtons widget should run interact #24595

jdemeyer opened this issue Jan 26, 2018 · 10 comments

Comments

@jdemeyer
Copy link

In the old Sage notebook, a selector() widget with buttons could be used as "action" button: with each press of the button, the interact would be run. This is obviously only useful for non-deterministic interacts (where the output can change even if the widgets do not).

Example:

import datetime

@interact
def f(action=selector(["one", "two", "three"], buttons=True)):
    print(action)
    print(datetime.datetime.now())

This should be enabled in the Jupyter notebook using jupyter-widgets/ipywidgets#1259

Depends on #23177

CC: @jasongrout

Component: notebook

Author: Jeroen Demeyer

Branch/Commit: c37195c

Reviewer: Frédéric Chapoton

Issue created by migration from https://trac.sagemath.org/ticket/24595

@jdemeyer jdemeyer added this to the sage-8.2 milestone Jan 26, 2018
@jdemeyer jdemeyer changed the title Use selector() widget to run manual interacts Use ToggleButtons widget to run manual interacts Jan 26, 2018
@jdemeyer

This comment has been minimized.

@jdemeyer

This comment has been minimized.

@jdemeyer jdemeyer changed the title Use ToggleButtons widget to run manual interacts Clicking on a ToggleButtons widget should run interact Jan 26, 2018
@jdemeyer
Copy link
Author

comment:4

Jason: this should be fixed in the Sage cell server too.

@jdemeyer
Copy link
Author

Branch: u/jdemeyer/ticket/24595

@jdemeyer
Copy link
Author

New commits:

72d9751Upgrade some Jupyter packages
54ff63dUpgrade to ipywidgets 7
c37195cClicking on a ToggleButtons widget should run interact

@jdemeyer
Copy link
Author

Commit: c37195c

@fchapoton
Copy link
Contributor

comment:7

The file

src/sage/repl/ipython_kernel/widgets.py

contains several badly formatted examples (ending with a single colon : instead of double colons ::).

@fchapoton
Copy link
Contributor

comment:8

ok

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@vbraun
Copy link
Member

vbraun commented Mar 4, 2018

Changed branch from u/jdemeyer/ticket/24595 to c37195c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants