Christian Blouin wrote: > Is there a way around to import GUIMode before the > application is created? I have a bunch of GUIMode classes that get > declared along with my derived floatcanvas, then only after this I can > create the application. However, If I try to import the GUIMode classes, > I get a PyNoAppError.
> Any thoughts in getting around this? I've struggles with this (the fact you can't do anything wx-y until you create the app) a bunch of times, but never found a universal solution. As far as GUI-modes go -- I've set it up so it gets imported in a class __init__, rather than at the top of the module (see NavCanvas). However, I agree that it's not optimum to have a module that can not be imported before the App is created. In this case the issue is the Cursors -- they are created in GUIMode.py on module import, and that can't be done until the app is created. One solution would be to have "lazy" creation of the Cursors -- have them not created until they are needed the first time. This could be done either one at a time, or have them all created when the first is needed. I suppose one at a time would be better. In that case, one could have a huge number of possible cursors, and only those actually needed would be greated. If you want to do that, I'd be glad to include it. Perhaps a separate Cursors module would be called for -- maybe put it in Utilities module. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] _______________________________________________ FloatCanvas mailing list [email protected] http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas
