pygtk button event

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • psaroudakis@gmail.com

    #1

    pygtk button event

    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_widg et('button1')
    bt.connect('cli cked',on_btClic ked)
    def on_btClicked(wi dget,event):
    if data==0:
    P=1
    else:
    P=2
    return P

    How can I get P?

    Something like this doesn't work:

    bt.connect('cli cked',P=on_btCl icked)

    How can I return P???


    Thanks!

    Nick

  • psaroudakis@gmail.com

    #2
    correction : Re: pygtk button event

    Oups a small mistake:

    bt=application. get_widget('but ton1')

    psaroudakis@gma il.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_widg et('button1')
    bt.connect('cli cked',on_btClic ked)
    def on_btClicked(wi dget,event):
    if data==0:
    P=1
    else:
    P=2
    return P
    >
    How can I get P?
    >
    Something like this doesn't work:
    >
    bt.connect('cli cked',P=on_btCl icked)
    >
    How can I return P???
    >
    >
    Thanks!
    >
    Nick

    Comment

    Working...