in reply to Tk::Table cell select/deselect
You are on the right track. You need to save the selected row and column ... these initially being undef to indicate “no selection.” When the user clicks on a cell, first check to see if a cell is already selected and if so, turn it white. Then, remember the new selection (row and column), and turn it grey as you do now. So, your logic is ultimately responsible for knowing what has been selected and for visually presenting all changes of color.
In some cases, you might also need logic to ignore a cell-click if, for example, the program is in the process of doing something with the current selection. If the program is “busy,” the subroutine should simply return without doing anything, so as not to disturb the current-selection state.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tk::Table cell select/deselect
by amkkmkalk (Novice) on Jun 09, 2014 at 21:44 UTC |