CLIM mail archive


Three Questions

    Date: Mon, 20 Jul 1992 05:06 EDT
    From:     Nichael Cramer <ncramer@BBN.COM>


    1] How can the fore/background for an existing window be changed?

    The :STREAM-BACKGROUND init-form works fine when the window is created, but
    after the window is created there doesn't seem to be an obvious way to do
    this (nor can I find anything in the documentation I have).  BTW, naively
    setting the clim::BACKGROUND slot doesn work (presumably because the
    context/gc's aren't affected?)

:STREAM-BACKGROUND has a misleading name, which is probably fooling you.
Just use (SETF (MEDIUM-BACKGROUND stream) color).  This has :AFTER
methods that update the gcontext.

    2] Forms inside a DEFINE-APPLICATION (e.g. *MY-STYLE* in the following):

     (define-application-frame MY-FRAME ()
	    . . .

    seem to be eval'ed at compile/load time (i.e. as opposed to at
    run/create-time).  Is this correct.  Is there anyway to trick this into
    eval-ing at the later time?

It's a bug that it gets eval'ed at compile time.  It is intentional that
it gets eval'ed at load time.

    3] How can I get my hands on the frame when a pane is being created?  The
    slots pointing to the frame don't seem to be set until after the
    initialize-instance is run and the standard variables (e.g.
    *APPLICATION-FRAME*) don't seem to be set (at least not to the right

Odd, I could swear that the pane layout code binds *APPLICATION-FRAME*.
Maybe this fix was made after Lucid released CLIM 1.1.  Try this:

(in-package :clim)
(defmethod initialize-instance :after ((frame application-frame)
				       &key pane-descriptions parent
					    left top right bottom width height)
  ;; If parent is NIL, assume that the caller of MAKE-APPLICATION-FRAME is going
  ;; to take care of window initialization.
  (when parent
    (multiple-value-bind (main-window panes)
	(create-windows-from-description frame pane-descriptions parent
					 :left left :top top
					 :right right :bottom bottom
					 :width width :height height)
      (setf (slot-value frame 'top-level-window) main-window)
      (setf (slot-value frame 'panes) panes)
      (let ((*application-frame* frame))
	(layout-frame-panes frame main-window)))))

Main Index | Thread Index