Re: get size of drawing area



You may find
        my ($alloc_x, $alloc_y, $alloc_w, $alloc_h) = @{$widget->allocation};

(as I suggested not-that-long-ago on this list) clearer, in that it
avoids literal numbers and labels all of the fields (in isolation, the
->[2] and ->[3] look much too magic... it would be more pleasant if
allocations were hashes with named components (after all, in the
underlying C code, they're structs, not arrays), but this suffices
without changing the API.)




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]