Need Help With GUI Buttons
Author |
Message |
dallasmcmahon
|
Posted: Fri May 04, 2012 5:41 pm Post subject: Need Help With GUI Buttons |
|
|
What is it you are trying to achieve?
import GUI
procedure checkBalance (currentBalance : int)
colorback (4)
locate (20, 20)
put "Your balance is : $", currentBalance
end checkBalance
var BalanceButton : int := GUI.CreateButton (200, 280, 5, "Check Balance", checkBalance)
loop
exit when GUI.ProcessEvent
end loop
What is the problem you are having?
I keep getting an error "Argument is the wrong type" where the checkBalance is int the GUI parameter. I have tried changing the the data types. I am new to GUI and it is probably an easy fix. Thanks for anyones help
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Turing: |
import GUI
procedure checkBalance ( currentBalance : int)
colorback (4)
locate (20, 20)
put "Your balance is : $", currentBalance
end checkBalance
var BalanceButton : int := GUI.CreateButton (200, 280, 5, "Check Balance", checkBalance )
loop
exit when GUI.ProcessEvent
end loop
|
Please specify what version of Turing you are using
<Answer Here> |
|
|
|
|
|
Sponsor Sponsor
|
|
|
evildaddy911
|
Posted: Fri May 04, 2012 6:13 pm Post subject: RE:Need Help With GUI Buttons |
|
|
you need to add arguments for the checkBalance procedure |
|
|
|
|
|
Zren
|
Posted: Fri May 04, 2012 11:33 pm Post subject: RE:Need Help With GUI Buttons |
|
|
http://compsci.ca/holtsoft/doc/gui_createbutton.html
GUI.CreateButton (x, y, width : int, text : string, actionProc : procedure x ()) : int
Note how the function you're calling accepts a procedure with no arguments. Thus, the argument is a wrong type. |
|
|
|
|
|
|
|