Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Menu Won't Work In Loop
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Siavash




PostPosted: Mon Apr 06, 2009 9:22 pm   Post subject: Menu Won't Work In Loop

Turing:
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?
Sponsor
Sponsor
Sponsor
sponsor
Dusk Eagle




PostPosted: Tue Apr 07, 2009 11:35 pm   Post subject: Re: Menu Won't Work In Loop

Why did you create a new thread for this when you have this one? You may end up making two people work on the same problem, which wastes one person's time.
Siavash




PostPosted: Wed Apr 08, 2009 4:30 pm   Post subject: 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




PostPosted: Thu Apr 09, 2009 5:32 pm   Post subject: RE:Menu Won\'t Work In Loop

before the loop put cls
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: