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.

Gregg
22-Jun-2008
[1454]
Why is it inconsistent?

>> do [1]
== 1
>> do 1
== 1
Anton
22-Jun-2008
[1455]
Well, you just pointed out that DO is inconsistent as well. As to 
how harmfully unexpected that is is another question. It obviously 
confused Will. Such things can be a problem, because there can be 
a loss of information. You get the same output from two different 
inputs, which can't be reversed.
Will
22-Jun-2008
[1456]
Thanks Anton 8-) my point was just that for a beginner in the cases 
block there is value and block to execute pairs, so it sounded logic 
 that adding /default I would also need to append a block do be "done" 
I was surprised that case for default accept any and not a block 
, not a problem for me but we needed some minutes to understand that.
Gregg
22-Jun-2008
[1457]
It's not inconsistent. It's just the way it is. DO evaluates all 
the values in the block and returns the result of the last evaluation.
PeterWood
23-Jun-2008
[1458]
From my point of view If anything is inconsistent it seems to be 
when Rebol evalutes blocks.


If you enter a block in the console, it doesn't get evaluated but 
other values do.

>> [1]

== [1]

>> a: 
1
== 1

The block [1] was not evaluted, the word a was.


Though without this possible inconsistency using blocks would be 
a real pain.
Henrik
23-Jun-2008
[1459]
not only a pain, it would ruin the foundations of how rebol works 
:-)
Anton
23-Jun-2008
[1460]
(The block *is* evaluated.  Its contents are not.)
Izkata
24-Jun-2008
[1461]
>> do [[1]]
== [1]


The console does the outermost 'do, resulting in your first example, 
Peter
PeterWood
25-Jun-2008
[1462]
Thanks Anton and Izkata. It looks as though the explanation of Will's 
"inconsistency" is that switch evaluates the content of the block 
not the block.
DavidR
15-Nov-2008
[1463]
Hello all I'm new to AltmE would like to ask some questions later 
on nice to meet you all
Henrik
15-Nov-2008
[1464]
welcome! .-)
Sunanda
15-Nov-2008
[1465]
Welcome -- glad you finally made it after knocking in the doors (via 
REBOLtalk) for so long!
Vladimir
15-Nov-2008
[1466]
Welcome!
Gregg
15-Nov-2008
[1467]
Welcome David, ask away.

Happy REBOLing!
DavidR
15-Nov-2008
[1468]
Thanks guys
DavidR
16-Nov-2008
[1469x2]
here is some code I have been working on (commented) but the start 
button is busted I want it to call the area box with the discalimer 
details & 2No further buttons, one to quit "Disagree" which is a 
quit command & "Agree" I want to CLS the page & start a fresh copy 
of the XP simulated window, the start button would then open a different 
menu here is the code (its not very elegant I'm afraid):

  rebol [Title: "SOS-XP"]
  view layout [

  ;makes a gui window 768x576 with a simulated desktop (xP blue) with 
  ibevelled border.
  image center %DT.jpg 768x576 ibevel pewter 6x6

  ;creates an area text box color red with disclaimer message & 2No 
  buttons "agree" & "disagree"

  ; which hopefully will be situated in the XP destop when the start 
  button is clicked.
  disclaim: [at 200x300

  area wrap font-color white {You use this program & batch files entirely 
  at your own risk,
due to the myriad of hardware/software configurations I cannot
without any certainty claim that you will not damage your system!
Always Always Always make a full system backup of your partition
before attempting to use SOS-XP & that you have tested the back

up so your are positive in your own mind you can make a recovery!} 
red bold 
  at 240x410 button "Agree"
  at 450x410 button "Disagree"]
  ; this is the simulated XP start button
  button gray 50x30 "START" [disclaim]

  ; this is a small vertical button to make the xP start button look 
  more realistic.
  at 75x605 button gray 3x30

  ; this is a digital clock to simulate the destop clock bottom right 
  on screen.

  at 750x610 text "00:00" rate 1 black ;effect [gradient 0x1 0.0.150 
  0.0.50]
  feel [engage: func [face act] [face/text: now/time  show face]]

]755x650  rebol [Title: "SOS-XP"]
  view layout [

  ;makes a gui window 768x576 with a simulated desktop (xP blue) with 
  ibevelled border.
  image center %DT.jpg 768x576 ibevel pewter 6x6

  ;creates an area text box color red with disclaimer message & 2No 
  buttons "agree" & "disagree"

  ; which hopefully will be situated in the XP destop when the start 
  button is clicked.
  disclaim: [at 200x300

  area wrap font-color white {You use this program & batch files entirely 
  at your own risk,
due to the myriad of hardware/software configurations I cannot
without any certainty claim that you will not damage your system!
Always Always Always make a full system backup of your partition
before attempting to use SOS-XP & that you have tested the back

up so your are positive in your own mind you can make a recovery!} 
red bold 
  at 240x410 button "Agree"
  at 450x410 button "Disagree"]
  ; this is the simulated XP start button
  button gray 50x30 "START" [disclaim]

  ; this is a small vertical button to make the xP start button look 
  more realistic.
  at 75x605 button gray 3x30

  ; this is a digital clock to simulate the destop clock bottom right 
  on screen.

  at 750x610 text "00:00" rate 1 black ;effect [gradient 0x1 0.0.150 
  0.0.50]
  feel [engage: func [face act] [face/text: now/time  show face]]

]755x650  rebol [Title: "SOS-XP"]
  view layout [

  ;makes a gui window 768x576 with a simulated desktop (xP blue) with 
  ibevelled border.
  image center %DT.jpg 768x576 ibevel pewter 6x6

  ;creates an area text box color red with disclaimer message & 2No 
  buttons "agree" & "disagree"

  ; which hopefully will be situated in the XP destop when the start 
  button is clicked.
  disclaim: [at 200x300

  area wrap font-color white {You use this program & batch files entirely 
  at your own risk,
due to the myriad of hardware/software configurations I cannot
without any certainty claim that you will not damage your system!
Always Always Always make a full system backup of your partition
before attempting to use SOS-XP & that you have tested the back

up so your are positive in your own mind you can make a recovery!} 
red bold 
  at 240x410 button "Agree"
  at 450x410 button "Disagree"]
  ; this is the simulated XP start button
  button gray 50x30 "START" [disclaim]

  ; this is a small vertical button to make the xP start button look 
  more realistic.
  at 75x605 button gray 3x30

  ; this is a digital clock to simulate the destop clock bottom right 
  on screen.

  at 750x610 text "00:00" rate 1 black ;effect [gradient 0x1 0.0.150 
  0.0.50]
  feel [engage: func [face act] [face/text: now/time  show face]]

]755x650
Oop,s tripple posted how do you delete I will satrt again
Henrik
16-Nov-2008
[1471]
You can't delete, but that's ok.
DavidR
16-Nov-2008
[1472]
I will have to be more careful sorry!
Henrik
16-Nov-2008
[1473]
so, the area is supposed to be hidden and then be displayed when 
you click start?
DavidR
16-Nov-2008
[1474x4]
Indeed yes, the area or box will contain the disclaimer details + 
the two additional buttons Agree & disagree yes
called from depressing the [START] button
Bit like the way Windows works but obviously this is a simulated 
approach
however when I click the [START] button nothing happens its busted
Henrik
16-Nov-2008
[1478x3]
ok, showing and hiding faces are done with SHOW and HIDE. Example:


view layout [button "Start" [either a/show? [hide a][show a]] a: 
area]
in your code, you are writing button "Start" [disclaim], but there 
is no actual face set to that word.
I guess what you need there is:

disclaim: panel [at ...]

not:

disclaim: [at...]
DavidR
16-Nov-2008
[1481]
ahh so panel is a function to kick start the reamining block of text 
+ Buttons?
Sunanda
16-Nov-2008
[1482]
Henrik is just ahead of me --- you have disclaim as block.

Also, maybe when getting started, dont worry about the absolute positionings 
(they'd need to be adjusted according to screen resolution anyway). 
This simplification of your code works for me: (note the unview/all 
to remove any previous instances):


  rebol [Title: "SOS-XP"]
  unview/all
  view layout [
  across
  
  disclaim: 

  area wrap font-color white {You use this program & batch files entirely 
  at your own risk,
due to the myriad of hardware/software configurations I cannot
without any certainty claim that you will not damage your system!
Always Always Always make a full system backup of your partition
before attempting to use SOS-XP & that you have tested the back

up so your are positive in your own mind you can make a recovery!} 
red bold 
   return
   button "Agree"
  return button "Disagree"]
  return
  button gray 50x30 "START" [disclaim]

  ; this is a small vertical button to make the xP start button look 
  more realistic.
  return button gray 3x30

  ; this is a digital clock to simulate the destop clock bottom right 
  on screen.

  return text "00:00" rate 1 black ;effect [gradient 0x1 0.0.150 0.0.50]
  feel [engage: func [face act] [face/text: now/time  show face]
]
DavidR
16-Nov-2008
[1483]
I cobbled this together from the beginners tutorial stuff & glued 
it together
Sunanda
16-Nov-2008
[1484]
Copying is sometimes the best way.

There are some stray ]s in the code I just posted.....Sorry. This 
below really does work:


  rebol [Title: "SOS-XP"]
  unview/all
  view layout [
  across
  
  disclaim: 

  area wrap font-color white {You use this program & batch files entirely 
  at your own risk,
due to the myriad of hardware/software configurations I cannot
without any certainty claim that you will not damage your system!
Always Always Always make a full system backup of your partition
before attempting to use SOS-XP & that you have tested the back

up so your are positive in your own mind you can make a recovery!} 
red bold 
   return
   button "Agree"
  return button "Disagree"
  return
  button gray 50x30 "START" [disclaim]

  ; this is a small vertical button to make the xP start button look 
  more realistic.
  return button gray 3x30

  ; this is a digital clock to simulate the destop clock bottom right 
  on screen.

  return text "00:00" rate 1 black ;effect [gradient 0x1 0.0.150 0.0.50]
  feel [engage: func [face act] [face/text: now/time  show face]]

]
DavidR
16-Nov-2008
[1485x3]
Yes sunanda that is nearly there but I am trying to retain all the 
background stuff/Gui the discalimer box pops up on depressing the 
[start] button in fact the discalimer stuff overlays the previous 
gui stuff
I copied your code into rebol/view & ran it to see?
I thought the XP simulated look & feel would make it easy for users 
to use the program
Sunanda
16-Nov-2008
[1488]
Sorry about messing you UI up! As Henrick says, you need a pane and 
to work with swapping between different panes.
Tutorial here:
http://www.rebol.com/how-to/subpanels.html
DavidR
16-Nov-2008
[1489x4]
I used the postioning to force the overlay effect is that the right 
way of doing things?
Kewl much oblighed
I will read up on "panel" also
Many thanks Henrik
Henrik
16-Nov-2008
[1493]
no problem
Sunanda
16-Nov-2008
[1494]
<I copied your code into rebol/view & ran it to see?>

A possibly simpler way is to copy it into the Windows clipboard, 
then this line in the View console:
     do read clipboard://
DavidR
16-Nov-2008
[1495x7]
yes thanks
tried with the a combination of panel & unview/all then in this line 
of code:

button gray 50x30 "START" [view disclaim] -> inserted view but the 
start button is pushed to the top right of the screen/Window the 
[Start] button now closes the XP lookalike gui, opens the discalim 
area in a black box?
half off the page
or monitor screen should I say
but at least the [Start] button now works kewl
I will just have a read of the subpanel info link you have provided 
Sunanda BRB
(they'd need to be adjusted according to screen resolution anyway) 
this is interesting so waht  could be ok on my screen setup could 
be completely different on someone elses Umm
Sunanda
16-Nov-2008
[1502]
Screen resolution is easy to get.....And it may be your first foray 
into the 'system object:
      print system/view/screen-face/size
Henrik
16-Nov-2008
[1503]
(easy to get, hard to find :-))