/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: Scott James Remnant
  • Date: 2005-10-17 04:26:00 UTC
  • Revision ID: scott@netsplit.com-20051017042600-b3a3265abfffdf53
Split the display in two with a pane, we'll use the bottom half to show
information about the current revision.  Add a Back and Forward button
which figure out which revision is logically the next of previous and
moves the cursor to it.  Handle the cursor-changed event to enable/disable
the buttons (and soon update the bottom pane).

Further split up graph.py so we can stash the internal lists to do the
above; also it may allow us in future to produce partial graphs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
import pygtk
3
 
import gtk
4
 
 
5
 
class Window(gtk.Window):
6
 
 
7
 
    def __init__(self, parent=None):
8
 
        gtk.Window.__init__(self, gtk.WINDOW_TOPLEVEL)
9
 
        self._parent = parent
10
 
        
11
 
        self.connect('key-press-event', self._on_key_press)
12
 
        
13
 
    def _on_key_press(self, widget, event):
14
 
        keyname = gtk.gdk.keyval_name(event.keyval)
15
 
        if event.state & gtk.gdk.CONTROL_MASK:
16
 
            if keyname is "w":
17
 
                self.destroy()
18
 
                if self._parent is None:
19
 
                    gtk.main_quit()
20
 
            elif keyname is "q":
21
 
                gtk.main_quit()
22