Werner
with wx.MessageDialog(self,
caption='Exit Confirmation',
message='Do you want to exit the
application?',
style=wx.YES_NO | wx.ICON_QUESTION) \
as dialog:
if dialog.ShowModal() == wx.ID_YES:
self.Destroy()
I love the "with" statement because it automatically takes care of the
destruction of the message dialog and eliminates any memory leaks that
way. Anyway, my code worked (i.e. displayed an icon in the message
dialog) in the 2.8 version of wxPython, but it does not do the same
thing under 2.9. What should I do different to make this work?
Are you sure about that? Try it with the attached sample.
> So now I ask you,
> is that a bug in wxPython?
No. On Windows 7 wx is able to use a new native dialog for the message
dialog implementation, called the task dialog. This is done to help
conform to new platform standards and to give it a more up to date look
and feel. (This same native dialog is also used for wx.ProgressDialog
if I remember correctly.) Apparently the native task dialog does not
have an equivalent for wx.ICON_QUESTION, but it does for ERROR, WARNING,
and INFORMATION. See
http://msdn.microsoft.com/en-us/library/bb760540(VS.85).aspx
--
Robin Dunn
Software Craftsman
http://wxPython.org
The native task dialog does not have an equivalent for wx.ICON_QUESTION, but it does for ERROR, WARNING, and INFORMATION.
There is nothing to fix. The new ui doesn't have a question icon dialog.
If you want one with a question icon you can try using the
GenericMessageDialog in wx.lib.agw.
Cody
Choose one:
a. live with it as-is
b. choose a different icon style
c. make your own custom dialog class
d. use a generic message dialog from wx.lib.agw or wx.lib.dialogs
In theory anything is possible. In reality, no.
Well, Robin, I obviously can't choose a different icon style. Since my message dialog is of a "question" nature, I can't choose some other icon. It would be nice if you could hack wxPython in a way to make the icon appear. Is that theoretically possible?
-- Tim Roberts, ti...@probo.com Providenza & Boekelheide, Inc.