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

World: r3wp

[!REBOL3 GUI]

Graham
26-Aug-2010
[2837]
if no-op is served by none, then fine
BrianH
26-Aug-2010
[2838]
I misunderstood your suggestion, Robert. I thought you were talking 
about adding an IF command to the layout dialect, not to the code 
in the ().
Graham
26-Aug-2010
[2839x2]
Robert, this implicit none is not possible ...with Rebol
We discussed this recently
Robert
26-Aug-2010
[2841]
Brian, no that was the idea.
Graham
26-Aug-2010
[2842]
but since none can be used sometimes for part of the layout I thought 
it would be easier to parse if we used something else
BrianH
26-Aug-2010
[2843x2]
The IF command in the dialect would get rid of the COMPOSE and do 
this: view [button if (condition) button button]

That is what I meant by a Parse-like IF. Possibly not doable in the 
layout dialect, due to overhead.
Putting the IF in the paren and using COMPOSE would be something 
different.
Graham
26-Aug-2010
[2845x2]
I don't see why.... it just adds more clutter to the dialect
I'd vote against that idea
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
[2886]
That demo is outdated, but yes, there is a compose somewhere.