*display* of variable not updated? 
Author Message
 *display* of variable not updated?

I have written a tiny Tck/Tk/C app which adds two numbers and displays
the result in label widget.  I'm running Tcl version 7.5 and Tk version 4.1.

The label widget's contents are in a variable called result:
        label .result -textvariable result

I use a small C function to modify (through a linked variable, of type) this Tcl
variable.  According to debugging puts/printf statements in the Tcl and
C code, the Tcl variable *is* being properly modified by the C function.

---> But, the value *displayed* in the label remains the same, and does not
change as the Tcl variable "result" is modified!!

So I wonder:
1) Why not?
2) How should I fix this?
3) Is there a way to force the label widget to re-examine the value in
the "result" variable associated with it?

I've been going mad trying (unsuccessfully) to fix this.
MANY, many thanks for any help.

--daniel

---------------------------------------------------------------------------



Sat, 12 Aug 2000 03:00:00 GMT  
 *display* of variable not updated?

Sorry folks, I've found the answer to my own question:
        I needed to use Tcl_UpdateLinkedVar().

I didn't see this documented in Dr. Ousterhout's
book, and managed to find it through several 'man -k' searches.

Is an errata/addendum sheet for Ousterhout's book posted anywhere?

--d.

Quote:

>  I have written a tiny Tck/Tk/C app which adds two numbers and displays
>  the result in label widget.  I'm running Tcl version 7.5 and Tk version 4.1.
>  The label widget's contents are in a variable called result:
>    label .result -textvariable result
>  I use a small C function to modify (through a linked variable, of type) this
>  Tcl variable.  According to debugging puts/printf statements in the Tcl and
>  C code, the Tcl variable *is* being properly modified by the C function.
>  ---> But, the value *displayed* in the label remains the same, and does not
>  change as the Tcl variable "result" is modified!!
>  So I wonder:
>  1) Why not?
>  2) How should I fix this?
>  3) Is there a way to force the label widget to re-examine the value in
>  the "result" variable associated with it?
>  I've been going mad trying (unsuccessfully) to fix this.
>  MANY, many thanks for any help.
>  --daniel
>  ---------------------------------------------------------------------------




Sat, 12 Aug 2000 03:00:00 GMT  
 *display* of variable not updated?


:I didn't see this documented in Dr. Ousterhout's
:book, and managed to find it through several 'man -k' searches.
:
:Is an errata/addendum sheet for Ousterhout's book posted anywhere?

Unfortunately I've not found one yet.
--

<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.



Mon, 14 Aug 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. alarm display summary listbox not updating as control reference

2. Session Variables not displaying.

3. Newbie - Variable not displayed

4. Why is my global variable not updating?

5. FXDataTarget not updating my variable

6. @ variables not updated within method?

7. entry variable not updated....

8. no display name and no $DISPLAY environment variable

9. no display name and no $DISPLAY environment variable -- ????

10. icons displayed in browses not displaying

11. Display.TransferBlock not supported by display

12. update not updating

 

 
Powered by phpBB® Forum Software