Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: Greying out buttons
Pages: [1] Print
Author Topic: Greying out buttons  (Read 403 times)
KenSingleton
Newbie
*
Offline Offline

Posts: 8


View Profile
Greying out buttons
« on: April 26, 2007, 12:30:37 PM »

In traditional GUI environments there is usually a simple way to grey out a button when it is not meant to be used and an equally simple way to reveal it so that it can be used. How would one do such a thing in VID?

I know that you can show and hide buttons, but is there a way to hide buttons at the first viewing of a face and then reveal only the buttons as needed through the show word in a button's action block?

The reason I need this is to create a step by step process where the next step can only work when the previous step has been completed. Only at that point should the next button be revealed.

Regards, Ken.
Logged
Sunanda
Full Member
***
Offline Offline

Posts: 110


View Profile
Re: Greying out buttons
« Reply #1 on: April 26, 2007, 12:36:31 PM »

Try this:
Code:
  view/new layout [a: button "hello"]
  hide/show a
  do-events

The view/new displays the layout but allows the script to continue.
The hide adjusts the layout to how you want it (in this case, hiding a button)
The do-events drops you into the GUI event loop in the same way that the usual view would do.
Logged
KenSingleton
Newbie
*
Offline Offline

Posts: 8


View Profile
Re: Greying out buttons
« Reply #2 on: April 26, 2007, 12:45:36 PM »

Wow! Fastest reply ever, and it works! Thanks, Sunanda, you're a star.
Logged
Anton
Jr. Member
**
Offline Offline

Posts: 66

Rebol veteran


View Profile WWW
Re: Greying out buttons
« Reply #3 on: April 27, 2007, 01:35:49 AM »

If you want to keep it in spec:

Code:
view layout [button with [show?: false]]
Logged
Pages: [1] Print 
Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: Greying out buttons
Jump to:  

  
Quick Search...

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

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2295 Posts in 593 Topics by 3766 Members
Latest Member: SpombSibpap

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

RT design by Defiant Pc