Show More
@@ -549,12 +549,21 b' register = inputhook_manager.register' | |||
|
549 | 549 | guis = inputhook_manager.guihooks |
|
550 | 550 | |
|
551 | 551 | # Deprecated methods: kept for backwards compatibility, do not use in new code |
|
552 | enable_wx = lambda app=None: inputhook_manager.enable_gui('wx', app) | |
|
553 | enable_qt4 = lambda app=None: inputhook_manager.enable_gui('qt4', app) | |
|
554 | enable_gtk = lambda app=None: inputhook_manager.enable_gui('gtk', app) | |
|
555 |
|
|
|
556 | enable_glut = lambda app=None: inputhook_manager.enable_gui('glut', app) | |
|
557 | enable_pyglet = lambda app=None: inputhook_manager.enable_gui('pyglet', app) | |
|
558 | enable_gtk3 = lambda app=None: inputhook_manager.enable_gui('gtk3', app) | |
|
552 | def _make_deprecated_enable(name): | |
|
553 | def enable_toolkit(app=None): | |
|
554 | warn("This function is deprecated - use enable_gui(%r) instead" % name) | |
|
555 | inputhook_manager.enable_gui(name, app) | |
|
556 | ||
|
557 | enable_wx = _make_deprecated_enable('wx') | |
|
558 | enable_qt4 = _make_deprecated_enable('qt4') | |
|
559 | enable_gtk = _make_deprecated_enable('gtk') | |
|
560 | enable_tk = _make_deprecated_enable('tk') | |
|
561 | enable_glut = _make_deprecated_enable('glut') | |
|
562 | enable_pyglet = _make_deprecated_enable('pyglet') | |
|
563 | enable_gtk3 = _make_deprecated_enable('gtk3') | |
|
564 | ||
|
565 | def _deprecated_disable(): | |
|
566 | warn("This function is deprecated: use disable_gui() instead") | |
|
567 | inputhook_manager.disable_gui() | |
|
559 | 568 | disable_wx = disable_qt4 = disable_gtk = disable_gtk3 = disable_glut = \ |
|
560 |
disable_pyglet = |
|
|
569 | disable_pyglet = _deprecated_disable |
@@ -33,7 +33,7 b' button.show()' | |||
|
33 | 33 | window.show() |
|
34 | 34 | |
|
35 | 35 | try: |
|
36 |
from IPython.lib.inputhook import enable_g |
|
|
37 |
enable_g |
|
|
36 | from IPython.lib.inputhook import enable_gui | |
|
37 | enable_gui('gtk') | |
|
38 | 38 | except ImportError: |
|
39 | 39 | gtk.main() |
@@ -31,7 +31,7 b' button.show()' | |||
|
31 | 31 | window.show() |
|
32 | 32 | |
|
33 | 33 | try: |
|
34 |
from IPython.lib.inputhook import enable_g |
|
|
35 |
enable_g |
|
|
34 | from IPython.lib.inputhook import enable_gui | |
|
35 | enable_gui('gtk3') | |
|
36 | 36 | except ImportError: |
|
37 | 37 | Gtk.main() |
@@ -27,7 +27,7 b' def on_draw():' | |||
|
27 | 27 | label.draw() |
|
28 | 28 | |
|
29 | 29 | try: |
|
30 |
from IPython.lib.inputhook import enable_ |
|
|
31 |
enable_ |
|
|
30 | from IPython.lib.inputhook import enable_gui | |
|
31 | enable_gui('pyglet') | |
|
32 | 32 | except ImportError: |
|
33 | 33 | pyglet.app.run() |
General Comments 0
You need to be logged in to leave comments.
Login now