Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico Newsgroups: comp.lang.python Subject: Re: pygtk button right/middle click Date: Thu, 31 Mar 2016 02:58:11 +1100 Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de rdwkHb55ezjnQAgEAqHOwgQOFv54kSZhFSbwTOrJIcbQ== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.036 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'mouse': 0.07; 'cc:addr :python-list': 0.09; 'things.': 0.15; 'thu,': 0.15; '"use': 0.16; '2016': 0.16; 'different,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'googling': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'widget': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; '31,': 0.22; 'keyboard': 0.22; 'trying': 0.22; 'am,': 0.23; 'seems': 0.23; "haven't": 0.24; 'header:In-Reply-To:1': 0.24; 'figure': 0.27; 'not.': 0.27; 'least': 0.27; 'message-id:@mail.gmail.com': 0.27; 'about.': 0.29; "i'm": 0.30; 'subject:/': 0.30; '"the': 0.32; 'possibly': 0.32; 'that,': 0.34; 'received:google.com': 0.35; 'generic': 0.35; 'but': 0.36; 'should': 0.36; 'received:209.85': 0.36; 'event.': 0.36; 'subject:: ': 0.37; 'say': 0.37; 'received:209.85.213': 0.37; 'release': 0.37; 'things': 0.38; 'received:209': 0.38; 'button': 0.38; 'represent': 0.38; 'means': 0.39; 'some': 0.40; 'press': 0.61; "you'll": 0.61; 'caused': 0.61; 'different': 0.63; 'mar': 0.65; 'talking': 0.67; '2:36': 0.84; 'activation.': 0.84; 'chrisa': 0.84; 'pygtk': 0.84; 'to:none': 0.91; 'edwards': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc; bh=XFW/BWi3yu1rm2ud0Xcb9W80orNDRjYQYmynmbDTXyk=; b=LF3uAbQuWifzGmjeSojanMdDSt9IMg5T7iej7jP1+Y60cUX3Dm1rq7BLkQ04nzD6+i LYnRkyJAGabmoXLURu/jbPE+ausA+oQzYBnnICYaYvsON2rxGFT+KKPgGrzZ1MZG+9Ib E5ITAz3YT+KfW+XS0XlRkd/ym4m2mp19Q6pSopSmrWv4VGzaKRsviB5sglewuy4cxs/U vPgog88b6DuWxRW9AxJ8H/TiVOalqrf7H9dymCJiejwn+mjd4RFVYT7pHdPF6nVCXxBo WLQE+Eoe3MtZyljoBlnA36urnmCj33B87R6ofoLrGY/rAvuvfl6pbJfp8asMbuKyzVB0 m/SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:cc; bh=XFW/BWi3yu1rm2ud0Xcb9W80orNDRjYQYmynmbDTXyk=; b=ahh3wo18ED35Ce2C6mmJtXVxjbVwrA60IUmOP4A7X5HjhMj14aw9wPcO+dbYbT5FWU tGhu3xNGKmbLL6+wQk6TND6GUGmIWlIfZxtaiQ0EQmv44IE3MvaBjSRVNH3Xp01k9BF6 vkX4V5ZEbu9kJauCzVRCZZx+F/RvLsgJ9jLX7mTyzLm7haBWpwLtYpajoQEbBsVORgVS pc8F3blObkGWNmJ12zkc3GLT4BYVXVAlVpYGE3oV6MTrcM8dldpXo89Ihdv+l/PhO1v7 fQfCih/iAPTsFjK/h02EEtDsfPf0uo1YhMBcAerfkoJPmEuYqAwZ8YYZOHFiTlvR/i+e owxQ== X-Gm-Message-State: AD7BkJKrGI0LJRB+pA/qJ+xAlR6EYYZuWAjZP7GaqRX5dYoztYLSBuTMlAsGRfTwMG5zHNKu5W/BTBAn6EIYwQ== X-Received: by 10.50.43.226 with SMTP id z2mr11154657igl.94.1459353491331; Wed, 30 Mar 2016 08:58:11 -0700 (PDT) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:106089 On Thu, Mar 31, 2016 at 2:36 AM, Grant Edwards 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