Re: Dangerous update command



Mats wrote:
the GUI responsive, but was getting errors that the recursion limit
was reached. This was nothing but the "Update considered harmful"
http://wiki.tcl.tk/1255 problem,
My code looked roughly like:

fileevent $sock readable [list Readable $sock]

proc Readable {sock} {
....
# WRONG !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if {[string equal $::tcl_platform(platform) "windows"]} {
update
} else {
update idletasks
}
}

I don't think I understand why you need any kind of update there.
This is the very end of a fileevent handler. Simply returning will
cause Tcl to update and process the next event, whether a gui or a
file event. Is the problem that the gui events are queued up after
all the file events?

Donald Arseneau asnd@xxxxxxxxx
.



Relevant Pages

  • Network client using non-blocking I/O
    ... I/O on all channels, including stdin. ... the socket output fileevent. ... fileevent $sock writable ... set mainevent putsfailure ...
    (comp.lang.tcl)
  • Re: Events on Serial port
    ... | send the UartToI2C chip a command to send data, using a file event ... # Now poll DSR and send the trigger if high, the fileevent does the rest. ...
    (comp.lang.tcl)
  • Re: Events on Serial port
    ... | send the UartToI2C chip a command to send data, using a file event ... # Now poll DSR and send the trigger if high, the fileevent does the rest. ...
    (comp.lang.tcl)
  • Re: Events on Serial port
    ... | send the UartToI2C chip a command to send data, using a file event ... # Now poll DSR and send the trigger if high, the fileevent does the rest. ...
    (comp.lang.tcl)
  • Dangerous update command
    ... and I have until now been using 'update' or 'update idletasks' to keep ... fileevent $sock readable ... set data ...
    (comp.lang.tcl)