[plt-scheme] Re: Location of MrEd builtin-class definition files

From: Guenther Schmidt (gue.schmidt at web.de)
Date: Sun Dec 21 18:28:13 EST 2003

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-subwindow-event on-subwindow-event ))
    (define/override (on-subwindow-event self mouse-event)
      (when (eqv? (send mouse-event get-event-type) 'left-down)
        (display mouse-event)
        (newline))
      (sup-on-subwindow-event self mouse-event)
      #f)
    (define/override (on-subwindow-char self key-event)
      ;(send self clear)
      (on-subwindow-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
> 
> 



Posted on the users mailing list.