At 16:54 2005-11-17, Glenn W Munroe wrote:
The main window of my current project comprises a Grid control and a TreeView, in a Windows Explorer-like layout. I would like to provide the option of being able to resize the two controls by click-and-dragging the area between the two. Does anyone have any tips on how to do this? I tried adding a "-resizable => 1" option to the TreeView, but that would have been too easy! (It didn't work, of course). I imagine it makes use of the MouseOver et al. events, but the documentation is a bit thin on those events. Do I have to put another control (a 1-pixel-wide button perhaps?) between the two to get at the events? As usual, an example would be worth a thousand wordsÂ…

Use the Splitter control.

Perl Oasis uses this for an example:
http://user.bahnhof.se/~johanl/perl/Oasis/download.html

For a smaller and more focused example, download The GUI Loft
http://user.bahnhof.se/~johanl/perl/Loft/
and look at the Demo/FileDisplay(manual_resize) example. The purpose of that demo is exactly what you're after.

(using the Splitter makes TGL unable to handle all resize code automatically for you, but it still gives a helping hand by providing the basic resize code for the simple things (but not Splitter) which you can adjust and paste into your source).


/J

-------- ------ ---- --- -- --  --  -     -     -        -          -
Johan Lindström    Sourcerer @ Boss Casinos   johanl AT DarSerMan.com

Latest bookmark: "TCP Connection Passing"
http://tcpcp.sourceforge.net/
dmoz: /Computers/Programming/Languages/JavaScript/ 12


Reply via email to