correction : Re: pygtk button event

psaroudakis at gmail.com psaroudakis at gmail.com
Tue Mar 27 08:03:05 EDT 2007


Oups a small mistake:

bt=application.get_widget('button1')

psaroudakis at gmail.com wrote:
> 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




More information about the Python-list mailing list