Problems? Is your data what you think it is? | |
PerlMonks |
Re: Binding columns in Tk::Hlistby rcseege (Pilgrim) |
on Oct 05, 2006 at 02:26 UTC ( [id://576458]=note: print w/replies, xml ) | Need Help?? |
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 ButtonAdd the following two lines:
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
In Section
Seekers of Perl Wisdom
|
|