wxAboutDialogInfo set icon

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
wxProgrammer
Experienced Solver
Experienced Solver
Posts: 96
Joined: Thu Apr 17, 2014 10:10 am

wxAboutDialogInfo set icon

Post by wxProgrammer »

Hi guys,
I've a small problem: I need to set the icon of a wxAboutDialogInfo so I've write:
aboutInfo.SetIcon(wxIcon(GlobalSpace::GetImagesDir() << "icon.ico", wxBITMAP_TYPE_ICO, 200, 115));
But when I call wxAboutBox(aboutInfo), the icon don't change: it display the main frame icon
It's a bug? The icon exists, the path is correct
I'm Italian but we can speak C++ :)
User avatar
doublemax
Moderator
Moderator
Posts: 19160
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxAboutDialogInfo set icon

Post by doublemax »

Try loading the icon into a separate object and check if it's ok. Then you know if the problem lies in the icon itself or inside the SetIcon() call.

Code: Select all

wxIcon icon(GlobalSpace::GetImagesDir() << "icon.ico", wxBITMAP_TYPE_ICO, 200, 115);
if( icon.IsOk() )
{
   ...
}
Use the source, Luke!
wxProgrammer
Experienced Solver
Experienced Solver
Posts: 96
Joined: Thu Apr 17, 2014 10:10 am

Re: wxAboutDialogInfo set icon

Post by wxProgrammer »

Hi, thank you for your reply

I've write "if (icon isnt ok)" and the condition is true.
So I've thinked that the problem could be the type of the Icon (wxBITMAP_TYPE_ICO) so I've revased the icon (with .ico format, with GIMP) but nothing change.
So I've tried to save it with .png extension (and format) and now work, thank you :)
Is there a method for center the icon to Y axis without redraws the dialog?
I'm Italian but we can speak C++ :)
Post Reply