/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz
298.2.2 by Daniel Schierbeck
Added the new Window base class.
1
from gi.repository import Gdk
734.1.3 by Curtis Hovey
Update diff to gtk3.
2
from gi.repository import Gtk
734.1.1 by Curtis Hovey
Mechanical changes made by pygi.convert.sh.
3
298.2.2 by Daniel Schierbeck
Added the new Window base class.
4
734.1.3 by Curtis Hovey
Update diff to gtk3.
5
class Window(Gtk.Window):
734.1.1 by Curtis Hovey
Mechanical changes made by pygi.convert.sh.
6
298.2.2 by Daniel Schierbeck
Added the new Window base class.
7
    def __init__(self, parent=None):
8
        super(Window, self).__init__(type=Gtk.WindowType.TOPLEVEL)
734.1.51 by Curtis Hovey
Fix the initializer for many classes.
9
        self._parent = parent
298.2.2 by Daniel Schierbeck
Added the new Window base class.
10
614.1.1 by Vincent Ladeuil
Fix bug #131589 by using a gtk.Window instead of a gtk.Dialog.
11
        self.connect('key-press-event', self._on_key_press)
298.2.2 by Daniel Schierbeck
Added the new Window base class.
12
614.1.1 by Vincent Ladeuil
Fix bug #131589 by using a gtk.Window instead of a gtk.Dialog.
13
    def _on_key_press(self, widget, event):
298.2.2 by Daniel Schierbeck
Added the new Window base class.
14
        keyname = Gdk.keyval_name(event.keyval)
734.1.1 by Curtis Hovey
Mechanical changes made by pygi.convert.sh.
15
        if event.get_state() & Gdk.ModifierType.CONTROL_MASK:
734.1.7 by Curtis Hovey
Updated buffer.getText() calls and ModifierType enums.
16
            if keyname is "w":
298.2.2 by Daniel Schierbeck
Added the new Window base class.
17
                self.destroy()
18
                if self._parent is None:
19
                    Gtk.main_quit()
734.1.1 by Curtis Hovey
Mechanical changes made by pygi.convert.sh.
20
            elif keyname is "q":
298.2.2 by Daniel Schierbeck
Added the new Window base class.
21
                Gtk.main_quit()
734.1.1 by Curtis Hovey
Mechanical changes made by pygi.convert.sh.
22
298.2.2 by Daniel Schierbeck
Added the new Window base class.
23