if
keyword, for example. I got examples for that today here at gitter, btw.
What is the right way to refresh text-list face?
mylist: ["one" "two" "three"]
view [text-list data mylist [
change at face/data face/selected "hi there"
]] ; text-list is not updated when clicked
print mylist ; though underlying list is
It does not work better if I add show face
But strangely it works with face/data: face/data
:
mylist: ["one" "two" "three"]
view [text-list data mylist [
change at face/data face/selected "hi there"
face/data: face/data
]] ; now text-list is updated when clicked
show
though.
maliste: ["un" "deux" "trois"]
view lay: layout [text-list data maliste [n: face/selected
request-text/default face/data/:n print face/data show face
]]
I have those packages installed on archlinux
core/lzo 2.10-1 [installed]
core/openssl 1.1.1-1 [installed]
core/openssl-1.0 1.0.2.p-1 [installed]
extra/flac 1.3.2-1 [installed]
extra/wavpack 5.1.0-2 [installed]
community/mbedtls 2.13.0-1 [installed]
multilib/lib32-openssl 1:1.1.1-1 [installed]
core/curl 7.61.1-1 [installed]
community/gambas3-gb-net-curl 3.11.3-3 (gambas3) [installed]
community/libcurl-compat 7.61.1-1 [installed]
community/libcurl-gnutls 7.61.1-1 [installed]
multilib/lib32-curl 7.61.1-1 [installed]
multilib/lib32-libcurl-gnutls 7.61.1-1 [installed]
However, i keep getting segfaults whenever i try reading a webpage from red repl?
reverse face/data
). They will propagate a change only if you modify one of its facets directly, like face/data: ...
.
mytext
into a file when I'm changing into another tab in tab-panel
Red [needs: view]
words-as-string: read %words.txt
view [
Title "Tab-panels"
tab-panel 200x100 [
"Tab 1 " [text "First panel"]
"Tab 2 " [mytext: area 440x215 words-as-string]
]
]
on-select
event also fires on every character typed inside text area but in addition to that also on each mouse click inside text area.mytext
into a file when user will swap to another tab but I want to avoid saving on each keystroke. Red [needs: view]
words-as-string: read %words.txt
view [
Title "Tab-panels"
tab-panel 200x100 on-select [print ["swapped to tab " event/picked]] [
"Tab 1 " [text "First panel"]
"Tab 2 " [mytext: area 440x215 words-as-string]
]
]
event/picked
and save to file depending on that value, something like this:save-my-text: func [a] [
; just print `text`
probe a/text
]
view [
size 400x400
Title "Tab-panels"
tab-panel [
"Tab 1 " [text "First panel" area]
"Tab 2 " [mytext: area 440x215 return area]
] on-change [
if all [
event/picked <> 0 ; 0 = selection of non-tab (as fair I can see - no proof!)
event/picked <> 2 ; 2 is your tab with `mytext` you don't want to save it
][
save-my-text mytext probe event/picked
]
]
]
view [
Title "Tab-panels"
tab-panel 200x100 on-change [print ["face/selected:" face/selected "event/picked:" event/picked]] [
"Tab 1 " [text "First panel"]
"Tab 2 " [mytext: area 440x215 "Lorem ipsum dolor sit amet, consectetur adipiscing elit." on-change ['done]]
]
]
view [
Title "Tab-panels"
tp: tab-panel 200x100 [
"Tab 1 " [text "First panel"]
"Tab 2 " [mytext: area 440x215 words-as-string]
] on-change [
if event/face = tp [
print ["real tab event" "swapped to tab " event/picked]
]
]
]
on-select
issue, we can file it as a regression. I think there have been some changes there, with panel dragging being fixed up.
on-change
that is added for area overrides the top level one? The only issue is that it would mean that i would need to add on-select ['done]
to all of the faces that are children of tab-panel.
@GiuseppeChillemi
is /:ind the same of /(ind) ?
Not exactly. ind
in the in the :ind
is a word - it is a final value, that you want to look for in the series. (...)
is a paren!
- you can compute "final value" here. Examples:
arr: [a 11 "b" 22]
ind: 'a
arr/:ind
arr/(ind)
arr/('a)
arr/a
ind: "b"
arr/:ind
arr/(ind)
arr/(back tail "cb")
>> probe arr/:ind
** Script Error: Invalid path value: a
** Where: halt-view
** Near: probe arr/:ind
>> probe arr/(ind)
11
== 11