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

World: r3wp

[I'm new] Ask any question, and a helpful person will try to answer.

Maxim
16-May-2009
[2660x7]
there is another VID base doc, simpler, might help you start.

http://www.rebol.com/docs/view-guide.html

honestly, I literaly learned all of the VID tricks my doing this:
probe face
where face is any face you have setup in a layout.
ex: 

layout [
	my-btn: btn "ok"
]

probe my-btn
I still use this quite often.
I'd say learning to build new styles with the stylesheet system is 
the first big boost in productivity.  this will inevitably leed to 
you wondering how you can change this or that, and then by probing 
the face and looking at its code, you see that some values are being 
reset in the event handler... which is quite annoying.


the seconf big boost is to try and understand the event system.  
the view reference link that henrik gave you earlier is the best 
resource online.
and rebol, as a language is extremely easy to search on the net... 
you start any search on google with the word REBOL  and you'll end 
up with mailing list chats, altme pages, scripts on rebol.org, etc.
mhinson
16-May-2009
[2667]
It seems too complex to get started... the examples seem to jump 
from childishly simple, right to very hard, with no middle ground.
Maxim
16-May-2009
[2668x2]
did you look at the view guide?
(not the reference)
mhinson
16-May-2009
[2670]
which one was that?  I am confused by so many sources of information.
Maxim
16-May-2009
[2671x2]
http://www.rebol.com/docs/view-guide.html
this is simple, with gfx and goes over everything, just to get you 
going... Its the only docs we had for years!
Henrik
16-May-2009
[2673]
slider is sensitive to its size. if you give it a horizontal size 
bigger than vertical, it goes horizontal.
mhinson
16-May-2009
[2674x2]
It does look well written, I remeber now I started reading this & 
one of the first questions I had was about Slider & since there is 
hardly any mention of it I started looking for other sources that 
I thought might be more complete....  Since you have recomended it 
I will read it from end to end & see if I am just too stupid to learn 
:-)
Henrik. thanks for that, I chalange you to find it documented anywhere.... 
 (apart from the code its self)
Henrik
16-May-2009
[2676x2]
mhinson, I looked the hard way: through the source code for slider. 
:-)
This is of course not the way it's meant to be. Unfortunately VID 
development stopped a long time ago, but there are alternatives, 
like RebGUI and GLayout. All energy is now focused on bringing an 
incredibly improved and highly well documented VID to REBOL 3.
mhinson
16-May-2009
[2678]
I need to learn that trick in time as I think it is the only way 
to find out a lot of things. It can feel frustrating to know what 
is likely to be possiable, but to spend hours trying to work out 
the very first step.
Henrik
16-May-2009
[2679]
I spent a couple of years figuring out the FEEL concept, so you're 
not alone.
Brock
16-May-2009
[2680]
Yes, one thing we really need in the Rebol world is for someone to 
site down and create a full example set of what is possible with 
what we have.  I too am pretty weak with VID and View, but it's been 
something I think about every time I see a new Javascript library 
with lots of examples available.
mhinson
16-May-2009
[2681]
Documetation is very hard, because the people who need it most dont 
know enough to write it, & the people who can write it dont need 
it so must struggle to know what is going to be most helpfull.
Brock
16-May-2009
[2682]
mhinson.  To give you some perspective.  Carl never intended VID 
to be the end-all-be-all graphic system.  He said he built it over 
a couple of days and expected someone to use that as motivation to 
either build their own or enhance what was started.  Ashley Trutter 
created RebGUI, which is more complete that VID.  He also received 
awards at Rebol DevCon's for his efforts.
mhinson
17-May-2009
[2683]
Hi, I have read the recomended http://www.rebol.com/docs/view-guide.html
 so I have an idea of some of the stuff to expect from VID, but as 
soon as I try to do anything not explicity shown in that document 
I find my understanding is really very thin & flimsy. This is an 
example of me failing to get the results I expected. Perhaps there 
is just one basic step I have omitted that is messing everything 
else up?  Any tips would be welcome & appreciated, but dont miss 
a Sunday snooze on my account please :-)
mmm: layout [

 space 0x0         ;; thought this would make items touch each other. 
 dosnt work?
	my-sldr1: slider 300x10 [print "1 clicked"]  ; ok
	my-sldr2: slider 300x10 [print "2 clicked"]  ; ok

 space 1x1         ;; thought this would make items 1 pixel further 
 apart. dosnt work
	my-sldr3: slider 300x10 [print "3 clicked"]  ; ok
	name1: text "Inital text" 100x30             ; ok

 button "Change text" [name1/text: "Text now changed"  show name1] 
  ; ok

 button "Cente" [my-sldr2/size: 100x40 show mmm]  ;; this breaks, 
 but does make a change

 my-sldr1/step: 25             ;; imagined this did soemthing, but 
 cant see or guess what, seems to break the lat button

    my-sldr3/edge/color: blue     ;; this works but also applies its 
    self to the last button
	my-sldr3/dragger/color: red   ;; doesnt seem to work 
]

view mmm   ;; ok

? mmm      ;; shows components of object, reference for what they 
all mean is not available
? my-sldr1 ;; again guessing what they do is frustrating 

probe my-sldr1 ;; I know what the parts are but cant guess which 
ones work or what they do.
Henrik
17-May-2009
[2684x2]
With ?, you can only see one face at a time. The subfaces are stored 
in PANE. If you try:

probe mmm


watch the console scrolling a lot of code. That's the entire face 
tree.
The space 0x0 and 1x1 should work. Otherwise try space 0 and space 
1.
mhinson
17-May-2009
[2686]
it seems that you just saying they work, causes them to work... well 
the space is applied to the following item with reference to the 
one after that, not the space between the items where the word "space" 
is put....  After moving the position of the space this also cause 
the dragger to turn red too.    The probe mmm, are the 14,000 lines 
all of VID?
Henrik
17-May-2009
[2687x2]
space works on elements from when SPACE is stated and then the space 
will stay that way for the rest of the layout description or until 
it's changed. If you want specific spacing between elements, PAD 
is used.
probe mmm is the face tree, generated by VID, when using the LAYOUT 
function. It's not VID itself.
mhinson
17-May-2009
[2689]
Any idea why my example does so many screwy things?
Henrik
17-May-2009
[2690]
Sorry, I didn't notice, but you can't put paths in the layout block. 
Those last three lines of code should be outside the layout block.
mhinson
17-May-2009
[2691]
I had assumed all the layout refinements would be in there.   would 
this not be appropiate either?
	button "Cente" [my-sldr2/size: 100x40 show mmm]
Henrik
17-May-2009
[2692x2]
yes, that's fine, because that is an action of the button. The action 
is a function with 'face and 'value passed and is regular REBOL code.
But after that block, those paths break the layout, because you are 
back in the dialect domain.
mhinson
17-May-2009
[2694]
ok, i moved the changes to outside the layout block, but this dosnt 
work
	my-sldr3/dragger/color: red 

and this button dosnt redisplay the layout, it just overwrites the 
existing stuff.

 button "Cente" [my-sldr2/size: 100x40 show mmm]  ;; this breaks, 
 but does make a change

I am guessing that the display is not dynamic in the way I am expecting?
Henrik
17-May-2009
[2695]
When altering a facet of a face, it must be shown before the change 
can be seen.


This is a little complicated to explain: You have chosen to resize 
a slider, which is a face with subfaces. Thus if you resize a slider, 
you need to access its internal resize function, in order for it 
to properly resize the knob as well. if you alter the size of a face 
like above, you are literally only altering the size of the outer 
face of the slider. VID does not know what you are trying to do there.


BUT: Given it's incompleteness, SLIDER does not have an internal 
resize function. :-) This is not intentional, and you've stepped 
into the mud here. This is one of the most lacking parts of VID, 
in that when the layout is set up, it can be laborious to change. 
Fortunately there are unofficial solutions to that, so I suggest 
you don't bother with this and try something else.

Alternatively, try working a bit with RebGUI.
Maxim
17-May-2009
[2696]
one thing about the space, is that it needs to be specified BEFORE 
the next face, cause the space is calculated when it encounters a 
face, so if you use space after a face, the space accorded to the 
previous face has already been allocated.
mhinson
17-May-2009
[2697]
Resizing a slider is on reflection a fairly odd thing to want to 
do, and I was only doing it because "size" was the first thing I 
came across that sounded straight forward to do to test my understanding. 


On reflection, I think that it is unlikely for me to grasp much of 
what can be done with VID until it gets a makeover with the documentation. 
Perhaps I could contribute to the documentation on the Wiki by listing 
all the items that can be changed for slider & then discovering what 
each one does by trial & error.  would this be helpfull, or just 
cause another job for someone to delete it in favor of a master plan?
Henrik
17-May-2009
[2698x2]
At this point, I'm not sure it's worth documenting more. Perhaps 
2-3 years ago. 90% of work is currently directed toward VID for REBOL 
3 which is an entirely and far superior GUI system.
entirely = entirely different
mhinson
17-May-2009
[2700]
could I use R3 for playing with graphics yet? Is the documentation 
public?
Henrik
17-May-2009
[2701]
it has a few bugs, but you can play with it. docs are public.
mhinson
17-May-2009
[2702]
I looked at RebGUI and had a play with the demos. Afraid RebGUI looks 
as if it would be even more complicated. I may as well start learning 
about R3 graphics as by the time I have learnt R3 I expect  R4 wll 
be in development.  :-)
Henrik
17-May-2009
[2703x2]
R3 is still alpha software and the layout engine is going to be changed, 
since it's not laying out faces correctly many times, but the dialect 
is not likely to change. There are also only Carl's styles available 
in strong colors, and they are not so good looking.
but the underpinnings with GOBs, text and DRAW is fairly stable. 
it's fun to play with.
Maxim
17-May-2009
[2705x3]
there is also glayout, which works very out of the box and is built 
over VID.  the api isn't document though.


you can look at the glayout-demo app on rebol.org so have an idea 
of all it can do.  it layout engine is very complete, and seems like 
the basis for how R3 was implemented... they use the same philosophy.


glayout handles ALL resizing automatically, and it even includes 
real scrollpanes, which react to content, as it changes (scrollbars 
resize automatically, for example)
there are just a few pointers to know if you want to create completely 
new styles, its not very complicated.
I am using it for my ssh-tool, which will be online within a few 
days (once I get my web server fully operational).
mhinson
17-May-2009
[2708]
how do I get to the r3 console please?  I just get a dos type box 
with a >> prompt.
Maxim
17-May-2009
[2709]
r3 lives within the OS console