Getting requested size of an object 
Author Message
 Getting requested size of an object

Hi,

  I'm placing several windows onto a canvas. Each window contains a button
and some text. I want the windows placed in a tabular format, so I need to
determine the window size after it is created and before it is placed on the
canvas. I've tried:

   my $f = $canvas->Frame;
   $f->Button(.....)->pack;
   $f->Label(.....)->pack;

   my $w = $f->ReqWidth;
   my $h = $f->ReqHeight;
   .
   .
   .
   $canvas->create('window', $col, $row, -window => $f, ...);

but both $w and $h are 0. If I do $f->update before the ReqWidth and
ReqHeight, I get the right values for $w and $h, but this is very slow.

What am I doing wrong?

Thanks,

Thomas Rock

--




Mon, 05 Oct 1998 03:00:00 GMT  
 Getting requested size of an object

On Thu, 18 Apr 1996 13:49:23 CDT (-0500)

Quote:

>Hi,

>  I'm placing several windows onto a canvas. Each window contains a button
>and some text. I want the windows placed in a tabular format, so I need to
>determine the window size after it is created and before it is placed on the
>canvas. I've tried:

>   my $f = $canvas->Frame;
>   $f->Button(.....)->pack;
>   $f->Label(.....)->pack;

>   my $w = $f->ReqWidth;
>   my $h = $f->ReqHeight;
>   .
>   .
>   .
>   $canvas->create('window', $col, $row, -window => $f, ...);

>but both $w and $h are 0. If I do $f->update before the ReqWidth and
>ReqHeight, I get the right values for $w and $h, but this is very slow.

You want to do $f->idletasks rather than $f->update.
Tk windows do their size propagation at 'idle' time.

Quote:

>What am I doing wrong?

>Thanks,

>Thomas Rock

--




Tue, 06 Oct 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. getting object size?

2. size limits on POST requests using libwww?

3. REQUEST: Need jelp determining FILE SIZE...

4. Measuring size of a object

5. size of an object?

6. CGI.pm Bug: file upload file size mismatch when file size is close to buffer size

7. Getting Traffic Size in Bytes from W3C Extended Format Log

8. Getting partition size from perl script

9. Getting NTFS Directory structure size

10. Getting Remote File Size

11. HELP! Getting Remote File Size

12. getting directory size

 

 
Powered by phpBB® Forum Software