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

World: r3wp

[View] discuss view related issues

[unknown: 10]
7-Mar-2006
[4424x3]
But i actualy like the felixibilty of 'layout function there are 
more ways to combine layout and make face ...intresting if your not 
like to reinvent /vid again ...
But actualy I wonder what the best way is to merge the use of Layout 
together ith 'make face.. Which is eating less overhead?
1) copying it all into a block and append
2) using make face layout inside a layout
3) using a layout with a make face with
??
ChristianE
7-Mar-2006
[4427]
Hi Rebolinth, there's a compromise between the low-level MAKE FACE 
and the LAYOUT [] approach for single faces called MAKE-FACE. It's 
basically a way to create single faces using the VID style name and 
a spec block for of specifying facets. Of course, MAKE FACE should 
have the lowest overhead, whereas - just as it says - LAYOUT is more 
for describing whole layouts. You may find MAKE-FACE slightly easier 
to create VID-compatble faces without getting into too much detail.
[unknown: 10]
7-Mar-2006
[4428x2]
Ah oke thanks for the explanation Christian.. Well Yes im using make 
face far more often in bigger programs/scripts where layout i use 
for the quick build of gui's..
Mmm i have asked this once befor but can someone explain to me when 
to use 'with  ?
Ammon
7-Mar-2006
[4430]
When you want to assign facets that you can't assign with the dialect 
or any time you find it easier to assign facets using with than using 
the dialect. ;-)
DideC
7-Mar-2006
[4431x2]
As ammon said :
	view layout [
		vh1 "The text" 
		vh1 with [text: "The text"]
	]
It's the same.
With is nice i.e. to set the background color of a text style (where 
colors used in the dialect are assigned to font) :
Henrik
7-Mar-2006
[4433]
and everything in that block is equivalent to working with an object 
block, so you can put in functions, etc. and all the variables are 
bound to the face
DideC
7-Mar-2006
[4434]
view layout [
	vh1 "Text"  blue
	vh1 "Text" with [color: blue]
]
Allen
7-Mar-2006
[4435]
Also the facet does not need to already exist in the style, it can 
be used to add your own custom ones e.g

 view layout [button "click" with [squid: 3] [alert join "My squid 
 is " face/squid] ]
Henrik
8-Mar-2006
[4436x3]
I'm testing a tab button group with BTN look. What do you think? 
http://www.hmkdesign.dk/tabview.png
the idea is for them to be toggles in a group, where only one of 
them can be selected. then there needs to be an easy method to perform 
some kind of action, such as selecting a mode or changing a layout 
in a pane
http://www.hmkdesign.dk/tabview2.png<-- how they would look selected
Anton
8-Mar-2006
[4439x2]
view layout [style group-tog tog [print [face/text]] with [related: 
'default] group-tog "Anton" group-tog "Henrik" group-tog "other unpeeled 
vegetables"]
(using the existing TOG style)
Henrik
8-Mar-2006
[4441x2]
anton, that's not the point of it
the point is to have a button group that actually looks like a button 
group
Anton
8-Mar-2006
[4443x2]
Oh I see.
view layout [style group-tog tog [remove find face/parent-face/pane 
face append face/parent-face/pane face print [face/text]] with

 [related: 'default] across space -5 group-tog "Anton" group-tog "Henrik" 
 group-tog "vegetables"]
Henrik
8-Mar-2006
[4445]
not good enough :-)
Anton
8-Mar-2006
[4446]
what's missing ?
Henrik
8-Mar-2006
[4447x3]
well, first of all it's easy to tell that it's just buttons layered 
over eachother
which makes it look crude and simple and unprofessional
I like the BTN style, but it's underused in VID for other applications, 
such as a tab button group
Anton
8-Mar-2006
[4450]
Change the space -5 to -2 and it looks better.
Henrik
8-Mar-2006
[4451]
second, I use pane switching a lot and it's a hassle to write your 
own routines for that all the time. it should be much simpler.
Anton
8-Mar-2006
[4452]
Just write a couple of functions, face-to-front and face-to-back 
and you can reuse them many times.
Henrik
8-Mar-2006
[4453x2]
that's not the point either...
The point is that it should be easy for everyone to do this. VID 
does not offer a standardized way to do this and you need to study 
how to switch layouts in panes, etc. It should work out of the box
Anton
8-Mar-2006
[4455]
Yes, that would be nice.
Henrik
8-Mar-2006
[4456x2]
then switching panes wouldn't be any more complex than:
view layout [tab-view 400 with [tabs: ["One" "Two" "Three"] panes: 
[layout1 layout2 layout3]
]
]
Anton
8-Mar-2006
[4458x3]
or this is quite feasible:  layout [tab-panel "One" "Two" "Three" 
panes [ layout1 layout2 layout3 ] ]
Default size of the tab-panel is calculated as the maximum of the 
three layout pane sizes. The three texts are available in face/texts 
so can be processed by init easily to create the three buttons. PANES 
would be a dialect word that simply sets face/panes, absolving the 
need for WITH in the most often used cases.
Note that rebgui has a tab-panel with a pretty simple spec, eg:
	tab-panel data ["one" layout1 "two" layout2 "three" layout3]
Henrik
8-Mar-2006
[4461]
good one
[unknown: 10]
8-Mar-2006
[4462x2]
..
Thanks folks!!
Pekr
10-Mar-2006
[4464]
someone wante graphing, dunno what group was it posted in - one interesting 
project using AGG and Python - Matplotlib - done using AGG - http://matplotlib.sourceforge.net/screenshots.html
Geomol
10-Mar-2006
[4465]
Looks nice, Pekr. Would it advocate REBOL making REBOL versions of 
those examples? The code should be less, of course. Else there wouldn't 
be much point in doing it. Maybe it's possible to make a Python -> 
REBOL converter (cross compiler)? I know zip of Python, so I can't 
say.
Pekr
10-Mar-2006
[4466x2]
I am not sure how universal the library is for graphing ... maybe 
if we want to do graphing, we should look for the best of kind library, 
then to port ... I am not sure if there is any advantage to matplotlib 
- it calls agg library, which we have inside of rebol already, so 
:-)
http://big.faceless.org/products/graph/examples.jsp?initial=browsershare
Geomol
10-Mar-2006
[4468x3]
I see. The examples are in matplotlib syntax. And matplotlib is a 
python 2D plotting library. So, as you say, it's probably better 
to find the best plotting library (or make a new one), than making 
an implementation of matplotlib. It could be the best one around 
though.
I think, we have a problem with the way, AGG is implemented. E.g. 
arguments to LINE are pairs (like 100x100). To be able to make a 
smooth curve using LINE, the arguments have to be decimals. Try the 
following code to see:
img: make image! reduce [370x290 white]
blk: [pen blue line-width 0.7 line]

for t 0.0 2.0 0.01 [s: sine 360 * t append blk as-pair round t * 
185 round 290 - (s * 145 + 145)]
draw img blk
view layout [image img]
Rebolek
10-Mar-2006
[4471]
Yes, decimal support for pair!  I hope this comes in R3 (or sooner? 
;)
Oldes
10-Mar-2006
[4472x2]
Flash is using twips, which seems to be enough.
And not just Flash - http://www.applecore99.com/api/api012.asp