ActiveState Community

Accessing Auto generated variables

Posted by sckoarn on 2009-01-22 13:23

Generating a dynamic collection of checkbutton one for each item in "l2"


foreach l2f $l2 {
## add to the list of files
lappend file_lst $l2f
set chk [checkbutton $f1.dir$inc -text $l2f]

pack $chk -anchor e
##puts " $l1f"
incr inc
}

How do I get the value of the checkbox if I only know its pathname?

I have a big list of items all indicated by checkbox objects. I do not know how I could create variables that I could use to access the check state of the checkbutton. I know I can get a particular variable name, (the default name), but how do I access that variable?

I have done:

set var [$chk cget -variable]

But I have no idea how to get the Value of var.

Any ideas would be appreciated.

Sckoarn ;(

sckoarn | Mon, 2009-01-26 07:25

I have looked to find information in other places, but have not found anything. What would be the use of having a widget that you can not find the state of? I have used checkbutton in the past but have assigned a specific variable to them, but they were not an unknown list of items, they were specific single items in a GUI.

Now I want to be able to list a dynamic list of files and enable them with checkbuttons. How can I determine what the checked status of a checkbutton is, if I did not specify a specific -variable name?

It must be something very simple that I am missing, please comment.

Sckoarn ;(

sckoarn | Wed, 2009-05-20 11:36

I have still not found a solution to my problem of finding the state of an automatically generated variable, as stated above.

Is there a solution to this? If there is no solution, please tell me how I can get the value of an auto generated variable of the checkbutton widget.

Why has there been nothing suggested from my questions?
Is this too simple or is it too complicated to answer?

If I can not get any response from this forum, My opinion of ActiveState will be changed forever. I have always thought that ActiveState was quality, but after months of not getting, anything, from my question, leaves me with some after thoughts.

Sckoarn ;(