Computer Science Canada

changing the function of this menu

Author:  bubbles3 [ Tue Jun 07, 2005 11:29 am ]
Post subject:  changing the function of this menu

i am trying to get this menus to stay at the top of the screen while my main program loads but it wont and i want it to run a second program only when a button is pressed can anyone help???.....
code:

import GUI
View.Set ("screen:center: max:max")
var win := Window.Open (" max,max,graphics")
colourback (black)
colour (white)
var first, second : int
var item : array 1 .. 10 of int
var name : array 1 .. 10 of string (4) :=
    init ("New", "---", "Open", "---", "Save", "---", "Prin", "---", "Exit", "---")
var name2 : array 1 .. 1 of string (4) :=   
    init ("Info")
forward proc exitwindow

first := GUI.CreateMenu ("File")
item (1) := GUI.CreateMenuItem (name (1), exitwindow)
item (2) := GUI.CreateMenuItem (name (2), exitwindow)
item (3) := GUI.CreateMenuItem (name (3), exitwindow)
item (4) := GUI.CreateMenuItem (name (4), exitwindow)
item (5) := GUI.CreateMenuItem (name (5), exitwindow)
item (6) := GUI.CreateMenuItem (name (6), exitwindow)
item (7) := GUI.CreateMenuItem (name (7), exitwindow)
item (8) := GUI.CreateMenuItem (name (8), exitwindow)
item (9) := GUI.CreateMenuItem (name (9), exitwindow)

second := GUI.CreateMenu ("Help")
item (10) := GUI.CreateMenuItem (name2 (1), exitwindow)

process my_background
    loop
        exit when GUI.ProcessEvent
    end loop
end my_background
fork my_background
body proc exitwindow
    Window.Close (win)
end exitwindow


: