This most likely isn't the most elegant solution, but I managed to do what 
I needed using something similar to the following:

In the buttonrelease-1 table binding, I set a global variable 
tblcell_active = 1.  This acts as a flag to tell me if there is an active 
cell. Next (still within the binding...) I show a 'dialog' that the user 
can select from a set of preset values.  Once the user has made their 
selection, I then set these values in cells elswhere in the table. When 
the user closes the dialog (clicks the OK button), a procedure is called 
where I have something like the following:


if {$tblcell_active} {  ;# the user has clicked on a cell...
  set cur_tbl_row [mytablealias index active row] ;# get the row index of 
the cell
  set tblcell_active 0  ;# reset the flag
}
         :
         :

# place the user selected values in cells in the same row, but different 
columns...
 set mytablearray($cur_tbl_row,$column1) $variable1 
 set mytablearray($cur_tbl_row,$column2) $variable2

Many thanks!
-Vern

>     Are you trying to store the active cell on a button release?  You
> might want to look at the -browsecommand option of the table.  It is a
> command you can specify that gets executed anytime the active cell
> changes.
> 
>     Try looking at that and see if it does what you're looking for. 0-]
> 
> Damon
> 
>> I placed this in the button release-1 binding of the table, hoping to 
>> capture the row of the active cell when selected.  But it returns an 
>> error, something like: "no active cell".
>> 
>> There is an example that was included with my Tcl install from
>> ActiveState  that approximates what I'm attempting, but looks like it
>> uses Tags...  I'm  too new to this and consequently uncertain how to
>> apply that in Vtcl.  The  example I refer to is in Tcl/demos/tktable/
>> (...or 
>> ActiveTcl/demos/tktable/ on my Linux box...) and is named
>> 'command.tcl'.   When a user selects (clicks) on a cell, the row,col
>> info is displayed in  the upper left corner and the cell is
>> higlighted.  For my app, I just want  to set a variable with the row
>> of the cell selected...  
>> 
>> Is there a way to do this within the context of Vtcl?
>> 
>> Thanks,
>> -Vern
>> 
>> >> My application uses the Tktable widget.  Is there a way to get the
>> >> row or  col (or both) of the active cell from within Vtcl (or any
>> >> other way)?
>> >> 
>> >> Thanks,
>> >> -Vern
>> > 
>> > .table index active
>> > 
>> >     Will return you the current cell.  You can also use:
>> > 
>> > .table index active row
>> > 
>> >     To get just the active row.  Or...
>> > 
>> > .table index active col
>> > 
>> >     To get just the active column.
>> > 
>> > 
>> > Damon
>> > 
>> > 
>> > 
>> > -------------------------------------------------------
>> > This SF.net email is sponsored by: SF.net Giveback Program.
>> > Does SourceForge.net help you be more productive?  Does it
>> > help you create better code?  SHARE THE LOVE, and help us help YOU! 
>> > Click Here: http://sourceforge.net/donate/
>> > _______________________________________________
>> > vtcl-user mailing list
>> > [EMAIL PROTECTED]
>> > https://lists.sourceforge.net/lists/listinfo/vtcl-user
>> 
>> 
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: SF.net Giveback Program.
> Does SourceForge.net help you be more productive?  Does it
> help you create better code?  SHARE THE LOVE, and help us help
> YOU!  Click Here: http://sourceforge.net/donate/
> _______________________________________________
> vtcl-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/vtcl-user




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
vtcl-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/vtcl-user

Reply via email to