Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxMessageDialog does show wrong icon (or not showing at all) #23353

Closed
nourgaliev opened this issue Mar 16, 2023 · 7 comments
Closed

wxMessageDialog does show wrong icon (or not showing at all) #23353

nourgaliev opened this issue Mar 16, 2023 · 7 comments

Comments

@nourgaliev
Copy link

wxMessageDialog does not show icons correctly, on Mac and some Linux systems (I am using RedHat toss3). See forum discussion at

https://forums.wxwidgets.org/viewtopic.php?f=23&t=50220&p=217951#p217951

Note, that wxRichMessageDialog is fine.

@vadz
Copy link
Contributor

vadz commented Mar 16, 2023

The lack of icon in GTK is due to GTK theme not using icons. Unfortunately GTK doesn't use icons almost anywhere any more and while you can override it, you probably shouldn't do it to avoid making your application inconsistent with all the other ones on the system.

Under Mac message box shows the application icon because this is what the platform UI standard insists on.

IOW this isn't a bug, the behaviour just conforms to the native UI, as it's supposed to, but this should arguably be better documented as it's not really obvious.

@nourgaliev
Copy link
Author

So why wxRichMessageDialog, which derived from this, is working properly? It does show appropriate icons on both Mac and Linux.

@vadz
Copy link
Contributor

vadz commented Mar 16, 2023

On these platforms wxRichMessageDialog uses a generic implementation not using the native dialog.

@nourgaliev
Copy link
Author

This probably should be documented.

@nourgaliev
Copy link
Author

nourgaliev commented Mar 16, 2023

On related issue: I started using wxRichMessageDialog, something like this:

        wxRichMessageDialog dialog (this,
                                    wxT("Mesh file exists! Proceed to overwrite?"),
                                    wxT("Please confirm"),
                                    wxYES_NO|wxCENTRE|wxICON_HAND);

dialog.ShowModal() returns 5103 on YES and 5104 on NO, while I think the values should be 2 (wxYES) and 8 (wxNO). This is on both Mac and Linux. I could hard code these - but is it a bug - or I am doing something wrong here?

@vadz
Copy link
Contributor

vadz commented Mar 16, 2023

No, this is not a bug, the dialog returns wxID_YES and wxID_NO, just as wxMessageDialog does.

This is already documented:

Notice that this method returns the identifier of the button which was
clicked unlike wxMessageBox() function.

which just goes to show that documenting things is not always enough...

But yes, it should still be done for the icons.

P.S. Please open separate issues for other problems.

@nourgaliev
Copy link
Author

Got it! Thanks!

@vadz vadz closed this as completed in c202385 Mar 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants