Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.news-service.com!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'wed,': 0.03; 'parameter': 0.05; 'variable,': 0.07; 'parameter.': 0.09; 'pm,': 0.10; '25,': 0.12; 'wrote:': 0.14; '(when': 0.16; 'angelico': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:button': 0.16; 'subject:pyGTK': 0.16; 'header:In-Reply- To:1': 0.21; 'trying': 0.23; 'clicked': 0.23; 'received:209.85.210.174': 0.23; 'received:mail- iy0-f174.google.com': 0.23; 'windows': 0.26; 'object': 0.26; "i'm": 0.27; 'message-id:@mail.gmail.com': 0.28; 'all,': 0.30; 'connected': 0.32; 'named': 0.32; 'to:addr:python-list': 0.33; 'familiar': 0.33; 'chris': 0.34; 'reference': 0.35; 'received:google.com': 0.37; 'received:209.85': 0.37; 'another': 0.37; 'two': 0.37; 'but': 0.38; 'subject:: ': 0.38; 'should': 0.39; 'received:209': 0.39; 'to:addr:python.org': 0.39; 'believe': 0.66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=ranlxXXkpScoa/H7bM4jq3QO4rt75Z96VQzKGgBGP58=; b=I+CoCQORYFzSKwcd1KOlveEEkw4xQBF+4xV17ys7gvlI2bgtxtbPINdnz9OsPlqXZJ pFBZ2SHZlqpTK7ljAqex4/LkQ+Kt7utkc/9wCSwOw9rni9y1OJnrslByiqzl68joATNk DMQg5lMbWWEgQEQxszOz2kHoeBqNTbkrpC1ko= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=citYIqw6W62Er8NHKDcVGac9rWCOghgtzFPEr7QCgcXvXm0bIgfYbQ+Kw3UTOabGHl 3IGW+kd0mI2zM7nfatCN+GWaBpjxiM6L+0430GttjiyykN8fOLqNxOoo4Hb3FWq0n5b8 rW/x5HAFW8Jh2rp0nF8n8Zv2Sk4XzJAQi2jB4= MIME-Version: 1.0 In-Reply-To: <4ddcbb68$0$18241$4fafbaef@reader2.news.tin.it> References: <4ddcbb68$0$18241$4fafbaef@reader2.news.tin.it> Date: Wed, 25 May 2011 18:58:16 +1000 Subject: Re: pyGTK identify a button From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 15 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1306313900 news.xs4all.nl 49180 [::ffff:82.94.164.166]:53018 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:6214 On Wed, May 25, 2011 at 6:18 PM, Tracubik wrote: > Hi all, > i'm trying to write a simple windows with two button in GTK, i need a way to > identify wich button is pressed. > Consider that: > > the two button are connected (when clicked) to infoButton(self, widget, > data=None) I'm not terribly familiar with GTK, but I believe the 'widget' parameter is the button that was clicked on. Whatever means you have for distinguishing them (saving another reference to each object in a named variable, etc), you should be able to do with that parameter. Chris Angelico