Re: -textvariable & Tcl_Eval

From: Michael Schlenker (schlenk_at_uni-oldenburg.de)
Date: 08/08/04


Date: Sun, 08 Aug 2004 16:38:05 +0200

garyether wrote:

> Hi all,
>
> I have a C function setting a TCL global variable which is tied to an
> entry widget using -textvariable. Problem is though globals value is
> updated in C and then TCL using Tcl_SetVar - the entry widget doesnt
> change its display unless i do two things: call - Tcl_Eval(inter, "update
> idletasks"); and then move the mouse around over the window, otherwise it
> doesnt change on screen at all.
>
> I dont want to have to do either of the last two steps is their a way to
> achieve this?

Display is only updated if Tcl enters the event loop and processes its
idle events. So you have to change the var and enter the Tcl event loop.
One way to do this is calling update idletasks...

But maybe you could explain what you try to achieve with your C
function, and we could give you some hints what would be the best way to
do it.

Michael



Relevant Pages

  • Re: One interp, many threads
    ... In the case of, say, a GPS receiver, we have to show ... GPS thread updates some variables via the C interface. ... do not lend themselves to Tk event loops or Tcl access. ... call the Tk event loop to keep the display snappy. ...
    (comp.lang.tcl)
  • Re: the loop event
    ... After your main thread has initialized Tcl. ... script which should be inserted into the event loop before running the ... LPASYNCEVENT ae; ... If you plan on turning Tcl's event loop into an alertable queue to ...
    (comp.lang.tcl)
  • Handling asynchronous hardware events
    ... I'd like to use TCL to control my devices over the GPIB/IEEE488.1 serial bus. ... For example I'm not allowed to call stdio functions in this handler, so typically one needs to send a message with SetEventon Windows and checks with WaitForEventin the main loop to handle the request. ... Can someone provide me with a simple example, what functions have to be called in the interrupt handler to queue an event, unblock the event loop, and how to register event handling on the Tcl level. ...
    (comp.lang.tcl)
  • Re: Handling asynchronous hardware events
    ... I'd like to use TCL (and especially its event loop) to control my ... In C I can install an asynchronous handler, ... I'd like to use Tcl and events instead, e.g. fire an event and provide ... event, unblock the event loop, and how to register event handling on ...
    (comp.lang.tcl)
  • Re: Tcl Evangelism
    ... Sound like Tcl with it's built-in event loop? ... Javascript, that you look into node, and point out at every chance you ... their "language of the year", ...
    (comp.lang.tcl)