##// END OF EJS Templates
reformat
Matthias Bussonnier -
Show More
@@ -43,11 +43,11 b' backend2gui = dict(zip(backends.values(), backends.keys()))'
43 backend2gui['Qt4Agg'] = 'qt'
43 backend2gui['Qt4Agg'] = 'qt'
44 # In the reverse mapping, there are a few extra valid matplotlib backends that
44 # In the reverse mapping, there are a few extra valid matplotlib backends that
45 # map to the same GUI support
45 # map to the same GUI support
46 backend2gui['GTK'] = backend2gui['GTKCairo'] = 'gtk'
46 backend2gui["GTK"] = backend2gui["GTKCairo"] = "gtk"
47 backend2gui['GTK3Cairo'] = 'gtk3'
47 backend2gui["GTK3Cairo"] = "gtk3"
48 backend2gui['GTK4Cairo'] = 'gtk4'
48 backend2gui["GTK4Cairo"] = "gtk4"
49 backend2gui['WX'] = 'wx'
49 backend2gui["WX"] = "wx"
50 backend2gui['CocoaAgg'] = 'osx'
50 backend2gui["CocoaAgg"] = "osx"
51 # And some backends that don't need GUI integration
51 # And some backends that don't need GUI integration
52 del backend2gui["nbAgg"]
52 del backend2gui["nbAgg"]
53 del backend2gui["agg"]
53 del backend2gui["agg"]
@@ -1,25 +1,26 b''
1 """
1 """
2 Enable Gtk4 to be used interactively by IPython.
2 Enable Gtk4 to be used interactively by IPython.
3 """
3 """
4 #-----------------------------------------------------------------------------
4 # -----------------------------------------------------------------------------
5 # Copyright (c) 2021, the IPython Development Team.
5 # Copyright (c) 2021, the IPython Development Team.
6 #
6 #
7 # Distributed under the terms of the Modified BSD License.
7 # Distributed under the terms of the Modified BSD License.
8 #
8 #
9 # The full license is in the file COPYING.txt, distributed with this software.
9 # The full license is in the file COPYING.txt, distributed with this software.
10 #-----------------------------------------------------------------------------
10 # -----------------------------------------------------------------------------
11
11
12 #-----------------------------------------------------------------------------
12 # -----------------------------------------------------------------------------
13 # Imports
13 # Imports
14 #-----------------------------------------------------------------------------
14 # -----------------------------------------------------------------------------
15
15
16 import sys
16 import sys
17
17
18 from gi.repository import GLib
18 from gi.repository import GLib
19
19
20 #-----------------------------------------------------------------------------
20 # -----------------------------------------------------------------------------
21 # Code
21 # Code
22 #-----------------------------------------------------------------------------
22 # -----------------------------------------------------------------------------
23
23
24
24 class _InputHook:
25 class _InputHook:
25 def __init__(self, context):
26 def __init__(self, context):
@@ -8,7 +8,9 b' from gi.repository import GLib'
8 class _InputHook:
8 class _InputHook:
9 def __init__(self, context):
9 def __init__(self, context):
10 self._quit = False
10 self._quit = False
11 GLib.io_add_watch(context.fileno(), GLib.PRIORITY_DEFAULT, GLib.IO_IN, self.quit)
11 GLib.io_add_watch(
12 context.fileno(), GLib.PRIORITY_DEFAULT, GLib.IO_IN, self.quit
13 )
12
14
13 def quit(self, *args, **kwargs):
15 def quit(self, *args, **kwargs):
14 self._quit = True
16 self._quit = True
@@ -9,7 +9,8 b' In [2]: %run gui-gtk4.py'
9 """
9 """
10
10
11 import gi
11 import gi
12 gi.require_version('Gtk', '4.0')
12
13 gi.require_version("Gtk", "4.0")
13 from gi.repository import Gtk, GLib # noqa
14 from gi.repository import Gtk, GLib # noqa
14
15
15
16
General Comments 0
You need to be logged in to leave comments. Login now