##// END OF EJS Templates
Added a test for the Gtk3 UI integration, following the Gtk2 pattern.
Thomi Richards -
Show More
@@ -0,0 +1,37 b''
1 #!/usr/bin/env python
2 """Simple Gtk example to manually test event loop integration.
3
4 This is meant to run tests manually in ipython as:
5
6 In [1]: %gui gtk3
7
8 In [2]: %run gui-gtk3.py
9 """
10
11 from gi.repository import Gtk
12
13
14 def hello_world(wigdet, data=None):
15 print "Hello World"
16
17 def delete_event(widget, event, data=None):
18 return False
19
20 def destroy(widget, data=None):
21 Gtk.main_quit()
22
23 window = Gtk.Window(Gtk.WindowType.TOPLEVEL)
24 window.connect("delete_event", delete_event)
25 window.connect("destroy", destroy)
26 button = Gtk.Button("Hello World")
27 button.connect("clicked", hello_world, None)
28
29 window.add(button)
30 button.show()
31 window.show()
32
33 try:
34 from IPython.lib.inputhook import enable_gtk3
35 enable_gtk3()
36 except ImportError:
37 Gtk.main()
General Comments 0
You need to be logged in to leave comments. Login now