Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Again OOP problem

Status
Not open for further replies.

akpr

Programmer
Jul 25, 2001
19
US
I used upvar, code
but an error cannot read $index is displayed

my question is how do i read a vriable from a class within out side the scope
ie

in a class i have a button like

class ee {
foreach item $images {
itk_component add button$index {
image create photo $index -file ./image/$item.gif
button $itk_interior.but$index -image $index -command {
set BUTTONCLICK button$index
# [ BUTTONCLICK is a variabe assiged by INITIALIZED]
#ie ::Toolbar .file [[ -variable BUTTONCLICK ]]
Button_click - # a proc out side this class
}
incr index
}
}


outside class

proc Button_Click { } {
global BUTTONCLICK
tk_messageBox -message "$BUTTONCLICK " -icon question
}

As soon as i click any button an error cannot read index is getting displayed
Thanks
Anil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top