How to's
[1/18] from: ptretter::charter::net at: 23-Oct-2001 17:05
No How to's on the website for some time now. I'm curious to how to go beyond VID dialect
and work directly with the rest of /view capabilities. Also, I like the skins-demo that
someone has made and would like to get that kinda depth of instruction on make GUI's.
Any resources or help anyone can provide.
Paul Tretter
[2/18] from: carl:cybercraft at: 24-Oct-2001 11:21
On 24-Oct-01, Paul Tretter wrote:
> No How to's on the website for some time now. I'm curious to how to
> go beyond VID dialect and work directly with the rest of /view
> capabilities. Also, I like the skins-demo that someone has made and
> would like to get that kinda depth of instruction on make GUI's. Any
> resources or help anyone can provide.
This is an early Beta doc on View that actually does describe View, as
apposed it mainly VID...
http://www.rebolforces.com/archive/view099users.html
A lot of it still applies, I think.
> Paul Tretter
--
Carl Read
[3/18] from: etienne:alaurent:free at: 24-Oct-2001 0:26
Hi, Paul,
Paul Tretter wrote:
>No How to's on the website for some time now. I'm curious to how to go beyond VID dialect
and work directly with the rest of /view capabilities. Also, I like the skins-demo that
someone has made and would like to get that kinda depth of instruction on make GUI's.
Any resources or help anyone can provide.
>
>Paul Tretter
>
I will publish soon on my reb site resources to explain
-how to use my skin and the available themes
-how to customize and make news skins
--
regards.
---
Etienne
[4/18] from: ammonjohnson::yahoo at: 23-Oct-2001 22:41
Very interesting, thanks!!
Ammon
[5/18] from: media:quazart at: 24-Oct-2001 10:56
hi!
yes that documentation was all I had when I started using view! its a shame
that the virtual coordinate system isn't yet supported (or maybe was dropped
?)
anyways, to use the view system directly, its actually quite easy because of
the OO nature of it.
At the very least,
This is how I started to play with it:
rebol []
gui: make face []
view gui
you should have a brown box in a window... real simple...
now just replace any object within it with a local (non shared version) and
youre off to your own gui design!. Its mainly a question of understanding
what each face element does (basically self-descriptive). To get an idea of
what elements the face object contained, I just did "probe make face []"
and you should get a pretty
Also note that most of the face elements are described near the end of the
standard view guide (on RT's web site).
The how-to on handling events really gives you all you need to start
implementing your own custom buttons and gadgets/widgets/controls)
to edit any object in the default face, just remember that you must CLONE
the object... not just set its values. that is because all faces share the
same objects... so if you just set font, for example, it will set the font
for all faces...
so, if you followed my latest thread (on this list), you'll know that to
clone any object within the face, just do:
rebol []
gui: make face [
text: "my first custom face"
size: 300x50
offset: 100x100
font: make font [
size: 15
style: 'bold
]
]
view gui
and voila!
any other questions? just shoot 'em
cheers!
-Maxim
[6/18] from: ptretter:charter at: 24-Oct-2001 11:48
Yeah but the text doenst show up. Just a horizontal brown rectangle.
Paul Tretter
[7/18] from: ammonjohnson:y:ahoo at: 24-Oct-2001 20:24
----- Original Message -----
From: "Media" <[media--quazart--com]>
To: <[rebol-list--rebol--com]>
Sent: Wednesday, October 24, 2001 7:56 AM
Subject: [REBOL] Re: How to's
<Snip!>
> so, if you followed my latest thread (on this list), you'll know that to
> clone any object within the face, just do:
<<quoted lines omitted: 10>>
> view gui
> and voila!
hate to correct people, but this does what you want a little better:
gui: make face [
offset: 100x100
size: 300x50
pane: make face [
size: 300x50
text: "my first custom face"
edge: make edge [size: none]
font: make font [
size: 15
style: 'bold
]
]
]
view gui
Enjoy!!
Ammon
[8/18] from: ptretter:charter at: 24-Oct-2001 21:37
Thanks Ammon. Can you explain why the 300x50 is need in both make face's.
Paul Tretter
[9/18] from: ammonjohnson:y:ahoo at: 24-Oct-2001 22:46
Just to make both faces the same size. The default size of a face is, well
let's see:
>> probe make face []
make object! [
type: 'face
offset: 0x0
size: 100x100
span: none
pane: none
text: none
color: 142.128.110
image: none
effect: none
data: none
edge:
make object! [
color: 200.200.200
image: none
effect: none
size: 2x2
]
font:
make object! [
name: "arial"
style: none
size: 12
color: 0.0.0
offset: 2x2
space: 0x0
align: 'center
valign: 'center
shadow: none
]
para:
make object! [
origin: 2x2
margin: 2x2
indent: 0x0
tabs: 40
wrap?: true
scroll: 0x0
]
feel:
make object! [
redraw: none
detect: none
over: none
engage: none
]
saved-area: none
rate: none
show?: true
options: none
parent-face: none
old-offset: none
old-size: none
line-list: none
changes: none
face-flags: 0
action: none
]
looks like it is 100x100
. just remove the size part of the pane, see what happens. The best way to
learn REBOL is to code REBOL, so if you have a question, first try it, then
ask. ;) You may find that you actually understand it better. ;) (just a
suggestion in case you didn't try it first)
Enjoy!!
Ammon
[10/18] from: media:quazart at: 25-Oct-2001 9:16
----- Original Message -----
From: "Ammon Johnson" <[ammonjohnson--yahoo--com]>
To: <[rebol-list--rebol--com]>
Sent: Wednesday, October 24, 2001 11:24 PM
Subject: [REBOL] Re: How to's
> hate to correct people, but this does what you want a little better:
[...snip...]
its a good thing you did... I was in a hurry .... I didn't take time to
explicitely check my code... I'll be more carefull from now on (especially
with view/VID)...
Thanks Ammon and sorry Paul ...
-MAx
[11/18] from: ammonjohnson:y:ahoo at: 25-Oct-2001 18:01
Now, how do I get multiple faces in a face?
Thanks!!
Ammon
[12/18] from: ptretter:charter at: 25-Oct-2001 18:11
and you append them to pane? Not sure .... just shooting from the hip.
Paul Tretter
[13/18] from: ammonjohnson::yahoo at: 25-Oct-2001 18:36
no go on that.
Enjoy!!
Ammon
[14/18] from: arolls:idatam:au at: 26-Oct-2001 11:43
Yes. Type this into your console a line at a time
(watch line-wrap):
lay: layout [size 300x300]
view/new lay
append lay/pane make get-style 'button [size: 40x40 color: red]
show lay
append lay/pane make get-style 'button [offset: 200x100 size: 40x40 color:
green]
show lay
wait none
; and a bit of analysis...
probe length? lay/pane ; == 2
type? lay/pane/1 ; == object!
probe first lay/pane/1
lay/pane/1/type ; == face
lay/pane/1/style ; == FACE
Layout returns a face object.
Every face object has a pane attribute.
So that means every face can have sub-faces,
simply if they are added to the pane
(with APPEND, for instance).
You can imagine a face within a face within
a face, accessed like this:
lay/pane/3/pane/1
That's the first face in the third face in
the window.
Also, you can see get-style returns a face
from the vid style that you specify.
Quite handy for this type of thing.
Anton.
[15/18] from: ammonjohnson:ya:hoo at: 25-Oct-2001 21:14
Not directly as I would like to do. ;)
a: make face [
offset: 100x100
size: 300x50
;there should be a way to do something like:
pane: make face [
a: make face [
pane: make face [
text: "face_a's data"
font: make font [
size: 20
style: 'bold
]
]
]
b: make face [
pane: make face [
text: "face_b's data"
font: make font [
size: 20
style: 'bold
]
]
]
]
]
but this doesn't seem to work. I know you can append to a face that is
already made, but I want to make it with 'make 'face not with VID.
Thanks!!
Ammon
[16/18] from: arolls:idatam:au at: 26-Oct-2001 15:00
See comments below.
> -----Original Message-----
> From: Ammon Johnson [mailto:[ammonjohnson--yahoo--com]]
<<quoted lines omitted: 32>>
> Thanks!!
> Ammon
Well then you are going to have to do a lot of work,
adding the functionality to the face that you want.
For instance, actually showing the text, instead
of simply storing it in the text attribute as you
have done above. There has to be some code in there
that shows the text, otherwise it won't be shown.
I suggest you do this,
pane: make get-style 'label [...]
or whatever style (button, field, title, h1 etc..)
you want to use, or
first make a template face, like this:
template-face: make face [
size: 300x3000
offset: 300000x10000000000
etc etc... fonts, feels etc
]
then you can use it multiple times as above,
pane: make template-face [...]
Note that your code above "works". :)
It's just that it didn't do what you
expected it to!
Regards,
Anton.
[17/18] from: media:quazart at: 26-Oct-2001 7:25
hello,
yep, and their visual order or depth, depends on their order in the pane
list. The topmost face is the last face in the pane list...
If you want to program faces directly, I must really suggest the "HOW-TO
handle user interface events" guide... its crammed with a lot of information
about handling faces... the short scripts will really make you have fun...
especially the drag and drop ones.
-MAx
[18/18] from: media:quazart at: 26-Oct-2001 7:44
This mail was originaly intentended for the list, but for some reason my
mailer switched addresses and sent it directly to paul... !??
it explains why the first (or root) face does not show text by default, and
how to get it to display text from the root face.
note to paul: I've edited the examples and included another one, so you
might want to check the mail too.
---------------------------------
I'll continue where Ammon Left off...
The first Parent face, it seems, is the window description... and in that
context, the text attribute sets the window's title name !!!
run this example and notice the window's title ...
rebol []
gui: make face [
offset: 30x30
size: 200x30
text: "hey!"
]
view gui
if you want the text to be displayed normally, do the following...
rebol []
gui: make face [
offset: 30x30
size: 200x30
text: "hey!"
]
view/options gui 'no-title
you see, providing the 'no-title option , makes the text behave as normal.
but then you have to provide your own window titlebar... In the example I
sent to the list, notice that the window titlebar actually does drag the
window around...
:-)
if you want a standard system window border AND some text in the window
you'll have to do
like Ammon suggested... you need to supply it a face in the pane attribute
to display inside it...
-MAx
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted