/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to window.py

  • Committer: Jelmer Vernooij
  • Date: 2012-07-09 15:23:26 UTC
  • mto: This revision was merged to the branch mainline in revision 794.
  • Revision ID: jelmer@samba.org-20120709152326-dzxb8zoz0btull7n
Remove bzr-notify.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
 
2
from gi.repository import Gdk
2
3
from gi.repository import Gtk
3
4
 
 
5
 
4
6
class Window(Gtk.Window):
5
7
 
6
8
    def __init__(self, parent=None):
7
 
        GObject.GObject.__init__(self, Gtk.WindowType.TOPLEVEL)
 
9
        super(Window, self).__init__(type=Gtk.WindowType.TOPLEVEL)
8
10
        self._parent = parent
9
11
 
10
12
        self.connect('key-press-event', self._on_key_press)
11
13
 
12
14
    def _on_key_press(self, widget, event):
13
15
        keyname = Gdk.keyval_name(event.keyval)
14
 
        if event.get_state() & Gdk.EventMask.CONTROL_MASK:
 
16
        if event.get_state() & Gdk.ModifierType.CONTROL_MASK:
15
17
            if keyname is "w":
16
18
                self.destroy()
17
19
                if self._parent is None: