Re: pyGTK identify a button
- From: Claudiu Nicolaie CISMARU <claudiu@xxxxxxxxxxxxxxx>
- Date: Wed, 25 May 2011 11:44:12 +0300
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 don't really know how is done in GTK).
On the callback:
infoButton(self, widget, data=None):
# discover wich button was pressed
...
# say hello to the button
if data == 1:
print "Hi, button1!"
else:
print "Hi, button2!"
--
Claudiu Nicolaie CISMARU
GNU GPG Key: http://claudiu.targujiu.net/key.gpg
T: +40 755 135455
E: claudiu@xxxxxxxxxxxxxxx, claudiu.cismaru@xxxxxxxxx
Attachment:
signature.asc
Description: This is a digitally signed message part.
- Follow-Ups:
- Re: pyGTK identify a button
- From: Tracubik
- Re: pyGTK identify a button
- References:
- pyGTK identify a button
- From: Tracubik
- pyGTK identify a button
- Prev by Date: Re: File access denied after subprocess completion on Windows platform
- Next by Date: Re: Hotshoting recursive function
- Previous by thread: pyGTK identify a button
- Next by thread: Re: pyGTK identify a button
- Index(es):
Relevant Pages
|