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
<word>/<get-word!>
but it can do it with <word!>/<paren!>
.
@9214
1) Both languages can get value based on a number: arr/1
.
2) Both languages can get value based on a word: arr/info
.
3) Both languages can get value using paren!
based on a number/word: arr/(0 + 1)
, arr/('info)
.
4) Only the Red can get value based on both a number and a word using get-word!
: arr/:w
where w
is a word or a number.
So based on 3 paren!
can acts as numeric/word selector (value from a paren!
).
Based on 4 the Rebol has the "problem" with getting value from a get-word!
.
In my opinion get-word!
is in the centre of the problem.
get-word!
evaluates correctly, but Rebol fails to interpret lit-word!
as a valid selector. Red in this case correctly coerces all any-word!
values. So, no, problem is not with get-word!
, problem is with lit-word!
(or any other possible any-word!
value) to which it evaluates. Same holds for paren!
expressions - they are not selectors, but the result of their evaluation is.
@9214
** Script Error: Invalid path value: a
** Near: probe arr/:ind
Yes, it seems that get-word!
evaluates correctly but it seems that we cannot use word!
as path's value. "invalid path value: a" - I assume that a
is a word!
here... but it can be lit-word!
as well. In my opinion that error message is not as clean as you said.
Putting that aside, this answer fully explain differences. Thank you for this.