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

Username:   Password: 
 RegisterRegister   
 Buttons for Dummies!
Index -> Programming, Turing -> Turing Tutorials
Goto page Previous  1, 2, 3, 4, 5  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
elmocookies




PostPosted: Tue Jan 02, 2007 8:50 pm   Post subject: (No subject)

Does anyone know if there is tutorial on GUI.CreateRadioButtons or is this the only tutorial for anything involving GUI?
Sponsor
Sponsor
Sponsor
sponsor
beginnerprogrammer




PostPosted: Sat May 26, 2007 3:19 pm   Post subject: RE:Buttons for Dummies!

i just started programmering and turing i don't know what this error means it is. The error is it is unable to pen file GUI. Why isn't it working i followed all the instructions
Agner




PostPosted: Tue Feb 24, 2009 9:24 pm   Post subject: (No subject)

Clayton @ Wed Jan 25, 2006 11:39 am wrote:
i would like to add a bit to this if you want your buttons to be disabled you would do this
code:

proc disableButton
GUI.Disable (buttonName)
end disableButton

this stops the button from working, also if you are drawing boxes and such on the screen and you dont want your buttons to disappear then use the GUI.Refresh command as such
code:

proc refreshButton
GUI.Refresh(buttonName)
end refreshButton

this basically redraws your buttons on top of the screen again in the middle of your program without actually creating it
hope this helps


So if I want to have multiple buttons throughout my program (and not have them reappearing in sections I don't want them in), I would just use these commands or is there more? Confused Question Confused

Btw nice tutorial on GUI, helped me a lot with making buttons, I just need to figure out how to remove them when I don't need em Very Happy
flyforfame




PostPosted: Sat Mar 28, 2009 8:50 pm   Post subject: Re: Buttons for Dummies!

hi can u tell me how to make the program go to a next question?
for example i put What is Ice cream made out of and there is 2 buttons i can click
how can i make it so that if i click any of the 2 buttons i go the to the next question for example the next question is What is Fries made out of
so like this
What is ice cream made out of?
button 1
button 2
so if someone clicks one of the buttons it clears the page and goes to
What is Fries Made out of?
button 1
button 2
etc etc
and please reply as soon as possible i need to use this for my project
qmanjr5




PostPosted: Mon Jan 11, 2010 11:19 am   Post subject: RE:Buttons for Dummies!

Can the loop go ANYWHERE in the code?
qmanjr5




PostPosted: Mon Jan 11, 2010 11:24 am   Post subject: RE:Buttons for Dummies!

Also, how would I make it so it displays the button at a certain point in the code?

Turing:

import GUI
var button1 : int := GUI.CreateButton (25, 25, 0, "Button 1", test1)

procedure test1
    put button1
end test1


put button1


Doesn't work, even if I put "var button1..." after "procedure test1...."

How would i make this work?
xBalmungx




PostPosted: Wed Jan 13, 2010 6:05 pm   Post subject: Re: Buttons for Dummies!

Omg, this helped alot, thank you sooo much Very Happy
blizzard4800




PostPosted: Fri Jan 15, 2010 6:46 pm   Post subject: RE:Buttons for Dummies!

Thank you soooooooo much
Sponsor
Sponsor
Sponsor
sponsor
blizzard4800




PostPosted: Fri Jan 15, 2010 7:45 pm   Post subject: RE:Buttons for Dummies!

but it doesnt work when you change the colour of the boutton
qmanjr5




PostPosted: Mon Jan 18, 2010 9:11 am   Post subject: RE:Buttons for Dummies!

how WOULD you change the color of the button?
TheGuardian001




PostPosted: Mon Jan 18, 2010 9:33 am   Post subject: Re: RE:Buttons for Dummies!

qmanjr5 @ Mon Jan 18, 2010 9:11 am wrote:
how WOULD you change the color of the button?

with the gui_setcolor command, which appears to work fine for me.
A2theBEAST




PostPosted: Wed May 19, 2010 7:27 pm   Post subject: RE:Buttons for Dummies!

Great tuti, I understand the button GUI commands pretty well now, Is there a way besides GUI.setsize to change the height of the button?
jacobjacobb




PostPosted: Thu Jun 10, 2010 7:53 pm   Post subject: Re: Buttons for Dummies!

can someone check my code and tell me whats wrong. Its suppose to be a rock, paper, scissors game.



import GUI

setscreen("graphics:400;450")

var choice : char
var bet : int
var winning : int
var money : int
var answer : char

put "What difficulty do you want to play? Hard(H), Medium(M), or Easy(E)? " ..

procedure easy
locate(5,1)
put "You chose Easy!"
answer := "e"
end easy

procedure medium
locate(5,1)
put "You chose Medium!"
answer := "m"
end medium

procedure hard
locate(5,1)
put "You chose Hard!"
answer := "h"
end hard

var button1:int:=GUI.CreateButton(50,50,0,"Easy",easy)
var button2:int:=GUI.CreateButton(150,50,0,"Medium",medium)
var button3:int:=GUI.CreateButton(250,50,0,"Hard",hard)

loop
exit when GUI.ProcessEvent
end loop

if answer = "E" or answer = "e" or answer = "easy" or answer = "Easy" or answer = "EASY" then
money := 1000
elsif answer = "M" or answer = "m" or answer = "medium" or answer = "Medium" or answer = "MEDIUM" then
money := 750
elsif answer = "H" or answer = "h" or answer = "hard" or answer = "Hard" or answer = "HARD" then
money := 500
end if

loop
var random := Rand. Int (1, 3)
put "You have " ..
put money ..
put " dollars left to bet."
put "How much money do you want to bet? " ..
get bet
if bet > money then
put "You have been caught trying to cheat!"
put "Remember kids the T-rex ate the Unicorn."
put "Listen carefully."
for count : 1..3
sound (440, 500)
sound (400, 500)
sound (500, 500)

sound (360, 500)
end for
sound (440, 600)
quit
end if
put " "
put "Rock(r), Paper(p) or Scissors(s)?(Push e to exit the game) " ..
get choice
if choice = "r" and random = 1 then
put "Computer chose Rock. "
put "You chose Rock."
put "Its a tie."
elsif choice = "p" and random = 2 then
put "Computer chose Paper. "
put "You chose Paper."
put "Its a tie."
elsif choice = "s" and random = 3 then
put "Computer chose Scissors. "
put "You chose Scissors."
put "Its a tie."
elsif choice = "r" and random = 3 then
put "Computer chose Scissors. "
put "You chose Rock."
put "You won."
money := bet + money
elsif choice = "p" and random = 1 then
put "Computer chose Rock. "
put "You chose Paper."
put "You won."
money := bet + money
elsif choice = "s" and random = 2 then
put "Computer chose Paper. "
put "You chose Scissors."
put "You won."
money := bet + money
elsif choice = "s" and random = 1 then
put "Computer chose Rock. "
put "You chose Scissors."
put "You lose."
money := money - bet
elsif choice = "p" and random = 3 then
put "Computer chose Scissors. "
put "You chose Paper."
put "You lose."
money := money - bet
elsif choice = "r" and random = 2 then
put "Computer chose Paper. "
put "You chose Rock."
put "You lose."
money := money - bet
end if
put " "
if money < 1 then
put "You lose."
put "Remember kids the T-rex ate the Unicorn."
put "Listen carefully."
for count : 1..3
sound (440, 500)
sound (400, 500)
sound (500, 500)

sound (360, 500)
end for
sound (440, 600)
quit
end if
if money > 4999 then
put "You win!"
put "Remember kids the T-rex ate the Unicorn."
put "Listen carefully."
for count : 1..3
sound (440, 500)
sound (400, 500)
sound (500, 500)

sound (360, 500)
end for
sound (440, 600)
quit
end if
if choice = "e" or choice = "E" or choice = "exit" or choice = "Exit" or choice = "EXIT" or choice = "quit" or choice = "Quit" or choice = "QUIT" then
put "You have quit."
put "Remember kids the T-rex ate the Unicorn."
put "Listen carefully."
for count : 1..3
sound (440, 500)
sound (400, 500)
sound (500, 500)

sound (360, 500)
end for
sound (440, 600)
quit
end if
end loop
USEC_OFFICER




PostPosted: Thu Jun 10, 2010 8:26 pm   Post subject: RE:Buttons for Dummies!

Um, why isn't this in a seperate topic?
Cezna




PostPosted: Fri Jun 11, 2010 5:15 am   Post subject: RE:Buttons for Dummies!

@ jacobjacobb
you will get much more attention for your program if you post it in a separate topic, which from the start of your post, should probably be in the Help section
Display posts from previous:   
   Index -> Programming, Turing -> Turing Tutorials
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 4 of 5  [ 65 Posts ]
Goto page Previous  1, 2, 3, 4, 5  Next
Jump to:   


Style:  
Search: