Lisp HUG Maillist Archive

Popup menus for capi:option-pane and capi:text-input-choice

Hello lispworkers,

I have tried the two documented ways of customizing popup menus for capi:option-pane
and capi:text-input-choice:

1) Specifying a function of my own as the :pane-menu initarg,
2) Defining methods on capi:pane-popup-menu-items.

None seems to work on LWW 4.4.6. For capi:text-input-choice, LispWorks
always pops up the default menu. For capi:option-pane, no menu is shown at
all.

Have anybody succeeded in doing so on LW 4.4 or 5.0?
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru


RE: Popup menus for capi:option-pane and capi:text-input-choice

> I have tried the two documented ways of customizing popup 
> menus for capi:option-pane and capi:text-input-choice:
> 
> 1) Specifying a function of my own as the :pane-menu initarg,
> 2) Defining methods on capi:pane-popup-menu-items.
> 
> None seems to work on LWW 4.4.6. For capi:text-input-choice, 
> LispWorks always pops up the default menu. For 
> capi:option-pane, no menu is shown at all.
> 
> Have anybody succeeded in doing so on LW 4.4 or 5.0?

This is not what you want?

(setq option-pane (capi:contain
                   (make-instance 'capi:option-pane
                                  :items '(one two three four five)
                                  :selected-item 3))) 

Mitch


Re: Popup menus for capi:option-pane and capi:text-input-choice

"Mitch Berkson" <mitch@bermita.com> wrote:

|> I have tried the two documented ways of customizing popup
|> menus for capi:option-pane and capi:text-input-choice:
|
| This is not what you want?
|
| (setq option-pane (capi:contain
|                    (make-instance 'capi:option-pane
|                                   :items '(one two three four five)
|                                   :selected-item 3)))

I am afraid, no. I have meant the popup menu that is displayed when the
:post-menu gesture is entered by the user (mouse-right-click or Shift+F10 on
Windows).
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru


RE: Popup menus for capi:option-pane and capi:text-input-choice

> I am afraid, no. I have meant the popup menu that is 
> displayed when the :post-menu gesture is entered by the user 
> (mouse-right-click or Shift+F10 on Windows).

Is this it?

(defun popup-test-menu-1 (pinboard x y &optional gspec)
  (capi:display-popup-menu
   (make-instance 'capi:menu :items '(1 2 3))
   :owner pinboard :x x :y y))

(defun popup-test-menu-2 (pinboard x y &optional gspec)
  (capi:display-popup-menu
   (make-instance 'capi:menu :items '(one two three four))
   :owner pinboard :x x :y y))

(capi:define-interface gg ()
  ()
  (:panes
   (g1 capi:pinboard-layout
                :input-model 
                '((:post-menu popup-test-menu-1))
                :visible-min-width 100
                :visible-min-height 100)
   (g2 capi:graph-pane)
   (g3 capi:pinboard-layout
                :input-model 
                '((:post-menu popup-test-menu-2))
                :visible-min-width 100
                :visible-min-height 100))
  (:layouts
   (main-layout capi:column-layout '(g1 g2 g3)))
  (:menus
   (colors-menu "Colors" 
                ((:component
                  (:red :green :blue)
                  :interaction :single-selection
                  :print-function 
                  'string-capitalize)
                 more-colors-menu))
   (more-colors-menu "More Colors"
                     (:pink :yellow :cyan)
                     :print-function 
                     'string-capitalize))
  (:menu-bar colors-menu)
  (:default-initargs :title "Test Popup"))

(capi:display (make-instance 'gg))


Updated at: 2020-12-10 08:46 UTC