From: Roger B. <ro...@ro...> - 2004-04-27 02:22:49
|
Steven Palm wrote: > The problem with the initial config window coming up blank on MacOS > (first run with no settings) seems (from my guesswork) to be related > possibly to the dialog being thrown up in modal mode before the event > loop is running... Is that a possibility? Modal dialogs run their own nested event loops. This code shows it: ===================== import wx class FooDlg(wx.Dialog): def __init__(self): wx.Dialog.__init__(self, None, -1, "Just Testing") vbs=wx.BoxSizer(wx.VERTICAL) vbs.Add(self.CreateButtonSizer(wx.OK|wx.CANCEL|wx.HELP), 1, wx.ALIGN_CENTER|wx.ALL, 5) self.SetSizer(vbs) vbs.Fit(self) app=wx.PySimpleApp() foo=FooDlg() foo.ShowModal() ===================== > The dialog comes up blank, no > controls are visible and the window widgets (close/minimize/maximize) > don't work, or even have the usual rollover effects. Also, if you get > an exception in this early stage the exception handling window has the > same problems. I wonder if it is to do with the parent of the dialog not being visible? > I'm trying to monkey around with the startup code to simplify it and > get the main loop up and running before the config dialog stuff is > called just as a proof, but I'm not entirely sure at which point this > happens. I would love for that startup stuff to be simplified, and you are currently looking at my best efforts :-) The problem is that some of the tabs (wallpaper, ringtone etc) need to know the pathname to where their data is stored when they get constructed. Consequently that information has to be known before their construction. That is why the code does the config stuff half way down the initialisation. It also has to do fun stuff if the splash screen is still up. I think a solution is for the various widgets to not load any data when they get constructed. They get told to load stuff later anyway. However it is a bit of late change to make now :-) Roger |