CLIM mail archive

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

Clim 2.0beta



Hi.

Some questions regarding CLIM 2.0beta...

CLIM 2.0beta
ACL 4.2beta
SunOS 4.1.1
IPX

1.  I can't seem to get any colors thru:

    (clim:find-named-color "antique-white" (clim:port-default-palette (clim:find-port)))

    while running the Motif port.  When I look at the palette, there
    are no entries in any of the hash tables within.

2.  What happened to command previewers?  There used to be a
    *command-previewers* variable which you could bind to characters
    that would invoke the command previewer.

3.  I'm having problems with the layout language.  The doc is pretty
    sparse, and I've looked at the demos but they tend to layout stuff
    in a pretty simple way.  Some questions:

    o What is the difference if any in specifing size constraints in
      the :panes vs. :layouts options?  Which takes precedence?  In
      some cases (see below), I can't get size constraints in the
      :panes to take affect sometimes and have to do things with
      :layouts.  What is the intent of the division of labor between
      :panes and :layouts?  Is :layouts primarily for multiple
      layouts?  If one has a single layout, is it true that I can
      completely specify that layout thru :panes?  For multiple
      layouts, I cannot overspecify panes in :panes and must rely on
      :layouts to define how a particular pane is layed out in a
      particular layout?

    o The only way I can get a reasonable sized pointer documentation
      pane is to specify a :max-height, :height by itself doesn't seem
      to do the job.  Shouldn't just specifing :height of say
      '(1 :line) force the pane to be only one line high?

    o There is pretty slim doc on the layout language.  I have derived
      some stuff from the demos but some writeup on this would be
      *very* helpful.

4.  I see that there is a :label option to panes.  This is cool but I
    want to be able to specify text style, top or bottom margin for
    placement and where to place in the margin (left, center, right).
    OK, I really want DW stuff :-(

5.  Are there title panes?

6.  There seems to be a number of undocumented options to
    define-application-frame such as:

    o :pointer-documentation
    o :geometry
    o :user-specified-position-p
    o :user-specified-size-p
    o :name
    o :pretty-name
    o :pane-constructors
    o :properties

    Any help here?

7.  What is an clim:outlining composite pane?  Are there others that
    are undocumented?

8.  I see there is a :text-cursor option to panes.  What are the legal
    values?  I presume that this replaces the old
    :initial-cursor-visibility option of CLIM 1?  What are the other
    undocumented pane options?

Note comments in the code below...

Thanks.

ba

--------------------------

;;; -*- Syntax: Common-lisp; Mode: Lisp; Package: User -*-

(in-package :user)

(clim:define-application-frame test1

    ;; Inherits from...
    (clim:standard-application-frame)

  ;; Application slots.
  (
   (default-layout
     :documentation "Default layout for application."
     :initform :default			;:alternate
     :initarg :default-layout
     :accessor test1-default-layout)
      )

  (:panes

   ;; This seems to work OK.
   ;; Can't find the color though.
   (menu :command-menu
	 ;;:background
	 ;;(clim:find-named-color "antique-white" (clim:port-default-palette (clim:find-port)))
	 :foreground clim:+black+
	 :text-style '(:serif :bold :small)
	 :width :compute
	 :height :compute
	 :max-height '(10 :line))

   (interactor :interactor
	       :scroll-bars :both
	       ;;:background
	       ;;(clim:find-named-color "antique-white" (clim:port-default-palette (clim:find-port)))
	       :foreground clim:+black+
	       :text-style '(:serif :roman :normal))

   ;; The :max-width option doesn't seem to take affect.
   ;; I want this pane to have a maximum width when layed out.
   ;; The only way I can do something like this is to specify that this
   ;;  pane is to be a certain percentage of the total width in the :layouts option.
   (defined-defsystems :accept-values
       :scroll-bars :vertical
       ;;:background
       ;;(clim:find-named-color "antique-white" (clim:port-default-palette (clim:find-port)))
       :foreground clim:+black+
       :text-style '(:serif :roman :normal)
       ;;:max-width '(50 :character)
       :display-function '(clim:accept-values-pane-displayer
			   :displayer display-defined-defsystems))

   ;; Ditto for :max-width here...
   (history-of-defsystems :accept-values
			  ;;:background
			  ;;(clim:find-named-color "antique-white" (clim:port-default-palette (clim:find-port)))
			  :foreground clim:+black+
			  :text-style '(:serif :roman :normal)
			  ;;:max-width '(50 :character)
			  :scroll-bars nil
			  :display-function '(clim:accept-values-pane-displayer
					      :displayer display-defsystem-history))

   ;; I can only make this work with :max-height otherwise I get very large pointer pane.
   (mouse-line :pointer-documentation
	       ;;:background
	       ;;(clim:find-named-color "antique-white" (clim:port-default-palette (clim:find-port)))
	       :foreground clim:+black+
	       :height '(1 :line)
	       :max-height '(2 :line)
	       )
   )					;end :panes

  (:menu-bar nil)
  (:layouts
   (:default
    (clim:vertically ()
		     menu
		     (:fill interactor)
		     mouse-line))
   (:alternate
    (clim:vertically ()
		     menu
		     (clim:horizontally ()
					(:fill interactor)

					;; Shouldn't I be able to put a :max-width
					;;  as an option to clim:vertically?
					;; This specifies that this column is to take
					;;  1/4 of the width of the total available,
					;;  I use this instead of :max-width in the clim:vertically
					;;  or in the :panes specification.
					(1/4 (clim:vertically ()
							      (:fill defined-defsystems)
							      (1/3 history-of-defsystems))))
		     mouse-line))
   )					;end :layouts

  (:command-table (test1-command-table :inherit-from (clim:user-command-table
						      clim:accept-values-pane)))
  (:command-definer t)
  (:top-level (test1-top-level))
  )

(defmethod test1-top-level ((frame test1) &rest args)

  ;; This doesn't work...
  ;; I blow out into the debugger.
  ;;(setf (clim:frame-current-layout frame) (test1-default-layout frame))
  ;;(clim:layout-frame frame (clim:frame-top-level-sheet frame))

  (unwind-protect
      (loop with *standard-output* = (interactor-pane frame)
	  with *query-io* = (interactor-pane frame)

          ;; Where are command previewers???
	  ;;with clim:*command-previewers* = '(#\meta-?)

	  with clim:*help-gestures* = '(#\?)
	  with clim::*abort-gestures* = '(#\control-c)
	  with clim:*completion-gestures* = '(#\tab)
	  with clim:*possibilities-gestures* = '(#\control-?)

	  with *package* = *package*	;so we get local binding...

	  do

	    (clim:default-frame-top-level frame :prompt "test1> "))
    
    ;; Cleanup...
    ;;(format t "Goodbye.~&")
    )
  )

;;; ----------------------------------------------------------------------

(define-test1-command (com-clear
		       :name t
		       :menu t)

    ()
  
  (clim:window-clear (interactor-pane clim:*application-frame*)))

(define-test1-command (com-quit
		       :name t
		       :menu t)
    ()

  (clim:frame-exit clim:*application-frame*))

(define-test1-command (com-change-layout
		       :menu t
		       :name t)

    ((new-layout '(clim:member-alist (("Default"
					  :value :default
					:documentation "The default layout")
				      ("Alternate"
				       :value :alternate
				       :documentation "Alternate layout with AVV pane.")))
		 :default (clim:frame-current-layout clim:*application-frame*)
		 :display-default t
		 :prompt "Layout Name")
     )
    
  (setf (clim:frame-current-layout clim:*application-frame*) new-layout))

;;; ----------------------------------------------------------------------

(defmethod interactor-pane ((frame test1))
  (clim:get-frame-pane frame 'interactor))

(defmethod menu-pane ((frame test1))
  (clim:get-frame-pane frame 'menu))

(defmethod display-defined-defsystems ((frame test1) stream)

  (let ((defined-systems '("System1" "System2" "A Real Cool System")))

    (clim:indenting-output (stream '(2 :character))
       (clim:formatting-item-list (stream)

          (clim:formatting-cell (stream :align-x :center)
             (clim:with-text-style (stream (clim:make-text-style :fix :bold :large))
	        (format stream "Systems")))
     
	  (clim:formatting-cell (stream)
	     (format stream " "))
      
	  (cond (defined-systems
		 (loop for system in defined-systems
		     do
		       (clim:formatting-cell (stream :align-x :center)
			  (write-string system stream))))
		(t
		 (clim:formatting-cell (stream :align-x :center)
		    (clim:with-text-style (stream (clim:make-text-style :fix :italic :normal))
		      (format stream "None")))))))))

;;; defsystem-history pane AVV displayer...
(defmethod display-defsystem-history ((frame test1) stream)

  (clim:indenting-output (stream '(2 :character))
    (clim:formatting-item-list (stream)

      (clim:formatting-cell (stream :align-x :center)
        (clim:with-text-style (stream (clim:make-text-style :fix :bold :large))
	  (format stream "History")))
     
      (clim:formatting-cell (stream)
	(format stream " "))
      
      (let (;;(systems (collect-recent-history frame 'cmu-defsystem-top :depth 5))
	    (systems nil)
	    )

	(cond (systems
	       ;; removed...
	       )
	      (t
	       (clim:formatting-cell (stream :align-x :center)
                 (clim:with-text-style (stream (clim:make-text-style :fix :italic :normal))
		   (format stream "None"))))))
      
      
      )))

;;; ----------------------------------------------------------------------

(defvar *current-test1-frame* nil)
(defvar *current-test1-process* nil)

(defun run-test1-frame (frame)

  (unwind-protect
      (clim:run-frame-top-level frame)

    (setf *current-test1-frame* nil)
    (setf *current-test1-process* nil)))

(defun make-test1-frame (&key (width 860) (height 600))
  (let (frame process)
      
    (setf frame (clim:make-application-frame 'test1
					     :width width
					     :height height))
      
    (setf process (mp:process-run-function "TEST1-FRAME"
					   #'run-test1-frame
					   frame))
    (values frame process)))

(top-level:alias ("test1-frame" 10) (&key force deselect)
   "Make a new tests1 frame."

   (cond ((and deselect *current-test1-frame*)
	  (clim:shrink-frame *current-test1-frame*))
	 
	 ((or force (null *current-test1-frame*))
	  (multiple-value-setq (*current-test1-frame* *current-test1-process*)
	    (make-test1-frame)))
	 (*current-test1-frame*
	  ;; There already is one.
	  ;; Raise to the top of the window stack.
	  (clim:enable-frame *current-test1-frame*)
	  ;;(cs:frame-raise *current-test1-frame*)
	  )))

(top-level:alias ("reset-test1-frame" 6) (&key force)
  "Reset test1 frame."

  (when (or force
	    (and *current-test1-process* (mp:process-active-p *current-test1-process*)))
    (mp:process-kill *current-test1-process*))

  (setf *current-test1-frame* nil)
  (setf *current-test1-process* nil))

-----------------

Brian H. Anderson                     (206) 234-0881
Boeing Commercial Airplane Co.        bha@gumby.boeing.com
Seattle, Wa.

0,,

Follow-Ups:

Main Index | Thread Index