Re: Errors in __init__

Magnus Lie Hetland <[email protected]> Sat, 26 Oct 2002 19:01:29 +0200
Newsgroups gmane.comp.python.anygui.general
Message-ID <[email protected]>
N. Wieland <[email protected]>:
>
> I'm using anygui from CVS on Debian SID and Gnome 2.
> Here's the simple code I've tried:
> 
> ****
> 
> from anygui import *
> 
> win = Window(title = "anyGUI !",
> 	     size = (600, 400))
> 
> editor = TextArea(size = (600, 400))
> 
> win.add(editor)
> 
> app = Application()
> app.add(win)
> app.run()
> 
> ****
> 
> File "/usr/lib/python2.2/site-packages/anygui/__init__.py", line 9,
> in application raise RuntimeError, 'no application exists'
> RuntimeError: no application exists   

This error is the problem. With the current CVS version you can't
create Windows unless there is an Application object in existence. Try
to move

 app = Application()

to the top of your code and see if that helps.

> I've tried also import anygui as gui.
> I'm just not skilled enought to understand my error, I need a hand...
> Ah, with anygui 1.1 it works !
> 
> Thanks in advance,
> Cheers,

-- 
Magnus Lie Hetland        Practical Python          The Anygui Project
http://hetland.org        http://ppython.com        http://anygui.org


-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in
Las Vegas (supported by COMDEX), the only Apache event to be
fully supported by the ASF. http://www.apachecon.com