Discussion:
[Bitpim-devel] MacOS problem with initial config window...
Steven Palm
2004-04-27 01:49:25 UTC
Permalink
Roger,

Since I'm still trying to figure out all the ins and outs of the wx
startup stuff...

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? 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'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.

Anyway, any thoughts you have on this would be appreciated. Obviously
this isn't an issue on Windows or Linux... Not sure if it's a MacOS
"OS" issue or a wxMac issue.
Roger Binns
2004-04-27 02:22:56 UTC
Permalink
Post by Steven Palm
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()
=====================
Post by Steven Palm
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?
Post by Steven Palm
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
Steven Palm
2004-04-27 02:35:00 UTC
Permalink
I'll play with that and ask on the PythonMac lists...

In the interim (for this test release), I'm going to do some hacking.
I think it's better to use some default values than to have the user
get a dialog they cannot interact with. It's far more confusing to
them, IMHO.

So, I'm hacking the startup to just set defaults and let the
application continue it's launch. The user will have to be smart enough
to actually go into the settings dialog and make the changes
themselves.

I'm only doing this for the Mac, not the other platforms.
Post by Roger Binns
I would love for that startup stuff to be simplified, and you are
currently looking at my best efforts :-)
Well, you know this stuff inside and out better than I do, so I'm not
promising much. I'll give it a good thinking through.
Post by Roger Binns
However it is a bit of late change to make now :-)
Yeah, so for now I'm going to wimp out and just fake it on the Mac at
initial (new user) launch time and hope they find the settings dialog.
Not as user friendly, but it lets things load and doesn't give the user
a blank/nonresponsive dialog and make them think the program isn't
working.

Steve

P.S. I'll wait until you give the 'go ahead' to run the builds for
test-9.
Roger Binns
2004-04-27 04:43:57 UTC
Permalink
Post by Steven Palm
In the interim (for this test release), I'm going to do some hacking.
I think it's better to use some default values
The code did that until multiple phone models were introduced.
At that point most people did not know that they needed to
select a phone model as they never saw the dialog.

I will mention this in the notes for the release.
Post by Steven Palm
P.S. I'll wait until you give the 'go ahead' to run the builds for
test-9.
It is fine for Windows. Still testing on Linux.

Roger

Loading...