CLIM mail archive

[Prev][Next][Index][Thread]

RE:multiple application frames



>    Has anyone on this mailing list designed applications which utilize multiple
>    application frames whose commands may interact with one another? I would be
>    [....]
>    ______________________________________
>    Don Hamilton       hamilton@crd.ge.com
>  
>  
>  Perhaps the ILA folks can comment here about their plans for 
>  master/slave technology in CLIM 1.0 and 2.0.  
>  
>  jeff morrill
>  jmorrill@bbn.com

YES YES YES!!

I hope I'm not wasting too much bandwidth with this, it's a bit
trivial I'm afraid: We use lots of application frames in our system.
There is a very weak interaction between frames. I.e. each frames
knows at least its subframes and its parent frame.

We access and modify state from other frames by calling generic
methods for each frame. Below is some code which shows how we make
those cross-references.

I'm rather posting this to show that people are using several frames
in an application and that some parent-daughter semantics for commands
is *VERY HIGHLY* wanted. In some cases in our system this is not
important, but I am thinking of others cases, e.g. where the user
wants to pop up a configuration window with lots of sub-panes who
should react to the same mous-clicks.
  
The same applies for lighter "open-window-stream windows". I'd be
already quite happy if I could use those as fully integrated daugther
windows for a frame. (but outside of the frame window !)

                                   greetings    - Daniel

Daniel K.Schneider, TECFA (Educational Technologies and Learning)
Faculte de Psychologie et des Sciences de l'Education, University of Geneva,
1211 Geneva 4 (Switzerland), Tel.(..41)22 705 7652, Fax. (..41) 22 20 29 27.

Internet:   schneide@divsun.unige.ch  (and various national nets)    | if reply
CSnet/ARPA: schneide%divsun.unige.ch@relay.cs.net   (old style)      | does not
X400:       S=schneide;OU=divsun;O=unige;PRMD=switch;ADMD=arcom;C=ch | work,
uucp:       mcvax!cui!divsun.unige.ch!shneider                       | try one
BITNET:     schneide@cgeuge51                                        | of
DECNET:     UGUN2A::SCHNEIDE (local Swiss)                           | these


;; ------------------------------------------- some code

;; works with Franz ACL 41Beta and CLIM1.0

(defclass memolab-frame-mixin ()
	  ((name :initarg :name
		 :initform "unnamed memolab User object"
		 :accessor name)
	   ;; contains the Franz process
	   (process :initarg :process
		    :initform nil
		    :accessor process)
	   ;; contains the various (sub) frames, e.g. help hypertexts
	   (sub-frames :initarg :sub-frames
		       :initform nil
		       :accessor sub-frames)
	   ;; contains eventual parent frames
	   ;; -- do we need a list here $$??, for control??
	   (parent-frame :initarg :parent-frame
			 :initform nil
			 :accessor parent-frame)
	   )
  (:documentation
   "A Memolab CLIM application frame"))


(DEFINE-application-FRAME
 memolab
 (clim:application-frame memolab-frame-mixin)
 (
  ;; subframes
  (make-material-frame :initarg :make-material-frame
		       :initform nil :accessor memolab-make-material-frame)
  (make-task-frame :initarg :make-task-frame
		   :initform nil :accessor memolab-make-task-frame)
  (help-frame :initarg :help-frame
	      :initform nil :accessor memolab-help-frame)
  ;; ......
  )
 (:PANES
  .............
	))   



(defmacro get-frame () '*memolab*)
(defmethod initialize-instance :after ((frame memolab) &rest initargs)
	   "Will save us the launched from into a variable"
	   (setf (get-frame) frame)
	   ;; create the slave frames for the lab
	   (setf (memolab-make-material-frame frame) (run-mat :caller frame))
	   (setf (memolab-make-task-frame frame) (run-task :caller frame))
           ;; .....
	   )


(defun run-lab (&key (caller nil))
  (run-application 'memolab
		   :pretty-name "Memolab"
		   :parent *memolab-root*
		   :left 100 :top 100
		   :width 700 :height 600
		   :caller caller
		   ))

(defun run-application (class  &key
			       (pretty-name "random frame")
			       (parent (get-server-path))
			       (left 50)
			       (top 50)
			       (height 200)
			       (width 200)
			       (caller nil)
			       (own-process t)
			       )
  "launches an application with the right parameters"
  (let ((app
	 (clim:make-application-frame class
				      :pretty-name pretty-name
				      :parent      parent ; clim root window
				      :left        left
				      :top         top
				      :height      height
				      :width       width
				      :parent-frame caller ; our parent frame
				      )))
    ;; ---- launch the frame
    ;; each memolab application frame knows its own process
    (setf (process app)
      (if own-process
	  (mp:process-run-function pretty-name #'clim:run-frame-top-level app)
	(clim:run-frame-top-level app)))
    ;; ---- put the application in the sub-frames slot of the caller
    (if caller
	(push app (sub-frames caller)))
    app)
  )






0,,


Main Index | Thread Index