Show More
@@ -1158,8 +1158,8 left as an exercise for the reader. | |||||
1158 |
|
1158 | |||
1159 | .. _gui_support: |
|
1159 | .. _gui_support: | |
1160 |
|
1160 | |||
1161 |
GUI event loop support |
|
1161 | GUI event loop support | |
1162 |
====================== |
|
1162 | ====================== | |
1163 |
|
1163 | |||
1164 | .. versionadded:: 0.11 |
|
1164 | .. versionadded:: 0.11 | |
1165 | The ``%gui`` magic and :mod:`IPython.lib.inputhook`. |
|
1165 | The ``%gui`` magic and :mod:`IPython.lib.inputhook`. | |
@@ -1179,16 +1179,15 advantages of this are: | |||||
1179 | For users, enabling GUI event loop integration is simple. You simple use the |
|
1179 | For users, enabling GUI event loop integration is simple. You simple use the | |
1180 | ``%gui`` magic as follows:: |
|
1180 | ``%gui`` magic as follows:: | |
1181 |
|
1181 | |||
1182 |
%gui [ |
|
1182 | %gui [GUINAME] | |
1183 |
|
1183 | |||
1184 | With no arguments, ``%gui`` removes all GUI support. Valid ``GUINAME`` |
|
1184 | With no arguments, ``%gui`` removes all GUI support. Valid ``GUINAME`` | |
1185 |
arguments are ``wx``, ``qt4``, ``gtk`` and ``tk``. |
|
1185 | arguments are ``wx``, ``qt4``, ``gtk`` and ``tk``. | |
1186 | create and return a running application object for the selected GUI toolkit. |
|
|||
1187 |
|
1186 | |||
1188 | Thus, to use wxPython interactively and create a running :class:`wx.App` |
|
1187 | Thus, to use wxPython interactively and create a running :class:`wx.App` | |
1189 | object, do:: |
|
1188 | object, do:: | |
1190 |
|
1189 | |||
1191 |
%gui |
|
1190 | %gui wx | |
1192 |
|
1191 | |||
1193 | For information on IPython's Matplotlib integration (and the ``pylab`` mode) |
|
1192 | For information on IPython's Matplotlib integration (and the ``pylab`` mode) | |
1194 | see :ref:`this section <matplotlib_support>`. |
|
1193 | see :ref:`this section <matplotlib_support>`. | |
@@ -1233,7 +1232,7 PyQt and PySide | |||||
1233 |
|
1232 | |||
1234 | .. attempt at explanation of the complete mess that is Qt support |
|
1233 | .. attempt at explanation of the complete mess that is Qt support | |
1235 |
|
1234 | |||
1236 | When you use ``gui=qt`` or ``pylab=qt``, IPython can work with either |
|
1235 | When you use ``--gui=qt`` or ``--pylab=qt``, IPython can work with either | |
1237 | PyQt4 or PySide. There are three options for configuration here, because |
|
1236 | PyQt4 or PySide. There are three options for configuration here, because | |
1238 | PyQt4 has two APIs for QString and QVariant - v1, which is the default on |
|
1237 | PyQt4 has two APIs for QString and QVariant - v1, which is the default on | |
1239 | Python 2, and the more natural v2, which is the only API supported by PySide. |
|
1238 | Python 2, and the more natural v2, which is the only API supported by PySide. | |
@@ -1251,7 +1250,7 PyQt4 to use its v2 API. So if ``QT_API=pyside`` PySide will be used, | |||||
1251 | and if ``QT_API=pyqt`` then PyQt4 will be used *with the v2 API* for |
|
1250 | and if ``QT_API=pyqt`` then PyQt4 will be used *with the v2 API* for | |
1252 | QString and QVariant, so ETS codes like MayaVi will also work with IPython. |
|
1251 | QString and QVariant, so ETS codes like MayaVi will also work with IPython. | |
1253 |
|
1252 | |||
1254 | If you launch IPython in pylab mode with ``ipython pylab=qt``, then IPython |
|
1253 | If you launch IPython in pylab mode with ``ipython --pylab=qt``, then IPython | |
1255 | will ask matplotlib which Qt library to use (only if QT_API is *not set*), |
|
1254 | will ask matplotlib which Qt library to use (only if QT_API is *not set*), | |
1256 | via the 'backend.qt4' rcParam. |
|
1255 | via the 'backend.qt4' rcParam. | |
1257 | If matplotlib is version 1.0.1 or older, then IPython will always use PyQt4 |
|
1256 | If matplotlib is version 1.0.1 or older, then IPython will always use PyQt4 | |
@@ -1264,7 +1263,7 without setting the v2 APIs, since neither v2 PyQt nor PySide work. | |||||
1264 | an incompatible mode. |
|
1263 | an incompatible mode. | |
1265 |
|
1264 | |||
1266 | It also means that you must *not* have ``QT_API`` set if you want to |
|
1265 | It also means that you must *not* have ``QT_API`` set if you want to | |
1267 | use ``gui=qt`` with code that requires PyQt4 API v1. |
|
1266 | use ``--gui=qt`` with code that requires PyQt4 API v1. | |
1268 |
|
1267 | |||
1269 |
|
1268 | |||
1270 |
|
1269 | |||
@@ -1286,7 +1285,7 process of working with the Matplotlib developers to finalize the new pylab | |||||
1286 | API, but for now you can use Matplotlib interactively using the following |
|
1285 | API, but for now you can use Matplotlib interactively using the following | |
1287 | commands:: |
|
1286 | commands:: | |
1288 |
|
1287 | |||
1289 |
%gui |
|
1288 | %gui wx | |
1290 | import matplotlib |
|
1289 | import matplotlib | |
1291 | matplotlib.use('wxagg') |
|
1290 | matplotlib.use('wxagg') | |
1292 | from matplotlib import pylab |
|
1291 | from matplotlib import pylab |
General Comments 0
You need to be logged in to leave comments.
Login now