Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Binding columns in Tk::Hlist

by rcseege (Pilgrim)
on Oct 05, 2006 at 02:26 UTC ( [id://576458]=note: print w/replies, xml ) Need Help??


in reply to Binding columns in Tk::Hlist

Yes, but you're probably not going to like it. Without hacking the C source code, the best workaround I've found in the past is to add 1 more column than you expect to have within the HList. The end result is close to what you will see on similar Windows controls.

Set -columns to 3, and ignore that extra column when populating the HList.

Update: Also try setting -padx values in the styles to 0.

Update Again: Ok, the only problem I see of adding that additional column (that you don't intend to use), is the fact that you'd probably like to be able to resize column 1, now, but you can't. The author has set the widget up so that the last header you create will not be allowed to resize -- I can see how this makes a kind of sense, assuming that you are always going to make resizable headers for all of our headers.

A better approach would have been to check the total number of columns defined for the HList and to determine which column the resizebutton was being created for before deciding whether or not to allow the resize bar. This can be fixed easily by going to line 362 or so within the source, and just after the comment:

    # Create a new Resize Button

Add the following two lines:

my $lastCol = 0; $lastCol = 1 if $this->cget(-columns) == ($column + 1);

And then, a few lines below where the HeaderResizeButton is being created change the -lastcolumn option to:

-lastcolumn => $lastCol,

I'll submit the patch to the Author and see if he'll take it. That's it for updates to this node...

Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://576458]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-19 01:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found