Rebol Talk Forum  |  REBOL Discussions  |  REBOL View  |  Topic: Slider parameters
Pages: [1] Print
Author Topic: Slider parameters  (Read 1041 times)
Gord
Newbie
*
Offline Offline

Posts: 18


View Profile
Slider parameters
« on: June 14, 2006, 05:35:49 PM »

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
Newbie
*
Offline Offline

Posts: 17


View Profile
Re: Slider parameters
« Reply #1 on: June 15, 2006, 05:27:32 AM »

Hi,

>> view layout [slider 200x20 with [data: 0.5]]

Logged
Gord
Newbie
*
Offline Offline

Posts: 18


View Profile
Re: Slider parameters
« Reply #2 on: June 15, 2006, 09:16:17 AM »

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
Jr. Member
**
Offline Offline

Posts: 50


View Profile
Re: Slider parameters
« Reply #3 on: June 15, 2006, 09:33:44 AM »

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
Newbie
*
Offline Offline

Posts: 18


View Profile
Re: Slider parameters
« Reply #4 on: June 15, 2006, 03:42:54 PM »

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
Jr. Member
**
Offline Offline

Posts: 66

Rebol veteran


View Profile WWW
Re: Slider parameters
« Reply #5 on: August 20, 2006, 01:44:35 PM »

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
DideC
Newbie
*
Offline Offline

Posts: 32


View Profile
Re: Slider parameters
« Reply #6 on: September 08, 2006, 11:31:07 AM »

For this kind of exploration, Anamonitor.r script from Romano Paolo Tenca is a must have !!

http://www.rebol.it/~romano/#sect1.1.
Logged
Pages: [1] Print 
Rebol Talk Forum  |  REBOL Discussions  |  REBOL View  |  Topic: Slider parameters
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 21, 2008, 03:59:23 PM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2295 Posts in 593 Topics by 3754 Members
Latest Member: MPShetfoept

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc