Re: Help me



ducnguyenanh1984@xxxxxxxxx wrote:
Iam new user in Tcl. Here my code:
package require Iwidgets



iwidgets::tabnotebook .tnb -width 5i -height 3i
pack .tnb

variable page1 [.tnb add -label "*** 1"]

variable page1 [.tnb add -label "*** 2" -command {
variable UXYZ 2
}]
variable w1 [canvas $page1.cnvbg -width 14.2c -height 8c -relief
flat ]
grid $w1 -in $page1 -column 0 -row 0
iwidgets::entryfield $w1.ent1 -textvariable UXYZ
$w1 create window 5 5 -anchor nw -window $w1.ent1
.tnb view 0

My problem is I can't update value of variable UXYZ to entry.
Thank you very much

All you need to do is:
set UXYZ {Some Value}

Unless you are in a procedure, then you need to:
set ::UXYZ {Some Value}

Remember, variables associated with widgets (via -*variable) are always at the global level in the empty namespace.

--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
.


Quantcast