SetIconPixmap Problem

Hello,

I’m trying to set the icon of a program in a standalone root Win32 application using the following command:

APPWIN->SetIconPixmap(“icon.png”);

Where APPWIN is a pointer to the main TGMainFrame of the application. The icon is changed in the Task Bar, but the windows of the application still display the Root tree - which is undoubtedly beautiful. APPWIN shows a flicker of the new icon, if the window is resized, but finally, the tree wins :slight_smile:

Is there a special way to replace the tree by another icon in all windows of the application?

Thanks!

Jürgen

Hi Jürgen,

I have no problem changing the icon of a TGMainFrame. For example, adding SetIconPixmap() in $ROOTSYS/test/guitest.cxx, as shown below, works perfectly.

[code]TestMainFrame::TestMainFrame(const TGWindow *p, UInt_t w, UInt_t h)
: TGMainFrame(p, w, h)
{
// Create test main frame. A TGMainFrame is a top level window.

SetIconPixmap(“view3ds.png”);
SetWindowName(“GuiTest”);

[/code]
So could you post a short piece of code showing the problem?
And to change all icons (i.e. the default icon) of an application, you can use a resource script (.rc) file, as shown in the RootShower application (in $ROOTSYS/test/RootShower)

Cheers, Bertrand.

Hi,

SetIconPixmap works nicely for a new TGMainFrame, however, there’s somewhere a problem in my main application frame. It’s not that important to find the error, so I chose your option using the resource script. This works fine.

Thanks, Jürgen