Re: setting icon for TGMainFrame

From: Ilka Antcheva <Ilka.Antcheva_at_cern.ch>
Date: Mon, 10 Sep 2007 17:39:11 +0200


Hi Tom,

Define for your class const TGPicture *fIconPic; In your class constructor use:
fIconPic = SetIconPixmap("your_icon.png"); In your class destructor (to avoid memory leak): if (fIconPic) gClient->FreePicture(fIconPic);

If you need to specify in addition the special path to the icon directory, you may have a look at
http://root.cern.ch/phpBB2/viewtopic.php?t=5390

Cheers, Ilka

Tom Roberts wrote:
> My Root application is implemented as a TGMainFrame. How can I set the
> icon for this window? The documentation is obscure ("... this is
> typically done via the window manager", but no hint how to do that).
>
> I need to handle Windows, Linux, and Mac OS X, and have versions of my
> icon in .ico, .png, and .icns formats.
>
>
> Tom Roberts
>
Received on Mon Sep 10 2007 - 17:39:46 CEST

This archive was generated by hypermail 2.2.0 : Mon Sep 10 2007 - 23:50:01 CEST