Discussion:
wxPython 3.0.1.1 and Mac OS X Yosemite
Steve
2014-10-17 10:56:35 UTC
Permalink
Hello,

Today i updated OS X Mavericks to OS X Yosemite and now i canÂŽt run a
simple MessageDialog Box. Everytime when i want to Display a MessageBox it
will be closed immediately.

I already removed the installation, reboot and made a fresh install of
wxPython with the same result.

wxversion.getInstalled() delivers ['3.0-osx-cocoa']

Here are some Code which is not working

import wx

class TestFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, title='test')

def Box(self):
dlg = wx.MessageDialog(self, 'Hello from Python and wxPython!',
'A Message Box',
wx.OK | wx.ICON_INFORMATION
#wx.YES_NO | wx.NO_DEFAULT | wx.CANCEL |
wx.ICON_INFORMATION
)
dlg.ShowModal()
dlg.Destroy()

app = wx.App(redirect=False)
a = TestFrame()
a.Box()

Here an other example without a Frame

import wx

def Info():
dlg = wx.MessageDialog(None, "Hello World!", "Demo", wx.OK | wx.
ICON_INFORMATION)
dlg.ShowModal()
dlg.Destroy()
app = wx.App(redirect=False)
Info()

Hope it helps to find this Bug

Greetings
Steve
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Robin Dunn
2014-10-17 20:33:52 UTC
Permalink
X-Received: by 10.50.79.196 with SMTP id l4mr22936igx.11.1413578037478;
Fri, 17 Oct 2014 13:33:57 -0700 (PDT)
X-BeenThere: wxpython-***@googlegroups.com
Received: by 10.107.29.72 with SMTP id d69ls895101iod.53.gmail; Fri, 17 Oct
2014 13:33:56 -0700 (PDT)
X-Received: by 10.66.250.134 with SMTP id zc6mr7436880pac.30.1413578036585;
Fri, 17 Oct 2014 13:33:56 -0700 (PDT)
Received: from mail-oi0-f48.google.com (mail-oi0-f48.google.com. [209.85.218.48])
by gmr-mx.google.com with ESMTPS id qj6si215301igc.0.2014.10.17.13.33.56
for <wxpython-***@googlegroups.com>
(version=TLSv1 cipher�DHE-RSA-RC4-SHA bits8/128);
Fri, 17 Oct 2014 13:33:56 -0700 (PDT)
Received-SPF: none (google.com: ***@alldunn.com does not designate permitted sender hosts) client-ip 9.85.218.48;
Received: by mail-oi0-f48.google.com with SMTP id g201so1158463oib.7
for <wxpython-***@googlegroups.com>; Fri, 17 Oct 2014 13:33:56 -0700 (PDT)
X-Gm-Message-State: ALoCoQnxGmvPb4Kv6xWdZ7paQpjaif2R4OQ1Ia4Kvrbuhu7BzB/OFNFNByowdnBWwHSgXxHHAO/0
X-Received: by 10.60.244.227 with SMTP id xj3mr4104070oec.46.1413578035921;
Fri, 17 Oct 2014 13:33:55 -0700 (PDT)
Received: from Havok.local (c-71-236-216-161.hsd1.wa.comcast.net. [71.236.216.161])
by mx.google.com with ESMTPSA id ry5sm950364obb.28.2014.10.17.13.33.54
for <wxpython-***@googlegroups.com>
(version=TLSv1 cipher�DHE-RSA-RC4-SHA bits8/128);
Fri, 17 Oct 2014 13:33:55 -0700 (PDT)
User-Agent: Postbox 3.0.11 (Macintosh/20140602)
In-Reply-To: <2ca2d7a4-3e6c-45e9-a1f3-***@googlegroups.com>
X-Original-Sender: ***@alldunn.com
X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral
(google.com: ***@alldunn.com does not designate permitted sender hosts) smtp.mail=***@alldunn.com
Precedence: list
Mailing-list: list wxpython-***@googlegroups.com; contact wxpython-users+***@googlegroups.com
List-ID: <wxpython-users.googlegroups.com>
X-Google-Group-Id: 375271755256
List-Post: <http://groups.google.com/group/wxpython-users/post>, <mailto:wxpython-***@googlegroups.com>
List-Help: <http://groups.google.com/support/>, <mailto:wxpython-users+***@googlegroups.com>
List-Archive: <http://groups.google.com/group/wxpython-users
Sender: wxpython-***@googlegroups.com
List-Subscribe: <http://groups.google.com/group/wxpython-users/subscribe>, <mailto:wxpython-users+***@googlegroups.com>
List-Unsubscribe: <mailto:googlegroups-manage+375271755256+***@googlegroups.com>,
<http://groups.google.com/group/wxpython-users/subscribe>
Archived-At: <http://permalink.gmane.org/gmane.comp.python.wxpython/102322>
Post by Steve
Hello,
Today i updated OS X Mavericks to OS X Yosemite and now i can´t run a
simple MessageDialog Box. Everytime when i want to Display a MessageBox
it will be closed immediately.
I already removed the installation, reboot and made a fresh install of
wxPython with the same result.
wxversion.getInstalled() delivers ['3.0-osx-cocoa']
This isn't a Yosemite specific issue. There were some OSX platform
changes a while back that made it so we can't use the native dialogs
before the application's MainLoop is running, because some additional
low-level initialization has to be done then. So you can do something
like this in your sample:

app = wx.App(redirect=False)
a = TestFrame()
a.Show()
wx.CallLater(100, a.Box)
app.MainLoop()

That change only affects the native dialogs however, so if you really
need a dialog on startup before the MainLoop starts then you can use a
custom (non-native) dialog instead. There is also a
GenericMessageDialog class that is a fairly good replacement for
wx.MessageDialog if needed.
--
Robin Dunn
Software Craftsman
http://wxPython.org
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nat Echols
2014-10-17 22:29:17 UTC
Permalink
That change only affects the native dialogs however, so if you really need
a dialog on startup before the MainLoop starts then you can use a custom
(non-native) dialog instead.
Could you please clarify what you mean by "native"? Is wx.Dialog not
included? What about if I open a wx.Dialog, then a FileDialog is opened in
response to a button press? I got burnt badly by this change when
Mavericks came out and now that I know what to look for I'd like to audit
my code and fix anything that might still break.

There is also a GenericMessageDialog class that is a fairly good
replacement for wx.MessageDialog if needed.
Did this ever get fixed so the return key works?

thanks,
Nat
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Tim Roberts
2014-10-18 20:25:23 UTC
Permalink
On Oct 17, 2014, at 3:29 PM, Nat Echols <***@gmail.com<mailto:***@gmail.com>> wrote:

On Fri, Oct 17, 2014 at 1:33 PM, Robin Dunn <***@alldunn.com<mailto:***@alldunn.com>> wrote:
That change only affects the native dialogs however, so if you really need a dialog on startup before the MainLoop starts then you can use a custom (non-native) dialog instead.

Could you please clarify what you mean by "native"? Is wx.Dialog not included?

The major operating systems all includes canned dialogs for things like message boxes, file selection, and printing, for example. Whenever possible wx tries to use the native operating system dialog instead of drawing one by hand.

A dialog based on wx.Dialog is not native.

Opening a dialog prior to the main loop is a questionable practice to begin with. Dialogs and windows are all managed and controlled using messages, and the only time messages get processed is then the main loop runs.
--
Tim Roberts, ***@probo.com<mailto:***@probo.com>
Providenza & Boekelheide, Inc.
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Steve
2014-10-20 12:19:47 UTC
Permalink
Thank you this helped me. i changed my code so the windows will stay.

But now i have a other Problem. IÂŽam writing an background server which is
calling serveral functions depending on the user input. At the moment i
wrote something like this in the function if she get called:

dlg = wx.MessageDialog(self, "Really wanne start this Action",
"Title", wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
result = dlg.ShowModal()
if result == wx.ID_YES:
#do something
dlg2.Destroy()

but this is not working. I believe heÂŽs not get the button i clicked. could
you explain me why ? is this the same problem like in your first post ?
Post by Robin Dunn
Post by Steve
Hello,
Today i updated OS X Mavericks to OS X Yosemite and now i canÂŽt run a
simple MessageDialog Box. Everytime when i want to Display a MessageBox
it will be closed immediately.
I already removed the installation, reboot and made a fresh install of
wxPython with the same result.
wxversion.getInstalled() delivers ['3.0-osx-cocoa']
This isn't a Yosemite specific issue. There were some OSX platform
changes a while back that made it so we can't use the native dialogs
before the application's MainLoop is running, because some additional
low-level initialization has to be done then. So you can do something
app = wx.App(redirect=False)
a = TestFrame()
a.Show()
wx.CallLater(100, a.Box)
app.MainLoop()
That change only affects the native dialogs however, so if you really
need a dialog on startup before the MainLoop starts then you can use a
custom (non-native) dialog instead. There is also a
GenericMessageDialog class that is a fairly good replacement for
wx.MessageDialog if needed.
--
Robin Dunn
Software Craftsman
http://wxPython.org
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nathan McCorkle
2014-10-20 19:53:30 UTC
Permalink
Post by Steve
Thank you this helped me. i changed my code so the windows will stay.
But now i have a other Problem. IÂŽam writing an background server which is
calling serveral functions depending on the user input. At the moment i
dlg = wx.MessageDialog(self, "Really wanne start this Action",
"Title", wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
result = dlg.ShowModal()
#do something
dlg2.Destroy()
but this is not working. I believe heÂŽs not get the button i clicked.
could you explain me why ? is this the same problem like in your first post
?
hmm, on Win7 with 3.0.0.0-classic I get the message dialog, but it doesn't
have a question mark icon that the wx.ICON_QUESTION should specify.

are you getting an error because dlg2 doesn't exist? (you called it dlg
earlier in the code snippet)
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Steve
2014-10-21 06:44:22 UTC
Permalink
Hi,

Sorry this was a mistype. In my script i use dlg2 in the whole function. On
Windows the snippet works like a charm and i can catch the Button IDÂŽs, but
on Mac he donÂŽt recognized which buttons is pressed.

The workaround with wx.callLater() is not suitable in my situation because
i want to show a dialog only if the function is called so i donÂŽt get it in
my head how i should use this ;)
Post by Nathan McCorkle
Post by Steve
Thank you this helped me. i changed my code so the windows will stay.
But now i have a other Problem. IÂŽam writing an background server which
is calling serveral functions depending on the user input. At the moment i
dlg = wx.MessageDialog(self, "Really wanne start this Action",
"Title", wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
result = dlg.ShowModal()
#do something
dlg2.Destroy()
but this is not working. I believe heÂŽs not get the button i clicked.
could you explain me why ? is this the same problem like in your first post
?
hmm, on Win7 with 3.0.0.0-classic I get the message dialog, but it
doesn't have a question mark icon that the wx.ICON_QUESTION should
specify.
are you getting an error because dlg2 doesn't exist? (you called it dlg
earlier in the code snippet)
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...