On 2003-06-21, Ken Housley <[EMAIL PROTECTED]> wrote:
> I am new to pygtk, but I have been writing in python for a few
> months.  I cannot seem to get pygtk to do the simplest thing.
> When I enter
> >>> import gtk  
> That works, but when I then enter
> >>> window = gtk.Window(gtk.WINDOW_TOPLEVEL)
> Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
> AttributeError: 'module' object has no attribute 'Window'
> [...]
> I have upgraded the python that came with the Mandrake 8.2 to
> Python 2.2.2.  Could that be the problem? How do I go about
> finding the problem and fixing it?

Your python is finding the gtk module, otherwise it would fail at
the import. My guess is that you are importing pygtk-0. You should
verify this doing a 'dir(gtk)', this would probably show GtkWindow
and such. To be sure that you are using the latest pygtk version,
try the code in Faq 2.4, which is:

  import pygtk
  pygtk.require("2.0")
  import gtk
  window = gtk.Window(gtk.WINDOW_TOPLEVEL)

-- 
 Please don't send me private copies of your public answers. Thanks.
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to