Hi,

My guess is that in cut-n-pasting from the web page you have messed up the
spacing.  Here's what I used and it worked fine;

#!/usr/bin/env python

from gtk import *

def hello_cb(button):
        print "Hello World"
        window.destroy()

window = GtkWindow(WINDOW_TOPLEVEL) # create a top level window
window.connect("destroy", mainquit) # quit the event loop on destruction
window.set_border_width(10)         # set padding round child widget

button = GtkButton("Hello World")
button.connect("clicked", hello_cb) # call hello_cb when clicked
window.add(button)                  # add button to window
button.show()                       # show button

window.show()
mainloop()       

If you've already got pygtk there are some examples in the distribution which
should give more insight - or I've been searching google for specific things
e.g GtkText python.

Cheers,

Steve 


On Mon, Jun 18, 2001 at 04:52:20PM -0500, Jason Brock wrote:
> I get this error when running the code off of
> http://www.daa.com.au/%7ejames/pygtk/
> 
>  File "py2.py", line 3
>     def hello_cb(button):
>     ^
> SyntaxError: invalid syntax
> 
> Thank you
> Jason Brock
> 
> 
> _______________________________________________
> pygtk mailing list   [EMAIL PROTECTED]
> http://www.daa.com.au/mailman/listinfo/pygtk
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to