On Feb 14, 2019, at 9:22 PM, Alex Harsanyi wrote: > There are two solutions I can think of: > > (1) derive combo-field% and override the on-popup method to construct the > choice menu dynamically based on what is selected in the combo box field. > This has a few disadvantages, namely (a) you have to produce the menu > immediately, so if you have to query a database for the list of items, there > might be a long delay for the menu to show up and (b) the menu will not > update when the user types more text in the field, instead it will have to be > closed and reopened. > > (2) you can use a combination of text-field% and a list-box%, where the > callback on the text field will populate the list box with the filtered > contents. The user would have to select an item from the list box, but this > can be populated in a separate thread to prevent the GUI from freezing up > during a database query. It does not look as nice as GUI widgets from other > applications though... > > Here is some example code for both options, including an animation of what it > looks like: > > https://gist.github.com/alex-hhh/20f03dcf2f7f340d20b95cb36da39f61 > > Alex.
Thanks. This is really helpful. I will probably go with option (2) because it's more practical and this is a part of the application which will not be used frequently. -- 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.