For Programmers: Free Programming Magazines  


Home > Archive > Tcl > October 2005 > namespace









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author namespace
mitch

2005-10-26, 7:01 pm

can I use namespace to share control of a variable between two or more concurrently
running programs ?

To be more clear , is it possible to have tcl program "A" running, showing a label widget
attached to textvariable "myvar" .

Then allow another tcl program "B" to make changes to myvar , and see the changes in
program "A" widget ?

....M'

Kaitzschu

2005-10-26, 7:01 pm

On Wed, 26 Oct 2005, mitch wrote:

> can I use namespace to share control of a variable between two or more
> concurrently running programs ?


No, namespaces are per process.

> To be more clear , is it possible to have tcl program "A" running,
> showing a label widget attached to textvariable "myvar" .
>
> Then allow another tcl program "B" to make changes to myvar , and see
> the changes in program "A" widget ?


Yes, but not (only) with namespaces. Tcp sockets are dead easy in Tcl, you
should try to synchronize your programs via one.

--
-Kaitzschu
s="TCL ";while true;do echo -en "\r$s";s=${s:1:${#s}}${s:0:1};sleep .1;done
Bryan Oakley

2005-10-30, 3:56 am

mitch wrote:
> can I use namespace to share control of a variable between two or more
> concurrently running programs ?
>
> To be more clear , is it possible to have tcl program "A" running,
> showing a label widget attached to textvariable "myvar" .
>
> Then allow another tcl program "B" to make changes to myvar , and see
> the changes in program "A" widget ?
>
> ...M'
>


Out of the box, no. But Tcl make socket communication trivial, and you
can use sockets to keep two apps in sync.

You might also look at Tequila, which is designed to do exactly this --
let two or more apps share tcl variables. Download the code, add three
lines of code to your program, and you're done.

http://www.equi4.com/tequila.html
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com