List faces – text-list, drop-list, and drop-down

Often a data item can take any of a discrete number of values stored in a series. For this, we need to use some kind of list face. Here is a window using list faces, from left to right, text-list, drop-list, and drop-down:

Here is the code:

;-- see Chapter09/list-faces.red:city-trip: copy ["Paris" "London" "Leipzig" "Rome" "New York" "Beijing"]view [        title "List faces"    t1: text "Click on a city to visit ->"    text-list 100x100 data city-trip [t1/text: pick face/data face/selected]    t2: text "Click on a city to visit ->"    drop-list data city-trip [t2/text: pick face/data face/selected] t3: text ...

Get Learn Red - Fundamentals of Red now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.