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

Username:   Password: 
 RegisterRegister   
 Help!!!GUI.CloseWindow
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
jacklarry




PostPosted: Mon Nov 07, 2005 6:08 pm   Post subject: Help!!!GUI.CloseWindow

I have been creating a dice and i want to get a quit button in there so that i can close the window by clicking on it. Here is my code:


code:
[center]Rand.Set (16#1234ABCD)
loop
put "Press any key to roll the dice again."
put""
put "You rolled ", Rand.Int (1, 6)
Input.Pause
cls
put "Thanks for rolling. "..
end loop [/center]


I will really appreciate your help. Please help me. Embarassed [/center]
Sponsor
Sponsor
Sponsor
sponsor
Dan




PostPosted: Mon Nov 07, 2005 6:34 pm   Post subject: (No subject)

Are you using the turing GUI in your progme of do you whon to make a buttion your self? Or is this in another window spreate from your main progame?
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
MysticVegeta




PostPosted: Mon Nov 07, 2005 7:45 pm   Post subject: Re: Help!!!GUI.CloseWindow

jacklarry wrote:
I have been creating a dice and i want to get a quit button in there so that i can close the window by clicking on it. Here is my code:


code:
[center]Rand.Set (16#1234ABCD)
loop
put "Press any key to roll the dice again."
put""
put "You rolled ", Rand.Int (1, 6)
Input.Pause
cls
put "Thanks for rolling. "..
end loop [/center]


I will really appreciate your help. Please help me. Embarassed [/center]


hmm, I suggest you dont use this method because I am guessing you haven't done GUI in class because i remember my class from last semester, this assignment, anyways, yeah, so i suggest dont use that, it will only get you confused about where the GUI.ProcessEvent goes,etc. But if you want to do this, try looking in teh hellp manual, try it, it you still dont get it then we will help you but you have to try first.
jacklarry




PostPosted: Mon Nov 07, 2005 11:00 pm   Post subject: (No subject)

Thanx for the help. I have searched everything in the help section. I have read everything but according to GUI.CloseWindow the procedure part is what gets me screwed. i typed it in and it works but not effeciently. i have learned how to make the buttons from help but i still cant figure out how to put them into effect. please help me.
code:
View.Set ("graphics: 200; 150,nobuttonbar")
var die : int := GUI.CreateButtonFull (120, 50, 10, "Roll",
    roll, 10, '^D', true)
var quitBtn : int := GUI.CreateButton (20, 50, 0, "Quit", GUI.Quit)
loop
    exit when GUI.ProcessEvent
end loop


I put that after my actual dice rolling code. it would be very helpful of u if u can rearrange the formula to make it work. thnx Neutral
MysticVegeta




PostPosted: Mon Nov 07, 2005 11:25 pm   Post subject: (No subject)

ok since you have tried, i will help you.
code:
import GUI
var winID := Window.Open ("graphics:200;150")
proc roll
    put "Roll commmands here"
end roll
var die : int := GUI.CreateButtonFull (120, 20, 10, "Roll",
    roll, 10, '^D', true)
var quitBtn : int := GUI.CreateButton (20, 20, 0, "Quit", GUI.Quit)
loop
    exit when GUI.ProcessEvent
end loop
Window.Close (winID)
jacklarry




PostPosted: Wed Nov 09, 2005 9:10 pm   Post subject: (No subject)

thanx for the help
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  [ 6 Posts ]
Jump to:   


Style:  
Search: