pygtk button event

P

psaroudakis

Hi....


i am trying to implement the following:

I want to be able to press a button, perform a task and return a
value.

my button is named button1 and I used glade to build the gui.

so, something like this should work....


application=gtk.glade.XML('app.glade','app')
bt=app.get_widget('button1')
bt.connect('clicked',on_btClicked)
def on_btClicked(widget,event):
if data==0:
P=1
else:
P=2
return P

How can I get P?

Something like this doesn't work:

bt.connect('clicked',P=on_btClicked)

How can I return P???


Thanks!

Nick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top