> From: Aldo Calpini [mailto:[EMAIL PROTECTED]]
>
> there's a little concept to introduce here: the difference 
> between window  area and client area.

I knew about cliend vs window area, but I'd missed the relevance here.
Thanks!

> a window size (given
> with ->Height and ->Width) is not really the inner area of
> the window, that you can use to place controls, because it
> has some non-client areas (namely, a titlebar, a border,
> and eventually a menubar). controls (like labels), on the
> other side, do not have non-client area to cope with.
> the client area of a window is given by the ->ScaleWidth and 
> ->ScaleHeight methods,

Hmm, I might argue with the names - I don't find them intuitive - but
they are what they are, so I'll get used to them.

Maybe you are right, and I should try to write up my experiences as I
start to use Win32::GUI, as a sort of "new user's guide"...

> so your sample should be written as:
> 
>     use Win32::GUI;
>     $main = new Win32::GUI::Window(-name =>"Main");
>     $main->AddLabel(-name => 'Label1', -text => "Hello, world!");
>     $ncx = $main->Width - $main->ScaleWidth;
>     $ncy = $main->Height - $main->ScaleHeight;
>     $main->Height($main->Label1->Height()+$ncy);
>     $main->Width($main->Label1->Width()+$ncx);
>     $main->Show();
>     Win32::GUI::Dialog();
>     sub Main_Terminate { -1; }
> 
> where $ncx and $ncy are the non-client area width and height ;-)

Works fine... Thanks for the information.

Paul.

Reply via email to