Computer Science Canada

Controlling main window using "Window." commands.

Author:  templest [ Wed Jan 14, 2004 10:32 am ]
Post subject:  Controlling main window using "Window." commands.

OK!, We all know how to controll windows you open, for example:

var window : int := Window.Open ("title:wassabi")

problem... The main window, not a window you open. You know, the one that runs automatically when you make the program:

put "Hello World!"

How do I control it? You can't just type: Window.Set (... uhh... what?) The window has no name attached to it. It's like... err. Do any of you know what I mean? Like, I can't use Window.Close or Window.SetActive with it because I can't just type the command if it doesn't have a name. Turing won't know what window it is that I'm trying to activate! Evil or Very Mad

Any help?

Author:  DanShadow [ Wed Jan 14, 2004 1:40 pm ]
Post subject: 

Try this:
code:

var window : array 1 .. 2 of int
window (1) := Window.Open ("graphics:320;200,noecho,nocursor,title:Window 1,offscreenonly,nobuttonbar,position:max;max")
window (2) := Window.Open ("graphics:320;200,noecho,nocursor,title:Window 2,offscreenonly,nobuttonbar,position:0;0")

put "Window 2"

loop
    Window.Select (window (1))
    Window.SetActive (window (1))
    locate (1, 1)
    Draw.FillOval (10, 10, 20, 20, 12)
end loop

Author:  Mazer [ Wed Jan 14, 2004 6:48 pm ]
Post subject: 

Yeah, that's why I would always initialize my own window whenever I started writing a program. It's just easier that way, because I almost always want to have my own window size and title and whatever else so the very first line of my program would be
code:

var win := Window.Open ("graphics:600;500,title:BLAH")

or whatever..


: