How do I 'disapear' a TRootEmbeddedCanvas from a gui display

Hi,
I have a gui (with many frames within frames) where a one point, within a TGCompositeFrame (hframe) I have added a TRootEmbeddedCanvas (fTCanvas). That works fine. but then, upon the user cliking a button I would like to remove the fTCanvas from the display. How do I do that? I have tried removing fTCanvas from the hframe using hframe->RemoveFrame(fTCanvas) and while I got no complaints, the display did not change.

Thanks for any advice,
Glenn

ps. At some point (after another button is cliked) I will need to restore the fTCanvas display in the qui.

Hi Glenn,

You can hide or show a child frame of a composite frame using the methods: HideFrame(TGFrame *f) or ShowFrame(TGFrame *f). You should call, for example HideFrame(TGFrame *f), only after the frames have been laid out and the sub windows of the composite frame have been mapped via method MapSubwindows(). If TRootEmbeddedCanvas object takes an important part of your application window, it is not a good idea to show and hide it. I will suggest only to clear the canvas area by calling fTCanvas->GetCanvas()->Clear(); fTCanvas->GetCanvas()->Modified(); fTCanvas->GetCanvas()->Update();Anyway, it is up to you, because you know best your application design.
Cheers, Ilka

Wow, That works great. I don’t want to talk about all the dumb things I tried that didn’t work.

I do have one final question, on a different subject. Is there a way to put an image into a gui (like a jpeg or simular)?

Glenn

Hi Glenn,

You can use TGIcon class (see root.cern.ch/root/html/TGIcon.html ).

Cheers, Ilka