There is no icon present in a message dialog if the style of a dialog
is constructed by using the flag wx.ICON_QUESTION and/or other
wx.ICON_* flags. How come?
Works for me in wxPython demo - Win7, Py2.7 and wxPython 2.9.2.4
Werner
···
On 10/11/2011 01:09 AM, Bo�tjan Mejak wrote:
There is no icon present in a message dialog if the style of a dialog
is constructed by using the flag wx.ICON_QUESTION and/or other
wx.ICON_* flags. How come?
I noted something interesting... If I enclose the code of the message
dialog in a "with" statement, I don't get that icon shown; but if I
don't use the "with" statement, the icon is shown. So now I ask you,
is that a bug in wxPython?
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?
I noted something interesting... If I enclose the code of the message
dialog in a "with" statement, I don't get that icon shown; but if I
don't use the "with" statement, the icon is shown.
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 TaskDialog function (commctrl.h) - Win32 apps | Microsoft Learn
msgdlg.py (1015 Bytes)
···
On 10/11/11 4:07 AM, Bo�tjan Mejak wrote:
--
Robin Dunn
Software Craftsman
The native task dialog does not have an equivalent for wx.ICON_QUESTION, but it does for ERROR, WARNING, and INFORMATION.
You are absolutely right. So how can I fix this?
Hi,
···
On Tue, Oct 11, 2011 at 12:21 PM, Boštjan Mejak <bostjan.mejak@gmail.com> wrote:
The native task dialog does not have an equivalent for wx.ICON_QUESTION,
but it does for ERROR, WARNING, and INFORMATION.You are absolutely right. So how can I fix this?
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
···
On 10/11/11 10:21 AM, Bo�tjan Mejak wrote:
The native task dialog does not have an equivalent for
wx.ICON_QUESTION, but it does for ERROR, WARNING, and INFORMATION.You are absolutely right. So how can I fix this?
--
Robin Dunn
Software Craftsman
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?
In theory anything is possible. In reality, no.
···
On 10/11/11 10:55 AM, Bo�tjan Mejak wrote:
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?
--
Robin Dunn
Software Craftsman
Why not just roll your own wx.Dialog that looks like a wx.MessageDialog? Or what about using the GenericMessageDialog (from wx.lib.agw.genericmessagedialog) ?
Bo�tjan Mejak wrote:
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?
I'm not sure you see the point here.� The Microsoft user interface
gurus have determined that the “question mark” icon is more
confusing to users than helpful.� Perhaps that’s because their user
interface studies told them users were frightened by it, or
overreacted to it, or perhaps it’s because of some complicated
international connotation attached to the ? symbol – I don’t know
the exact reason.� But the point is that you aren’t supposed to use
the “question mark” icon any more.� No other applications on Windows
7 are going to show it either, and you want your app to look
familiar.
Very well put. Thank you very much, sir.