meld r1069 - trunk
- From: stevek svn gnome org
- To: svn-commits-list gnome org
- Subject: meld r1069 - trunk
- Date: Sat, 11 Oct 2008 19:52:58 +0000 (UTC)
Author: stevek
Date: Sat Oct 11 19:52:58 2008
New Revision: 1069
URL: http://svn.gnome.org/viewvc/meld?rev=1069&view=rev
Log:
Close tab on middle click.
Modified:
trunk/meldapp.py
Modified: trunk/meldapp.py
==============================================================================
--- trunk/meldapp.py (original)
+++ trunk/meldapp.py Sat Oct 11 19:52:58 2008
@@ -400,13 +400,23 @@
icon.set_from_file( paths.share_dir("glade2/pixmaps/%s" % iconname) )
icon.set_from_pixbuf(icon.get_pixbuf().scale_simple(16, 16, 2)) #TODO stock image
+ label_box = gtk.EventBox()
+ label_box.add_events(gtk.gdk.BUTTON_PRESS_MASK)
+ label_box.connect("button-press-event", self.on_label_clicked)
+ label_box.add(label)
+
self.pack_start(icon, expand=False)
- self.pack_start(label)
+ self.pack_start(label_box)
self.pack_start(button, expand=False)
self.set_tooltip_text(text)
self.show_all()
self.__label = label
+ self.__onclose = onclose
+
+ def on_label_clicked(self, box, event):
+ if event.type == gtk.gdk.BUTTON_PRESS and event.button == 2:
+ self.__onclose(None)
def get_label_text(self):
return self.__label.get_text()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]