CLIM mail archive



    Date: Wed, 4 Nov 1992 20:05+0200
    From: Brian Anderson <>

    OK, I have placed my ordered menu item hack on
    under clim-1/ordered-menu-items.lisp.

    I would appreciate any feedback or enhancements.

Thanks for your contributions, Brian.


    Ideas on enhancements.

      o  extend layout syntax to allow style specifications (such as
	 the menu items text style, highlighting mechanisms, etc.)
      o  define column (row?) "headings" that are not mouse sensitive

There could also be a more general mechanism.  In the ctv-menu
extensions on the library (written by Peter Karp, Mabry Tyson, David
Wilkins and Scott McKay), I added to the menu-item definition (the long
form) a :no-select option that is nil by default.  When the user
specifies it as T, the menu item is not mouse sensitive.  This is
similar to symbolics' DW behaviour.  

Then in your code, you just look for that option and present the item as
either 'clim::menu-item or as 'clim::string (CLIM gods: isn't there
something better than this?  String will usually be ok, but i would have
preferred a clim::non-sensitive-presentation-type, which is different
from 'null because null prints as "None", which is not what I want.  Did
I miss something?).

For example (look at the "Note by Keunen" mark below): 


     (multiple-value-bind (item gesture)
	    #'(lambda(stream type)
		(dolist (menu-item item-list)
		  (format stream " ")
		  (clim:with-text-style ((or (getf (cdr menu-item) :style)
		    ;; Print the current item.  If we print "" this
		    ;; causes the CLIM window to grow much bigger with
		    ;; lots of white space at the borders, so we
		    ;; print " " in place of "".
		      (format nil "~A" (if (string-equal "" (car menu-item))
					   " "
					   (car menu-item) ))
		      ;; Note by Keunen (4-Nov-92 12:49:50) : modified for :no-select
		      (if (getf (cdr menu-item) :no-select)
		      :stream stream) )
		  (format stream " ~%"))
	    :x-position x
	    :y-position y)
	(declare (ignore gesture))

        (getf (cdr (assoc item item-list :test #'equal))
Never trust a pretty header: use to reply
Keunen Vincent                  Network Research Belgium
R&D, Software Engineer          Parc Industriel des Hauts-Sarts                   2e Avenue, 65
tel: +32 41 407282              B-4040 Herstal
fax: +32 41 481170              Belgium

Follow-Ups: References:

Main Index | Thread Index