[plt-scheme] triggering choice% popup
For list-related administrative tasks:
http://list.cs.brown.edu/mailman/listinfo/plt-scheme
Hi Matthew,
Matthew Flatt wrote:
>
>
> I've been meaning to answer your question about combo boxes (choice
> plus text field). The short answer is that it's a missing widget.
I've been trying to get a choice% object to drop down it's list of items at a keystroke. The idea was that the popup/drop-down would be triggered by a mouse-event called via on-sub-window-event.
Well this is the latest version of that code, still nothing works.
(define my-choice%
(class choice%
(rename (sup-on-sub window-event on-sub window-event ))
(define/override (on-sub window-event self mouse-event)
(when (eqv? (send mouse-event get-event-type) 'left-down)
(display mouse-event)
(newline))
(sup-on-sub window-event self mouse-event)
#f)
(define/override (on-sub window-char self key-event)
;(send self clear)
(on-sub window-event self (make-object mouse-event% 'left-down #f))
#f)
(super-instantiate ())))
Is my assumption wrong that the popup can be triggered like this? Is there any other way?
Best regards
and merry Christmas
Guenther
>
> Providing the platform-specific widget on each GUI platform is probably
> not too difficult, but the resulting text field wouldn't behave quite
> like text-field%, which is implemented using text%. I'm not sure how
> easy it will be to get a combo box that works well with the rest of
> MrEd, but it sounds like you're trying...
>
> Matthew
>
>