Hi Peter,<br><br>Sorry for the delay. I'll try to illustrate what I'm doing and my<br>problem without quoting a bunch of irrelevant source code:<br><br>(defun do-rad-things ()<br> (ltk:do-msg "activity from network!"))
<br><br>(defun start-network ()<br> (let ((socket-stream (....))<br> (wish ltk:*wish*))<br> (sb-ext:add-fd-handler socket-stream<br> (lambda ()<br> (let ((ltk:*wish* wish))
<br> 'do-rad-things)))))<br><br>(defun start ()<br> (ltk:with-ltk (:serve-event t)<br> (build-our-gui)<br> (start-network)))<br><br>When tk sends output to ltk, the ltk handler is called and
<br>ltk:*wish* is bound to the poper wish structure. But when<br>do-rad-things is called, ltk:*wish* is no longer bound to the<br>proper wish structure so I have to do a little let dance to keep<br>it in order.<br><br>I propose that instead of a with-ltk macro, an ltk:root class is
<br>created which holds the connection to the subprocess and<br>represents the default root window wish produces when you start<br>it. It would probably be most convenient if all other widgets<br>also carried a pointer to the wish subprocess or the root class.
<br><br>So then the above might look like this:<br><br>(defun do-rad-things (wish)<br> (ltk:do-msg wish "activity from network!"))<br><br>(defun start-network (wish)<br> (let ((socket-stream (....))<br> (sb-ext:add-fd-handler socket-stream
<br> (lambda ()<br> (do-rad-things wish)))))<br><br>(defun start ()<br> (let ((wish (make-instance 'ltk:root)))<br> (build-our-gui wish)<br> (start-network wish)))
<br><br>What do you think?<br><br>-Shawn<br><br><br><br>