CLIM mail archive


Re: selecting items in a menu


I'm not exactly sure about what you want. For selecting items from
a menu, normally menu-choose can be used.

I assume that you want the items to remain displayed after the selection
or invoke different commands on them. There are basically two ways 
to achieve this.

The first one is simply add a pane of type :application to the layout 
of your frame and to use this pane to diplay the items. This roughly
looks as follows:

(clim:define-application-frame ISMA (clim:application-frame)
  (:panes ((isma-menu :command-menu)
	   (isma-display :application :end-of-line-action :allow
                             :end-of-page-action :allow :scroll-bars
                             :both )
           (isma-interaction :interactor :end-of-line-action :wrap
                             :end-of-page-action :scroll :scroll-bars
                             :both :vsp 3)))
  (:layout ((ISMA-COMMAND
               (:column 1 (isma-menu :compute)
			  (isma-display 0.75)
                          (isma-interaction :rest)  )))))

(defun Make-ISMA-Application-Frame ()
         (clim:make-application-frame 'isma :pretty-name "ISMA" :parent
                        *ISMA-ROOT* :left 5 :top 5 :height 450 :width 400))

Presumably a larger height of the application frame is preferable in this case to have enough space for
displaying the items. [Actually there is no need for prefixing pane names.]

If you don't like this solution for any reason, you can still use an addditional window but then
you have to ensure that it has the same input buffer as the panes of the application frame.

So you keep the original definition of the ISMA frame, and use

	:parent *ISMA-ROOT* 
	:input-buffer (stream-input-buffer (get-frame-pane *ISMA-APPLICATION-FRAME* 'isma-interaction)))

Note that you can't use this before you have called Make-ISMA-Application-Frame. If you want 
to use this only from within the top level of the ISMA frame you can use the CLIM variable *APPLICATION-FRAME*
instead of *ISMA-APPLICATION-FRAME*. Sharing the input buffer makes all commands of the ISMA frame available 
for objects displayed in the window, so that presentation to command translators should work. 
I haven't tested this solution myself, but it has already been suggested for similar problems in the CLIM mailing list.

Good luck. Questions can be directed to: [don't use reply, the automatically generated return address is presumably wrong]

--- Frank


Main Index | Thread Index