Change Canvas Icon

Dear Rooters,

does anyone know if there is a possibility to change the icon of an canvas?
I talk about the icon in the upper left and in the taskbar.
I have searched within the class methods and here in the forum but i haven’t found anything on that.
I search for a method which does the same as SetIconPixmap for TGMainFrame.

Thanks in advance.
Cheers

Jo

Hi Jo,

Here is an example:

TCanvas *c1 = new TCanvas("c1", "Canvas Example", 200, 10, 700, 500); TRootCanvas *rc = (TRootCanvas *)c1->GetCanvasImp(); TGMainFrame *frm = dynamic_cast<TGMainFrame *>(rc); if (frm) frm->SetIconPixmap("$(ROOTSYS)/icons/class.png");
Cheers, Bertrand.

Hi Bertrand,

thanks for your reply, it works perfectly.

Cheers
Jo