Skip to content

Instantly share code, notes, and snippets.

@nedzadarek
Created November 3, 2018 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nedzadarek/08a1dd355eb36ada87ac15759392b48c to your computer and use it in GitHub Desktop.
Save nedzadarek/08a1dd355eb36ada87ac15759392b48c to your computer and use it in GitHub Desktop.
When you click text list sometimes it disappear.
Red[]
l: layout[
do [
number-of-colors: 0
select-data: function [
list
] [
select list/data to-string list/selected
]
]
color-list: text-list data [] on-change [
print 'color-list-changed
color-list-preview/color: s: select-data color-list
color-tab-red/data: s/1
color-tab-blue/data: s/2
color-tab-green/data: s/3
]
color-list-preview: base red 100x30
panel [
text "Red"
color-tab-red: field on-change [
print 'color-tab-red-changed
probe _h: find/tail color-list/data (to-string color-list/selected)
probe _h/1/1
probe _h/1/1: color-tab-red/data
probe color-list/data
; show color-list
]
return
text "Blue"
color-tab-blue: field
return
text "Green"
color-tab-green: field
]
panel [
style _b: button 120
_b "add color" [
number-of-colors: number-of-colors + 1
append color-list/data reduce [
to-string number-of-colors
0.0.0
]
] return
]
]
view/no-wait l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment