Skip Menu |

This queue is for tickets about the Tk-MK CPAN distribution.

Report information
The Basics
Id: 21907
Status: resolved
Priority: 0/
Queue: Tk-MK

People
Owner: MIKRA [...] cpan.org
Requestors: RCSEEGE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.09
Fixed in: (no value)



Subject: A better way to handle the -lastcolumn option
One thing that's annoyed me in the past with HList is the last column. HList stretches the last column's header to fill in the remainder of the space within the widget. It's annoying because the list entries for that final column are not likewise stretched. A way I've worked around this is to add an additional column that I do not intend to use. No header button, no data in the column, nada. The resulting effect looks like similar Win32 controls. The problem is that now there is this faux header up there and suddenly you'd like to be able to resize that penultimate column, but can't because it's the ResizeHeaderButton, but not the last column. I think your header method is slightly flawed in how it uses the -lastcolumn option you've setup. One possible fix would be to replace the following block (on or around line 362): # Create a new Resize Button my $header = $this->HeaderResizeButton(%args, -column => $column, -lastcolumn => $column -highlightthickness => 0, ); To this: # Create a new Resize Button my $lastCol = 0; $lastCol = 1 if $this->cget(-columns) == ($column + 1); my $header = $this->HeaderResizeButton(%args, -column => $column, -lastcolumn => $lastCol, -highlightthickness => 0, ); When you do this, you no longer need the following lines: # remove the last column-flag in the row # before to allow drawing the bar if ($column > 0) { my $lastcolumn = $this->{m_headerwidget}{$column - 1}; $lastcolumn->configure(-lastcolumn => 0); } Because it's handled for each header as you create it. -columns is a static attribute for HList and can not be changed after the HList has been created so it's safe to use. Try it out yourself, but creating an additional column in whatver test code you may have for the widget. Regards, Rob Seegel
From: MIKRA [...] cpan.org
On Do. 05. Okt. 2006, 00:16:28, RCSEEGE wrote: Show quoted text
> One thing that's annoyed me in the past with HList is the last column. > HList stretches the last column's header to fill in the remainder of the > space within the widget. It's annoying because the list entries for that > final column are not likewise stretched. > > A way I've worked around this is to add an additional column that I do > not intend to use. No header button, no data in the column, nada. The > resulting effect looks like similar Win32 controls. The problem is that > now there is this faux header up there and suddenly you'd like to be > able to resize that penultimate column, but can't because it's the > ResizeHeaderButton, but not the last column. > > I think your header method is slightly flawed in how it uses the > -lastcolumn option you've setup. One possible fix would be to replace > the following block (on or around line 362): > > # Create a new Resize Button > my $header = $this->HeaderResizeButton(%args, > -column => $column, > -lastcolumn => $column > -highlightthickness => 0, > ); > > To this: > > # Create a new Resize Button > my $lastCol = 0; > $lastCol = 1 if $this->cget(-columns) == ($column + 1); > > my $header = $this->HeaderResizeButton(%args, > -column => $column, > -lastcolumn => $lastCol, > -highlightthickness => 0, > ); > > When you do this, you no longer need the following lines: > > # remove the last column-flag in the row > # before to allow drawing the bar > if ($column > 0) { > my $lastcolumn = $this->{m_headerwidget}{$column - 1}; > $lastcolumn->configure(-lastcolumn => 0); > } > > Because it's handled for each header as you create it. -columns is > a static attribute for HList and can not be changed after the HList > has been created so it's safe to use. > > Try it out yourself, but creating an additional column in > whatver test code you may have for the widget. > > Regards, > > Rob Seegel
Hi Rob! First of all thank you very much for your valuable feedback. I understand your request and have changed the HListPlus module according your suggestions. Additionally I have picked up your idea of having this extra -empty- column at the right border to make the behavior more as on Win32. The widget will now itself automatically increase the column-count by one during creation. I hope this does not mess up to many of your perl scripts :-) having now two extra columns ... But thinking about whether this auto-add should be switchable I came to the point where I decided to make this 'default' because adding another switch for the HListPlus widget to enable this feature would mean much more overkill in your target scripts than your current solution of just manually increasing the column-count to add an unused column. Of cause I would like to get your feedback on this, so please find a newly uploaded Tk-MK-0.10 on CPAN. Best regards Michael.
Subject: Re: [rt.cpan.org #21907] A better way to handle the -lastcolumn option
Date: Sat, 14 Oct 2006 00:53:54 -0400
To: bug-Tk-MK [...] rt.cpan.org
From: Rob Seegel <RobSeegel [...] comcast.net>
Thanks for the update. It doesn't break anything I have -- I didn't have any scripts that used HListplus. In fact, I didn't even know that it existed until someone asked a question about it on Perlmonks, and I tried to help out. But, after seeing it, I'm glad you released it. It's a good idea, and past due. I have had my own version of something like this for some time, but was unable to release it due to circumstances beyond my control. Personally, I think you ought to add that option (to automatically add an extra column) you were talking about. You might even consider leaving your original way as the default. At least it won't cause any disruptions to those already using your widget. I haven't had time to take a very close look at the code, yet, but if you don't mind I'll forward you a few patches that I've long since released for the original HList that were never put into place. The purpose of the patches was to fix many of the event handlers related to selection in the original widget. Keep up the good work, Rob via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=21907 > > > Hi Rob! > > First of all thank you very much for your valuable feedback. > I understand your request and have changed the HListPlus module > according your suggestions. > Additionally I have picked up your idea of having this extra -empty- > column at the right border to make the behavior more as on Win32. > The widget will now itself automatically increase the column-count by > one during creation. > > I hope this does not mess up to many of your perl scripts :-) > having now two extra columns ... > But thinking about whether this auto-add should be switchable I came to > the point where I decided to make this 'default' because adding another > switch for the HListPlus widget to enable this feature would mean much > more overkill in your target scripts than your current solution of just > manually increasing the column-count to add an unused column. > > Of cause I would like to get your feedback on this, > so please find a newly uploaded Tk-MK-0.10 on CPAN. > > Best regards > > Michael. > > > >
Hi Rob, again thanks for your feedback. In fact I already implemented the add. column for the new 0.10 pkg as default. Lets see, if I get some more feedback... BTW. Since I did not yet get any feedback regarding my modules on CPAN, I guessed not many people to be using it. For some time reasons I haven't visited perlmonks for a longer time now, maybe I should find more time for this :-) ... Could you please give me a hint where to find the HListplus related discussion on perlmonks because looking for it I currently can not find it. Regarding your personal add-on stuff: If you like, surely I can try to merge it in - just let me know and drop me your derived class... Best regards, Michael. On Sa. 14. Okt. 2006, 00:52:09, RobSeegel@comcast.net wrote: Show quoted text
> Thanks for the update. It doesn't break anything I have -- I didn't have > any scripts that used HListplus. In fact, I didn't even know that it > existed until someone asked a question about it on Perlmonks, and I > tried to help out. But, after seeing it, I'm glad you released it. It's > a good idea, and past due. I have had my own version of something like > this for some time, but was unable to release it due to circumstances > beyond my control. > > Personally, I think you ought to add that option (to automatically add > an extra column) you were talking about. You might even consider leaving > your original way as the default. At least it won't cause any > disruptions to those already using your widget. I haven't had time to > take a very close look at the code, yet, but if you don't mind I'll > forward you a few patches that I've long since released for the original > HList that were never put into place. The purpose of the patches was to > fix many of the event handlers related to selection in the original
widget. Show quoted text
> > Keep up the good work, > > Rob > > via RT wrote:
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=21907 > > > > > Hi Rob! > > > > First of all thank you very much for your valuable feedback. > > I understand your request and have changed the HListPlus module > > according your suggestions. > > Additionally I have picked up your idea of having this extra -empty- > > column at the right border to make the behavior more as on Win32. > > The widget will now itself automatically increase the column-count by > > one during creation. > > > > I hope this does not mess up to many of your perl scripts :-) > > having now two extra columns ... > > But thinking about whether this auto-add should be switchable I came to > > the point where I decided to make this 'default' because adding another > > switch for the HListPlus widget to enable this feature would mean much > > more overkill in your target scripts than your current solution of just > > manually increasing the column-count to add an unused column. > > > > Of cause I would like to get your feedback on this, > > so please find a newly uploaded Tk-MK-0.10 on CPAN. > > > > Best regards > > > > Michael. > > > > > > > >
> >
Subject: Re: [rt.cpan.org #21907] A better way to handle the -lastcolumn option
Date: Mon, 16 Oct 2006 07:09:26 -0400
To: bug-Tk-MK [...] rt.cpan.org
From: Rob Seegel <RobSeegel [...] comcast.net>
Here's the node: http://perlmonks.org/?node_id=576455 You have some nice things in there... by the way, in the thread I made some comments about a resize callback. I've had some time to reflect on that, and I'm not sure how useful that would really be. I'm sure someone would fine a use for it .. but it does seem kind of obscure. Rob via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=21907 > > > Hi Rob, > again thanks for your feedback. In fact I already implemented the add. > column for the new 0.10 pkg as default. Lets see, if I get some more > feedback... > BTW. Since I did not yet get any feedback regarding my modules on CPAN, > I guessed not many people to be using it. For some time reasons I > haven't visited perlmonks for a longer time now, maybe I should find > more time for this :-) ... > Could you please give me a hint where to find the HListplus related > discussion on perlmonks because looking for it I currently can not find it. > Regarding your personal add-on stuff: If you like, surely I can try to > merge it in - just let me know and drop me your derived class... > > Best regards, > Michael. > > On Sa. 14. Okt. 2006, 00:52:09, RobSeegel@comcast.net wrote: >
>> Thanks for the update. It doesn't break anything I have -- I didn't have >> any scripts that used HListplus. In fact, I didn't even know that it >> existed until someone asked a question about it on Perlmonks, and I >> tried to help out. But, after seeing it, I'm glad you released it. It's >> a good idea, and past due. I have had my own version of something like >> this for some time, but was unable to release it due to circumstances >> beyond my control. >> >> Personally, I think you ought to add that option (to automatically add >> an extra column) you were talking about. You might even consider leaving >> your original way as the default. At least it won't cause any >> disruptions to those already using your widget. I haven't had time to >> take a very close look at the code, yet, but if you don't mind I'll >> forward you a few patches that I've long since released for the original >> HList that were never put into place. The purpose of the patches was to >> fix many of the event handlers related to selection in the original >>
> widget. >
>> Keep up the good work, >> >> Rob >> >> via RT wrote: >>
>>> <URL: http://rt.cpan.org/Ticket/Display.html?id=21907 > >>> >>> Hi Rob! >>> >>> First of all thank you very much for your valuable feedback. >>> I understand your request and have changed the HListPlus module >>> according your suggestions. >>> Additionally I have picked up your idea of having this extra -empty- >>> column at the right border to make the behavior more as on Win32. >>> The widget will now itself automatically increase the column-count by >>> one during creation. >>> >>> I hope this does not mess up to many of your perl scripts :-) >>> having now two extra columns ... >>> But thinking about whether this auto-add should be switchable I came to >>> the point where I decided to make this 'default' because adding another >>> switch for the HListPlus widget to enable this feature would mean much >>> more overkill in your target scripts than your current solution of just >>> manually increasing the column-count to add an unused column. >>> >>> Of cause I would like to get your feedback on this, >>> so please find a newly uploaded Tk-MK-0.10 on CPAN. >>> >>> Best regards >>> >>> Michael. >>> >>> >>> >>> >>>
>>
> > > > > >
... found this thread still open, just closed it. Br Michael.