It sounds like, based on what you're saying, that when you run the
code below and click on the choice that appears, that you see only "a"
appear, not "a" "b" and "c". Is that right?

#lang racket/gui

(define mono-list 'uninit)

(define vp%
  (class vertical-panel%
    (define/private (force-cache receiver)
      (when (eq? receiver font-name-control)
        (when (symbol? mono-list)
          (set! mono-list '("a" "b" "c"))
          (send font-name-control clear)
          (for ([x (in-list mono-list)])
            (send font-name-control append x)))))
    (define/override (on-subwindow-event receiver evt)
      (unless (or (send evt moving?)
                  (send evt entering?)
                  (send evt leaving?))
        (force-cache receiver))
      (super on-subwindow-event receiver evt))
    (define/override (on-subwindow-char receiver evt)
      (force-cache receiver)
      (super on-subwindow-char receiver evt))
    (super-new)))

(define f (new frame% [label ""]))
(define vp (new vp% [parent f]))
(define font-name-control (new choice% [parent vp] [label #f] [choices '("a")]))
(send f show #t)


Robby

On Sun, Jun 25, 2017 at 10:17 PM, Lehi Toskin <lehi.tos...@gmail.com> wrote:
> Since there is only a single choice, on-subwindow-event (line 86) will not be 
> executed by simply clicking, I need to wheel-up or wheel-down for it to 
> update the list of fonts. Pressing Enter, however, forces on-subwindow-char 
> (line 92) to execute and populate the list of fonts. Selecting the font I 
> want and restarting DrRacket will keep my font intact, but the list of fonts 
> is once again reduced to a single option - this time my font instead of 
> Monospace. I believe it has something to do with `preferences:get` call on 
> line 99, but I'm not familiar enough with the framework library to think of a 
> reason why it would be acting improperly.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to