CLIM mail archive


CLIM2 : bug in accept-method with pop-up menu

---------------------------------- Forwarded ----------------------------------
From: Marie-Christine Timmermans at ccmacpo
Date: 3/31/94 10:59AM
To: /DT=RFC-822/ at ccmacmta
Subject: CLIM2 : bug in accept-method with pop-up menu

Has somebody already seen such a bug in clim2 with genera 8.3 (note that this 
code worked well in clim1.1)?

Suppose I define a presentation type like this :

(clim:define-presentation-type my-string ()
  :inherit-from 'string
  :description "One string from a subset")

with an accept-method which pops up a menu, like :

(clim:define-presentation-method clim:accept        
    ((type my-string) stream (view clim:textual-view) &key)
  (let ((chosen-word (pop-up-words-list stream type)))
    (clim:present chosen-word 'string :stream stream)

(defun pop-up-words-list (stream type)
  (declare (ignore type))
    '("one" "two" "three" "four")
    :scroll-bars :dynamic
    :associated-window stream
    :pointer-documentation "Select one-word"))

Then I try to use this presentation-type in a command :

  (com-test1 :command-table configuration-others :name t)
    ((arg 'my-string :prompt "Use menu to select word"))
  (format (clim:frame-standard-output clim:*application-frame*) "~A" arg))

Every time I use this command, the pop-up menu for the command argument 
appears twice.

The value I select the second time is the one used for the body of the command.
Another thing very strange is that, if you define the command with the keyword 
:menu :

  (com-test1 :command-table configuration-others :name t :menu t)
    ((arg 'my-string :prompt "Use menu to select word"))
  (format (clim:frame-standard-output clim:*application-frame*) "~A" arg))

then, when you write the command in the interactor pane the same problem 
appears. But, if you use the command-menu pane to select the command, the it 
works well...

I have also written presentation types with other kinds of 
menus that pop up in accept and the same problem appears.

Should I have used the macro clim:define-presentation-action for this? In that 
case, could someone give me some examples of its use?

Any help would be greatly appreciated.

Timmermans Marie-Christine      Network Research Belgium               Parc Industriel des Hauts-Sarts
Tel: +32 41 407261              2e Avenue, 65
Fax: +32 41 481170              B-4040 Herstal, Belgium

Main Index | Thread Index