Show More
@@ -34,8 +34,8 b' button.show()' | |||||
34 | window.show() |
|
34 | window.show() | |
35 |
|
35 | |||
36 | try: |
|
36 | try: | |
37 |
from IPython.lib.inputhook import |
|
37 | from IPython.lib.inputhook import enable_gtk | |
38 |
|
|
38 | enable_gtk() | |
39 | except ImportError: |
|
39 | except ImportError: | |
40 | gtk.main() |
|
40 | gtk.main() | |
41 |
|
41 |
@@ -35,6 +35,6 b" if __name__ == '__main__':" | |||||
35 | sw.show() |
|
35 | sw.show() | |
36 |
|
36 | |||
37 | try: |
|
37 | try: | |
38 |
from IPython import |
|
38 | from IPython import enable_qt4; enable_qt4(app) | |
39 | except ImportError: |
|
39 | except ImportError: | |
40 | app.exec_() |
|
40 | app.exec_() |
@@ -27,6 +27,6 b' root = Tk()' | |||||
27 | app = MyApp(root) |
|
27 | app = MyApp(root) | |
28 |
|
28 | |||
29 | try: |
|
29 | try: | |
30 |
from IPython import |
|
30 | from IPython import enable_tk; enable_tk(root) | |
31 | except ImportError: |
|
31 | except ImportError: | |
32 | root.mainloop() |
|
32 | root.mainloop() |
@@ -102,8 +102,8 b' if app is None:' | |||||
102 | app = MyApp(redirect=False, clearSigInt=False) |
|
102 | app = MyApp(redirect=False, clearSigInt=False) | |
103 |
|
103 | |||
104 | try: |
|
104 | try: | |
105 |
from IPython.lib.inputhook import |
|
105 | from IPython.lib.inputhook import enable_wx | |
106 |
|
|
106 | enable_wx(app) | |
107 | except ImportError: |
|
107 | except ImportError: | |
108 | app.MainLoop() |
|
108 | app.MainLoop() | |
109 |
|
109 |
@@ -1238,13 +1238,13 b' Second, when using the ``PyOSInputHook`` approach, a GUI application should' | |||||
1238 | ``PyOSInputHook``. This means that applications that are meant to be used both |
|
1238 | ``PyOSInputHook``. This means that applications that are meant to be used both | |
1239 | in IPython and as standalone apps need to have special code to detects how the |
|
1239 | in IPython and as standalone apps need to have special code to detects how the | |
1240 | application is being run. We highly recommend using IPython's |
|
1240 | application is being run. We highly recommend using IPython's | |
1241 |
:func:` |
|
1241 | :func:`enable_foo` functions for this. Here is a simple example that shows the | |
1242 | recommended code that should be at the bottom of a wxPython using GUI |
|
1242 | recommended code that should be at the bottom of a wxPython using GUI | |
1243 | application:: |
|
1243 | application:: | |
1244 |
|
1244 | |||
1245 | try: |
|
1245 | try: | |
1246 |
from IPython import |
|
1246 | from IPython.lib.inputhook import enable_wx | |
1247 |
|
|
1247 | enable_wx(app) | |
1248 | except ImportError: |
|
1248 | except ImportError: | |
1249 | app.MainLoop() |
|
1249 | app.MainLoop() | |
1250 |
|
1250 |
General Comments 0
You need to be logged in to leave comments.
Login now