Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Another newbie VID question

 [1/8] from: kpeters::mvinc::net at: 4-Oct-2003 12:33


Hi all ~ am wondering why my code below doesn't work toggle_start: toggle 60 "Start" [ flash "we get here" toggle_start/text: "Stop" show toggle_start ] What do I need to make a toggle switch between "Start" and "Stop" every time I press it? Where do I need to look to find which refinements a toggle has? Does it have a 'down' or 'pressed' ? TIA, Kai

 [2/8] from: ingo:2b1 at: 4-Oct-2003 21:55


Hi Kai, Kai Peters wrote:
> Hi all ~ > am wondering why my code below doesn't work
<<quoted lines omitted: 6>>
> What do I need to make a toggle switch between "Start" and "Stop" every time I press it? > Where do I need to look to find which refinements a toggle has? Does it have a 'down' or 'pressed' ?
This is the answer ... REBOL[] view layout [toggle_start: toggle 60 "Start" [ ;help face face/text: pick ["Stop" "Start"] face/data show face ] ] And here comes the explanation ... Those vid action blocks are turned into functions with the face itself as an argument, named face (be careful, sometimes it's only 'f, IIRC). Now, the commented out "help face" gave me a quick look at what the face contains, among a lot of other things, I found that there's face/data, a boolean value, so I decided "that's it". your toggle_start/text: part was already ok (I just decided to use the word 'face, because it's shorter, and dag'n'droppable ;-) , now we just have to toggle the text depending on face/data (this feature of 'pick has been the source of many long and lively discussions, but it makes for nice short code). I hope that helps, Ingo

 [3/8] from: kpeters:mvinc at: 4-Oct-2003 13:33


Thanks for your very elaborate help, Ingo. It all makes good sense, yet there still is a problem: When I cut & paste your code to my console, the toggle caption does not change on my machine?? Any ideas? Thanks, Kai

 [4/8] from: SunandaDH:aol at: 4-Oct-2003 17:26


Kai:
> It all makes good sense, yet there still is a problem: When I cut & paste > your code to my console, the toggle caption does not change on my machine??
I get confused between setting face/text and face/texts too. Try this: REBOL[] unview/all view layout [toggle_start: toggle 60 "Start" [ ;help face face/texts/1: pick ["Stop" "Start"] face/data show face ] ] Sunanda.

 [5/8] from: greggirwin:mindspring at: 4-Oct-2003 15:51


Hi Kai, KP> What do I need to make a toggle switch between "Start" and "Stop" KP> every time I press it? How about: view layout [ toggle_start: toggle 60 "Start" "Stop" ] -- Gregg

 [6/8] from: ingo:2b1 at: 5-Oct-2003 0:01


Kai Peters wrote:
> Thanks for your very elaborate help, Ingo. > > It all makes good sense, yet there still is a problem: When I cut & paste your code to my console, the toggle caption does not change on my machine?? > > Any ideas?
After some checks, yes, this has changed between the last official version (1.2.1) and my beta (1.2.8) use "texts/1:!, like Sunanda said. Ingo

 [7/8] from: g:santilli:tiscalinet:it at: 6-Oct-2003 10:11


Hi Ingo, On Saturday, October 4, 2003, 9:55:53 PM, you wrote: IH> This is the answer ... Actually, he just needs: Toggle 60 "Start" "Stop" Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/

 [8/8] from: ingo:2b1 at: 6-Oct-2003 22:41


Hi Gabreiele, Gabriele Santilli wrote:
> Hi Ingo, > > On Saturday, October 4, 2003, 9:55:53 PM, you wrote: > > IH> This is the answer ...
Shoulda have said, this _one_ possible answer ...
> Actually, he just needs: > > Toggle 60 "Start" "Stop"
Which only goes to show, that there's _always_ an easier way in Rebol ... Weeell, I guess that's what you get for wanting to show off ;-) Kind regards, Ingo

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted