r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL3 GUI]

BrianH
26-Aug-2010
[2847]
Like I said, too much overhead. But that is what I thought Robert 
was suggesting (until he demonstrated otherwise).
Graham
26-Aug-2010
[2848]
unless we start adding conditions to the whole vid dialect ...
BrianH
26-Aug-2010
[2849x2]
That would be the suggestion, yes.
I don't like it though. It you add conditions to the dialect it will 
make it too easy to put semantic code into a layout that is just 
supposed to be for display.
Graham
26-Aug-2010
[2851x2]
In fact why don't we consider using parens to switch out of the layout 
dialect instead of making us use compose'deep
nah... too complicated
BrianH
26-Aug-2010
[2853]
Again, there should be no DO dialect code in the layout dialect. 
Unless actions are called, the layout dialect should be declarative, 
not procedural. That is what makes it safe.
Graham
26-Aug-2010
[2854]
we already have a do in the vid dialect
BrianH
26-Aug-2010
[2855]
It's a DO action. The code in its argument only gets called as a 
result of the action, not at layout time.
Graham
26-Aug-2010
[2856]
view layout [
	button 
	do [ this at layout time [
]
BrianH
26-Aug-2010
[2857x3]
That code doesn't make sense, even with the missing ]. Are you thinking 
VID or the R3 GUI?
Oh, you meant do [ this at layout time ]. It doesn't do it at layout 
time, only when the button is clicked.
The DO [ ... ] is an action modifier to the button declaration.
Graham
26-Aug-2010
[2860]
Brian, I take it you have never done any Vid work ?
BrianH
26-Aug-2010
[2861x2]
Very little. Most of my VID knowledge comes from DevBase 2 and the 
VID resize project. Aside from that, very little GUI work in REBOL, 
just (many) other languages. Most of my REBOL code has a web or batch 
UI, or no UI at all.
I had to learn a lot of VID's internals to do the resize project. 
But I don't really need to make GUIs much.
Graham
26-Aug-2010
[2863x2]
the dialect word 'do switches the layout parser to the do dialect
for VID1, 2, and 3 ( I think )
BrianH
26-Aug-2010
[2865]
Likely not in the R3 GUI. We did a lot of work to separate layout 
and behavior.
Graham
26-Aug-2010
[2866]
likely you mean
BrianH
26-Aug-2010
[2867x2]
Not unless it has been changed recently. According to the design 
of the R3 GUI, DO doesn't switch the layout dialect into DO dialect 
mode, it declares an action for the button (in your example) to perform 
when clicked.
The code performed by that action is evaluated by the DO dialect, 
but it is evaluated at runtime in response to the action being triggered, 
not at layout time.
Graham
26-Aug-2010
[2869]
My example is for R2 ...  there is no 'layout word for R3
BrianH
26-Aug-2010
[2870]
Ah, wrong group then. The layout dialect is implicit in R3's VIEW 
function now, not implemented by a separate LAYOUT function.
Graham
26-Aug-2010
[2871x2]
What does this do ?

view layout [ button "test Brian" do [print now ]]
As for R3 is supposed to do .. has anyone read the specs??
BrianH
26-Aug-2010
[2873]
I helped design the specs (mostly in an advisory capacity).
Graham
26-Aug-2010
[2874]
Does this still apply to the WIP ? http://www.rebol.com/r3/docs/gui/gui.html
BrianH
26-Aug-2010
[2875]
Get rid of the call to LAYOUT, and it will create and show a layout 
with a button titled "test Brian". When that button is clicked, the 
button's action will be triggered, and the result of NOW will be 
printed to the console.
Graham
26-Aug-2010
[2876]
What does it do in VID2 ?
BrianH
26-Aug-2010
[2877x2]
There are some changes since the docs there were written, but the 
overall design model is the same. At the moment, groups and panels 
work differently than those docs.
In VID2, it seems to print now before the button is clicked.
Graham
26-Aug-2010
[2879x2]
exactly
as I said, the 'do word switches to the 'do dialect
BrianH
26-Aug-2010
[2881]
Well, the R3 GUI has very little in common with VID2. It is designed 
based on completely different principles.
Pekr
26-Aug-2010
[2882]
Graham - in R3 VID there is simply a 'do keyword, preceeding the 
action block, nothing more ...
Graham
26-Aug-2010
[2883x3]
I see this 

ts: text-box (form now)
in the sources to the R3vid demo
so either there is a compose/deep somewhere .. or there is a switch 
to the do dialect occuring
BrianH
26-Aug-2010
[2886x2]
That demo is outdated, but yes, there is a compose somewhere.
The reason we never refer to the R3 GUI as VID (for the last 2 years) 
is because we don't want to confuse people. The R3 GUI has nothing 
to do with VID.
Henrik
26-Aug-2010
[2888]
there are several trigger styles that do various things throughout 
the dialect. they shouldn't be confused with reactors.
BrianH
26-Aug-2010
[2889x2]
The parens don't affect the layout, just the data that the layout 
contains. No control flow.
Yes, Henrik, you are more familiar with the recent work on the R3 
GUI, please explain :)
Graham
26-Aug-2010
[2891x2]
anyway, Vid has the ability to switch dialects at gui layout ... 
but as r3gui .. i don't know...
whether it has, or whether it should be put in ... I do a lot
BrianH
26-Aug-2010
[2893x3]
You won't in the new one. It is designed to make such things unnecessary.
Thanks for the docs reminder. The explanation of DO is here:
http://www.rebol.com/r3/docs/gui/reactors.html
Henrik
26-Aug-2010
[2896]
Actually there are several changes by Bolek and Cyphre, that I've 
not yet studied, but much of the work that was handled by LAYOUT 
before is now relegated to PANEL and GROUP, which is why we talk 
so much about them and not a central LAYOUT function. They call various 
subfunctions that specifically focus on creating faces and laying 
them out and resizing them.


So the styles themselves are capable of custom layouts and resizing 
mechanisms and also mechanisms such as face init and triggers. So 
that means you are no longer a "slave" of the LAYOUT function.

That's also why:


1. I was talking a while ago about that you can build a style that 
emulates VID, complete with a dialect, or replace the layout mechanism 
with your own, by rewriting PANEL or GROUP or adding new panel styles.

2. That whenever you want to do a new thing, you should make it as 
a style. That's where you start.