From: Kevin A. <al...@se...> - 2001-11-21 09:19:45
|
> them into cvs tomorrow. I'm going to continue to try and simplify and > improve the startup process. For example, configOptions should just be the > first thing that the app does, but if I move it then some other > way will be > needed to force an option such as always showing the shell. The turtle > sample always uses a shell and the resourceEditor always shows > the Property > Editor. Based on initial tests it does appear I can just move the configOptions call into the framework initialization and if an app needs one of the runtime windows, such as the shell, the user code only needs: config.Configuration().setOption('showShell', 1) Assuming there isn't a side effect that I'm overlooking, the minimal sample is simplified even further and is shown below. I'm leaving in the if __name__ == '__main__' statement because once we support multi-windows and/or backgrounds it should be possible to just import a module and use that background/window in your own app assuming that the class is designed to be used standalone or as part of another app. I haven't fleshed out this idea yet, it is just something that came up when I was thinking about components and redoing the debug windows as PythonCard windows instead of raw wxPython. It would probably be very similar to what Robin is already doing with the wxPython demo.py code. If you didn't expect to ever import the main module then the if statement isn't necessary. ka --- from PythonCardPrototype import model class Minimal(model.Background): def on_menuFileExit_select(self, menu, event): self.Close() if __name__ == '__main__': app = model.PythonCardApp(Minimal) app.MainLoop() |