|
Pages: [1]
|
 |
|
Author
|
Topic: Slider parameters (Read 1043 times)
|
|
Gord
|
It seems that View - Slider has default values between 0.0 and 1.0, which is fine. How do you dispaly a Slider at a pre-determined value?
Ex: View layout [Slider 200x20]
will diplay a 'Slider' but the starting point is 0 (zero) and I want the starting point equal to a variable from elsewhere in the program; ie: 0.5 or halfway across
|
|
|
|
|
Logged
|
|
|
|
|
rebolek
|
Hi,
>> view layout [slider 200x20 with [data: 0.5]]
|
|
|
|
|
Logged
|
|
|
|
|
Gord
|
Thanks Rebolek!
Now how did you find that out? I've tried a few 'help' things to try and 'reveal' the system command words for View but without success.
|
|
|
|
|
Logged
|
|
|
|
|
henrikmk
|
Face/data usually refers to a basic property of af face, in this case the slider position. Unfortunately the VID docs are very inadequate.
Useful tools are to study the face, by using ?.
>> layout [s: slider]
>> ? s
will give you the face attributes. To set the face attributes before the face is shown, use
layout [s: slider with [<attribute>: <value>]]
You can set any face attribute, include new ones, create functions that are only bound to that face, etc. It's just an object and behaves like one.
|
|
|
|
|
Logged
|
|
|
|
|
Gord
|
Thanks Henrikmk; That is what I wanted to know - how to find this stuff out. I was able to discover and set a couple other attributes for a GUI I was working on.
Gord
|
|
|
|
|
Logged
|
|
|
|
|
Anton
|
Yes, I quite often set a variable to a face in a layout spec and then examine it in the console.
Another technique I'm often using at the moment is to see what the default style face objects have, eg. to find the default field size:
>> svv/vid-styles/field/size == 200x24
where svv = system/view/vid -- a handy shortcut. Or to see what FIELD does to initialize itself:
>> print mold svv/vid-styles/field/init [ if color [colors: reduce [color colors/2]] if not string? text [text: either text [form text] [copy ""]] if not flag-face? self hide [data: text] ]
|
|
|
|
|
Logged
|
|
|
|
|
|
|
|
Pages: [1]
|
|
|
 |
News: 01-09-08 Alpha version of REBOL 3 has been released!
2295 Posts in 593 Topics by 3759 Members
Latest Member: blulmogSom
|