Skip to content

Instantly share code, notes, and snippets.

@GiuseppeChillemi
Created September 3, 2020 16:53
Show Gist options
  • Save GiuseppeChillemi/b9a23523450090a094ca306adf951aa4 to your computer and use it in GitHub Desktop.
Save GiuseppeChillemi/b9a23523450090a094ca306adf951aa4 to your computer and use it in GitHub Desktop.
; Red [];
Rebol [
title: "ListTest"
]
main-list: [
"https://red-lang.org"
"http://www.slashdot.org"
"https://gitlab.com/hiiamboris/red-mezz-warehouse/-/tree/master"
"http://www.dobeash.com/munge.html"
]
view [
below
panel 400x200 [
links-list: text-list data main-list on-change [
if all [links-list/selected <> none links-list/selected > 0] [
]
]
]
panel 350x50 [
across
btn-open: button "Open" [
if all [links-list/selected <> none links-list/selected > 0] [
browse to-url main-list/(probe links-list/selected)
]
]
btn-add: button "Add" 80x20 [
view ask-input-panel: [
field 150x20 [ipt: copy face/text unview ask-input-panel]
]
append main-list ipt
]
btn-edit: button "edit" 80x20 [
if links-list/selected > 0 [
view ask-input-panel: [
ipt-fld: field 150x20 [probe main-list/(links-list/selected) unview] with [text: main-list/(links-list/selected)]
;Version2
; ipt-fld: field 150x20 [probe head append clear main-list/(links-list/selected) face/text unview ask-input-panel probe main-list;;;: ] with [text: copy main-list/(links-list/selected)]
]
]
]
btn-delete: button "Delete" [
if face/selected > 0 [
take main-list/(face/selected)
]
]
]
panel 600x40 [
the-site: text "none" 300x30
]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment