[pygtk] gnome applets and menus

Rob Brown-Bayliss uncertain.genius at gmail.com
Wed Feb 1 13:57:28 WST 2006


On 1/31/06, Nigel Tao <nigel.tao at myrealbox.com> wrote:
> > Is it possible to make the right click on the
> > textview be ignored by the textview widget and
> > acted on by the applet itself?
>
> Look at the 0.1 version (ie the simplest working example) of http://www.ugr.es/~arturogf/applets/software/ which comes with a bonus "writing applets in python" tutorial at http://www.ugr.es/~arturogf/applets/
>

I have seen that, but it does not work with the textview widget, here
is a code snipet:

		self.sw = gtk.ScrolledWindow()
		self.sw.set_shadow_type(gtk.SHADOW_ETCHED_IN)
		self.sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_NEVER)
		self.sw.set_size_request(300,self.applet.get_size())
		self.ev = gtk.EventBox()
		self.ev.connect("button-press-event", self.ev_button_press)
		self.ticker = ticker.Ticker(1000, 300, self.applet.get_size()))
		self.ev.add(self.ticker)
		self.sw.add(self.ev)

But when I right click on the textview widget (self.ticker) the
standard textview menu appears, not the aplets menu.

So is there some way to get a textview widget to ignore this click so 
that the eventbox can react to it?


More information about the pygtk mailing list