From: Lincoln de Sousa Date: Tue, 12 Aug 2008 08:37:45 +0000 (-0300) Subject: adding the attribute last_x to the Gzv.__init__ method and X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fmovie.git;a=commitdiff_plain;h=07b49c16da59d7169ee3906bf6ba69d74e201429 adding the attribute last_x to the Gzv.__init__ method and setting the POINTER_MOTION_MASK in the eventbox widget --- diff --git a/gzv.py b/gzv.py index 42dce80..f74432c 100644 --- a/gzv.py +++ b/gzv.py @@ -139,6 +139,10 @@ class Gzv(GladeLoader): self.evtbox.connect('button-release-event', self.button_release) self.evtbox.connect('motion-notify-event', self.motion_notify) + # making it possible to grab motion events when the mouse is + # over the widget. + self.evtbox.set_events(gtk.gdk.POINTER_MOTION_MASK) + self.model = gtk.ListStore(int, str) self.treeview = self.wid('treeview') self.treeview.set_model(self.model) @@ -160,8 +164,12 @@ class Gzv(GladeLoader): # drawing stuff self.start_x = -1 self.start_y = -1 + self.last_x = -1 self.radius = Ball.DEFAULT_WIDTH + def show(self): + self.window.show_all() + def setup_treeview(self): self.model.connect('rows-reordered', self.on_rows_reordered) @@ -366,5 +374,5 @@ class Gzv(GladeLoader): self.radius = Ball.DEFAULT_WIDTH if __name__ == '__main__': - Gzv().window.show_all() + Gzv().show() gtk.main()