Computer Science Canada

GUI Text field in Turing

Author:  hong_jeffrey [ Mon Dec 09, 2002 9:12 pm ]
Post subject:  GUI Text field in Turing

Hey! thanks for reading this post! Special Thanks to Tony for all his help! though this one stumped him!

i have a problem with the GUI and getting the input from the users when i use the GUI code: var tf := GUI.CreateTextFieldFull (30, 200, 200, " ", NAME,
GUI.INDENT, 0, 0)

procedure GETTEXT
text := GUI.GetText(tf)
end GETTEXT

it doesn't register the variable text. and when put text is used, it displays a binary code. if anyone knows how to solve this please reply

Author:  Dan [ Mon Dec 09, 2002 10:00 pm ]
Post subject:  gui

i made a porgame that demanstartes gui in turinig prity good. you can download it at ftp://swat@danco.no-ip.com/Turing/Turing%20Programs/Math%20Game/mathgame.zip

here is an exmapel of how to use the code
code:

import GUI in "%oot/lib/GUI"

var textbox :int
var text:string:=""

procedure Dumy1 (text : string)
end Dumy1

textbox := GUI.CreateTextFieldFull (maxx div 2, maxy div 2, 30,
            "", Dumy1, GUI.INDENT, 0, 0)

put "put in ex to exit"

loop 
      text := GUI.GetText (textbox)
      exit when GUI.ProcessEvent
      exit when text = "ex"
end  loop

put ""
put ""
put ""
put text


your problem probley lies with the loop that has the process event in it or with how you are calling the fuction that has gettext comand in it

Author:  MasterCard [ Tue May 31, 2016 7:29 pm ]
Post subject:  RE:GUI Text field in Turing

Here is a tutorial, I think they also give the code in the description.

https://www.youtube.com/watch?v=fjR1jqAeg0s


: