Re: How can I know that a window has been resized?

From: Ilka Antcheva <Ilka.Antcheva_at_cern.ch>
Date: Thu, 18 Aug 2005 09:33:20 +0200


Hi Giorgio,

To have all widgets and a canvas 'automatically' resized in your TGTransientFrames you need to add them with layout hints kLHintsExpandX | kLHintsExpandY, i.e.
parent->AddFrame(child, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));

If you want to do something when the window is resized, you need to use the method
HandleConfigureNotify(Event_t *event) method of TGFrame. For example: Bool_t YourClass::HandleConfigureNotify(Event_t* event) {

   TGFrame::HandleConfigureNotify(event);     SomeRedrawingYouWant();
    return kTRUE;
}

Best regards, Ilka

Giorgio De Nunzio wrote:

>Hi again!
>About to leave for the beach, I am trying to fix some other problems I have
>found in these days so that I can leave quite happy :-)
>After my palette question, here comes my "resize" one...!
>
>I need to manually redraw some objects in my windows (TGTransientFrames
>containing a TCanvas and other widgets) when the windows are resized by the
>user: I'd like to find some kind of OnResize() method, which I do not find.
>What is the right way of doing it? Or is it necessary to directly use X11
>stuff? Again, any hint or piece of code is really welcome!
>
>Thanks in advance.
>
>Giorgio
>
>
> ---------------------------------
> Dr. Giorgio De Nunzio
> Material Science Dept.
> University of Lecce
> Lecce
> Italy
> giorgio.denunzio_at_unile.it
> tel +39 0832 297545
> fax +39 0832 297549
>
>
>
>
Received on Thu Aug 18 2005 - 09:40:37 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:11 MET