void SetIcon(wxIcon * icon)
Sets the icon for this frame, deleting any existing one. Note an important difference between XView and Windows 3 behaviour. In Windows 3, the title of the frame is the icon label, wrapping if necessary for a long title. If the frame title changes, the icon label changes. In XView, the icon label cannot be changed once the icon has been associated with the frame. Also, there is no wrapping, and icon labels must therefore be short.
The best thing to do to accommodate both situations is to have the frame title set to a short string when setting the icon. Then, set the frame title to the desired text. In XView, the icon will keep its short text. In Windows 3, the longer (probably more meaningful) title will be shown.
Note also that in Windows 3, icons cannot be associated with a window after window initialization, except by explicitly drawing the icon onto the iconized window, which is what wxWindows does. Because of this workaround, the background of the icon will be white rather than the usual transparent. It was felt limiting to have to pass an icon name at frame create time.
However, drawing the icon like this does not work (for some unknown reason) with MDI parent and child frames, and so for MDI applications the following lines need to be added to the Windows 3 resource file:
wxSTD_MDIPARENTFRAME ICON icon1.ico wxSTD_MDICHILDFRAME ICON icon2.icowhere icon1.ico will be used for the MDI parent frame, and icon2.ico will be used for MDI child frames.
To assign an icon to all SDI frames, include a line similar to the following:
wxSTD_FRAME ICON icon1.icoSee also wxIcon.