Re: pyGTK identify a button

2011-05-26 Thread Alister Ware
On Wed, 25 May 2011 10:18:48 +0200, 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) > > infoButton()

Re: pyGTK identify a button

2011-05-25 Thread Cousin Stanley
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. > #!/usr/bin/env python import gtk def console_display( button , args ) : a0 , a1 , a2 = args print '%s %s %s ' % ( a0 , a1 , a2

Re: pyGTK identify a button

2011-05-25 Thread Claudiu Nicolaie CISMARU
> thanks but, as i've sayed before, i can't use func_data 'cause i don't > know how to set it on glade3.8, that is the program i use to create > the > GUI. > Anyway, i think this is the only way to identify the button :-/ Hack into the generated source! -- Claudiu Nicolaie CISMARU GNU GPG

Re: pyGTK identify a button

2011-05-25 Thread Chris Angelico
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 f

Re: pyGTK identify a button

2011-05-25 Thread Tracubik
On 25/05/2011 10:44, Claudiu Nicolaie CISMARU wrote: the two button are connected (when clicked) to infoButton(self, widget, data=None) From documentation: handler_id = object.connect(name, func, func_data) So: button1.connect(when is pressed, your_function, 1) button2.connect(when is presse

Re: pyGTK identify a button

2011-05-25 Thread Claudiu Nicolaie CISMARU
> the two button are connected (when clicked) to infoButton(self, > widget, > data=None) From documentation: handler_id = object.connect(name, func, func_data) So: button1.connect(when is pressed, your_function, 1) button2.connect(when is pressed, your_function, 2) (This code is conception, I

pyGTK identify a button

2011-05-25 Thread Tracubik
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) infoButton() is something like this infoButton(self, widget, data=None):