
-----------------------------------
Pickles
Sun Apr 18, 2004 8:39 pm

Clearing Text Fields
-----------------------------------
When the user inputs their text in the text field and hits enter, Is there a way to clear the text from it so they dont have to delete it themselves if they want to input new text?

My appologies if this has been discussed already, I searched for it but couldnt find anything of help.

-----------------------------------
Delos
Sun Apr 18, 2004 8:59 pm


-----------------------------------
You are refering to GUI textfields?

Try, GUI.SetText...

Or F10.  It usually works.

-----------------------------------
Pickles
Sun Apr 18, 2004 9:11 pm

..
-----------------------------------
Ahh thats the stuff, thanks.. Its hard using this old turing.. it doesnt have any GUI help on it.. 

And finally.. 

Is there a way to resize the text, it doesnt seem to want to work for me.. I just have it via slider like so: 
 font1 := Font.New ("ariel:textSize")
assert font1 > 0

procedure VerticalSliderMoved (value : int)
    textSize := value
    locatexy (60, 110)
    put value
end VerticalSliderMoved


the value moves but the text size doesnt change.. no matter what i have it set to

-----------------------------------
Delos
Sun Apr 18, 2004 9:21 pm


-----------------------------------
Um...are you trying to draw fonts w/ the 'put' command.  Coz you can't.  Really, no, you can't!


Font.Draw (txtStr : string, x, y, fontID, Color : int)


You need to update your Turing.  Check out the main page.

-----------------------------------
Pickles
Sun Apr 18, 2004 9:24 pm

..
-----------------------------------
Yeah im putting the font with Font.Draw but it doesnt want to change the size of it

Can't update turing.. the damned teacher marks in this so if i have any commands that arent in this one(ie. View.Update) it wont work

-----------------------------------
Delos
Mon Apr 19, 2004 11:47 am


-----------------------------------
Well, that's no problem.  Update still, and you'll have the newer help file, but keep an older copy of Turing available.  Thus ways, you can run your new proggies from it, to make sure that all the commands you used existed then.

I just noticed, you said:

font1 := Font.New ("ariel:textSize") 


Methinks you ought to change that to something to the effect of:

var font : int

var num : int
put "?"
get num

font := Font.New ("Ariel:" + num)

Font.Draw ("Hello World", 100, 100, font, 7)


Should give you an idea...

Oh yeah, almost forgot, the code I posted is buggy...intentionally ofcourse.  Find the error and fix it, why don't you, make you work a bit for the help you receive  :lol: .
