NameError

G

GMTaglia

Hi guys,

probably dumb question but after googling a lot I couldn't find an answer.
with a simple Gtk:Dialog I have this error:

Traceback (most recent call last):
File "elenco.py", line 122, in show_msg
dialog.vbox.pack_start(label, TRUE, TRUE, 0)
NameError: global name 'TRUE' is not defined

This surprising me a lot, I don't understand what is wrong,

Here is the code:

def show_msg(self, widget):
dialog = gtk.Dialog("Info Box", None, 0, (gtk.STOCK_CLOSE,
gtk.RESPONSE_CLOSE))
label = gtk.Label("Dialogs are groovy")
dialog.vbox.pack_start(label, TRUE, TRUE, 0)
label.show()

very simple (hope the mistake is here)

I have python 2.3.4 Installed with pygtk 2.4.0 on Gentoo GNU/Linux.

Thank's to everybody in advance.
Cheers, Mario
 
P

Paul McNett

GMTaglia said:
dialog.vbox.pack_start(label, TRUE, TRUE, 0)

Try changing that to:
dialog.vbox.pack_start(label, True, True, 0)

If that doesn't work, try:
dialog.vbox.pack_start(label, 1, 1, 0)
 
G

GMTaglia

Answering to myself....
probably dumb question but after googling a lot I couldn't find an answer.
with a simple Gtk:Dialog I have this error:

yep really dumb
Traceback (most recent call last):
File "elenco.py", line 122, in show_msg
dialog.vbox.pack_start(label, TRUE, TRUE, 0)
NameError: global name 'TRUE' is not defined

I just thought that TRUE (uppercase) was valid python....or not... :)

Cheers, Mario
 

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,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top