FAQ
Hello.

I am very new to Python so please excuse me if this question is stupid
but I can't find an example anywhere. I've created a form using Glade.
The form has a entry field name pName and a button. I've run glc.py and

created the Python code. Everything worked.. glc created 2 files. the
main program and the window handler file for the button which is
imported into the main program. What I want to know is... How do I
update pName when the button is clicked? I've tried just using

def on_bNext_clicked(widget, mainObj):
pname.set_text("This is a test")

when I run the program and click the button I get the following error
Traceback (innermost last):
File "/usr/lib/python1.5/site-packages/gtk.py", line 125, in __call__
ret = apply(self.func, a)
File "window1Handlers.py", line 15, in on_bNext_clicked
pName.set_text("This is a test")
NameError: pName

How do I access pName ( or any other widget in the window ) ???
Could anyone please guide me in the right direction ???

Thanks in advance...

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedFeb 8, '01 at 12:40p
activeFeb 8, '01 at 12:40p
posts1
users1
websitepython.org

1 user in discussion

Tony Corrente: 1 post

People

Translate

site design / logo © 2022 Grokbase