
-----------------------------------
Siavash
Mon Apr 06, 2009 9:22 pm

Menu Won't Work In Loop
-----------------------------------
import GUI 

View.Set ("graphics:250;150,nobuttonbar,offscreenonly") 
var first : int       % The menus. 
var item : int % The menu items. 
var m, p : int := 1 

var name : string (20) := "Quit" 

% Create the menus 
first := GUI.CreateMenu ("First") 
item := GUI.CreateMenuItem (name, GUI.Quit) 

loop 
    if p = maxx then 
        m := -m 
    end if 
    if p < 0 then 
        m := -m 
    end if 
    p := p + m 
    drawfillbox (p, 100, p + 10, 110, black) 
    exit when GUI.ProcessEvent 
    View.Update 
    cls 
end loop  

if i put :first := GUI.CreateMenu ("First") and item := GUI.CreateMenuItem (name, GUI.Quit) in the loop, it creates new menu each time and if i dont (like example), it goes away and i cant make a menu. any solutions or ideas?

-----------------------------------
Dusk Eagle
Tue Apr 07, 2009 11:35 pm

Re: Menu Won't Work In Loop
-----------------------------------
Why did you create a new thread for this when you have [url=http://compsci.ca/v3/viewtopic.php?t=20674]this one? You may end up making two people work on the same problem, which wastes one person's time.

-----------------------------------
Siavash
Wed Apr 08, 2009 4:30 pm

RE:Menu Won\'t Work In Loop
-----------------------------------
I noticed that I am not allowed to use "Help" in my title so i reposted then i dont know how to delete post.

-----------------------------------
RYAN191
Thu Apr 09, 2009 5:32 pm

RE:Menu Won\'t Work In Loop
-----------------------------------
before the loop put cls
