[ltk-user] Just one frame?

Johnny Zackrisson jz at student.chalmers.se
Thu Apr 26 20:23:57 UTC 2007


Here is a simple example:

;-- snip
(start-wish)

(with-ltk (:stream (wish-stream *wish*))
  (let* ((a (make-instance 'frame :width 60 :height 60 :border 2))
	(b (make-instance 'frame :width 100 :height 230))
	(c (make-instance 'button :text "Press blah.."))
	(d (make-instance 'label :master a :text "foo"))
	(e (make-instance 'label :master b :text "bar")))
    (pack a)
    (pack b)
    (pack c)
    (pack d)
    (pack e)))

(with-ltk (:stream (wish-stream *wish*))
  (let ((f (make-instance 'label :text "zot")))
    (pack f)))
; -- snip

the second call to the "with-ltk" macro wont work. the point
here is i want to be able to continue hacking around at the repl,
doing other things, and then later on perhaps add another entity
to the gui.

what if i wanted to add the "f" label to the "b" frame; am i forced
to use globally declared variables for the initial frame, or is
there other ways to deal with such a situation? (observe that the
"f" label call is done /after/ the first packing).

furthermore, is it also possible to attach handlers to objects
(say buttons or a keyboard event) in such a way that it
automatically dispatches a separate thread and excecute the handler
assigned to that thread, without interrupting the rest of
the lisp system (ie, the repl will be interactive, as well as other
concurrently running threads).

another example would be: how would you design a lisp-repl in a tk
frame, sending the lisp code to the lisp-environment for execution
and then return the answer of course, or even add tk objects from
within that tk-repl?

thanks,
--
johnny zackrisson, gothenburg, sweden.














More information about the ltk-user mailing list