On 7/14/05, David Douthitt <ssrat / mailbag.com> wrote:
> I'm trying to use a series of CheckButtons, and all is going pretty
> well.
> 
> However, I want to change the associated variable and have it reflected
> in the CheckButton.  I'm not sure of how to do this.
> 
> I searched through Google Groups and Google Web and found nothing.
> 
> Because of the number of CheckButtons in my case (300) they are split
> up into 10 columns on screen in 10 different frames (which shouldn't
> matter).  The Checkbuttons are actually stored in a Ruby hash (based on
> a text string - server name, in this case).
> 
> I created a series of associated TkVariables in a related hash, but how
> do I set these variables?  I've been just assigning a 1 (integer) but I
> wonder.... does that change the hash value from a TkVariable to an
> Integer?
> 
> I'm missing something - everything works except there is no reflection
> in the display of the current status of the variables...

Something like
my_tk_checkbox_var = TkVariable.new
# create a checkbox assining its tkvariable to my_tk_checkbox_var
my_tk_checkbox_var.value = 1 # or maybe "1", i forget

That should check the checkbox.