pygtk button right/middle click

Chris Angelico rosuav at gmail.com
Wed Mar 30 11:58:11 EDT 2016


On Thu, Mar 31, 2016 at 2:36 AM, Grant Edwards <invalid at invalid.invalid> wrote:
> I'm trying to figure out how to get a pygtk button respond to
> somehting other than just a simple "left click".  With a standard
> 3-button mouse, X11 provides at least 9 different "click" types, but
> the pygtk button only seems to support one of them.

You're looking at a couple of different, but related, things. The
clicked() event means "the button was activated", which might have
been caused by a mouse event, or possibly a keyboard or other
activation.

What you want is to react to other forms of mouse event. For that, you
should be able to hook the generic widget handling...

> After googling for some time, I haven't found any good answers.  Some
> people just say things like "use the button_release_event signal of
> the button widget".

... which is what this is talking about. What you'll get is button
press and release events, and it'll be up to you to figure out if they
represent clicks or not. But you'll get events for every mouse button
that way.

ChrisA



More information about the Python-list mailing list