
-----------------------------------
dallasmcmahon
Fri May 04, 2012 5:41 pm

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)



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


-----------------------------------
evildaddy911
Fri May 04, 2012 6:13 pm

RE:Need Help With GUI Buttons
-----------------------------------
you need to add arguments for the checkBalance procedure

-----------------------------------
Zren
Fri May 04, 2012 11:33 pm

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.
