diff --git a/mytwitter.py b/mytwitter.py index 97b854a..8b709c8 100755 --- a/mytwitter.py +++ b/mytwitter.py @@ -384,6 +384,7 @@ class TweetBox(gtk.VBox): self.text.set_line_wrap(True) if gtk.gtk_version[0] > 2 or (gtk.gtk_version[0] == 2 and gtk.gtk_version[1] >= 18): self.text.connect('activate-link', self.on_url_clicked) + self.text.connect('button-press-event', self.on_mouse_clicked) # Build the buttons button_box = gtk.HBox() @@ -460,13 +461,22 @@ class TweetBox(gtk.VBox): self.emit('retweet') + def on_mouse_clicked(self, widget, event): + self.set_read(True) + + # fixme: only call on_url_clicked if there is an active uri + # does pygtk even support this? + if event.button == 1: + self.on_url_clicked(widget) + + def on_url_clicked(self, widget): - # fixme: for now, hard code firefox, since that's what I use - # Eventually make this configgable - # fixme: this doesn't work at all right now... figure out how to make this signal happen + # fixme: we're catching this signal just to debug why it doesn't get emitted + # seems to be related to EventBox? print 'debug: on_url_clicked()' -# subprocess.Popen('/usr/bin/firefox ' + self.text.get_current_uri(), shell=False).pid - + return True + + # end class TweetBox