Computer Science Canada

Display problem.

Author:  sulaimanhakh [ Mon Jan 12, 2009 9:33 pm ]
Post subject:  Display problem.

I'm making a program, but for some reason when i run it it doesn't show all the text.
here is the code.

Quote:

var window : int
window := Window.Open ("graphics:640;480,offscreenonly;title:Sulaimans Geometry thing") %name and stuff
color (brightgreen)
colorback (black)
cls

% USEFULL THINGS: put "[]"
var arenumber:real
var number : real

put "[1] Area/Perimeter Calculator"
put "[2] Astronomical Unit Converter"

get number
if number = 1 then
put " You Have Selected [1]"
window := Window.Open ("graphics:640;480,offscreenonly;title:Rectangle Area/Perimeter Calculator") %name and stuff
color (brightgreen)
colorback (black)
cls

put "[1] Rectangle Area/Perimeter Calculator"

put "[2] Triangle Area/Perimeter Calculator"

put "[3] Cube Area/Perimeter Calculator"

get number

if number = 1 then
put "You Have Selected [1] Rectangle Area/Perimeter Calculator"
elsif number = 2 then
put "You Have Selected [2] Triangle Area/Perimeter Calculator"
elsif number = 3 then
put "You Have Selected [3] Cube Area/Perimeter Calculator"
end if










elsif number = 2 then
put " You Have Selected [2]"
window := Window.Open ("graphics:640;480,offscreenonly;title:Triangle Area/Perimeter Calculator") %name and stuff
color (brightgreen)
colorback (black)
cls
elsif number = 3 then
put " You Have Selected [3]"
window := Window.Open ("graphics:640;480,offscreenonly;title:Sulaimans Geometry thing") %name and stuff
color (brightgreen)
colorback (black)
cls
elsif number = 4 then
put " You Have Selected [4]"
window := Window.Open ("graphics:640;480,offscreenonly;title:Sulaimans Geometry thing") %name and stuff
color (brightgreen)
colorback (black)
cls
end if


When i run it and press 1 its supposed to display:

You Have Selected [1] Rectangle Area/Perimeter Calculator
You Have Selected [2] Triangle Area/Perimeter Calculator
You Have Selected [3] Cube Area/Perimeter Calculator

But instead it only displays "You Have Selected [1] Rectangle Area/Perimeter Calculator"

can someone tell me the problem?

Author:  The_Bean [ Mon Jan 12, 2009 9:37 pm ]
Post subject:  Re: Display problem.

You have 'offscreenonly' turned on when you make the new window, so in order for the text to appear you need to call View.Update.

Author:  sulaimanhakh [ Mon Jan 12, 2009 10:36 pm ]
Post subject:  RE:Display problem.

Thanks!!! It works!!!.
is there a way to make it clear instead of opening a new window?

Author:  The_Bean [ Mon Jan 12, 2009 10:47 pm ]
Post subject:  Re: Display problem.

'cls' will clear the screen and all the text on it.

Author:  sulaimanhakh [ Wed Jan 14, 2009 3:57 pm ]
Post subject:  RE:Display problem.

k.


: