How to print text to a Text Field..?

BlitzPlus Forums/BlitzPlus Programming/How to print text to a Text Field..?

BachFire(Posted 2003) [#1]
Hey,

I know how to use the text, you write yourself in a Text Field. But how do you throw some text into a Text Field?

Fx picture this.. You have a window with two Text Fields, and one button. You type some random text into the first field. Then, when the button is pressed, the entered text will appear in the second Text Field.

How is this done?


CS_TBL(Posted 2003) [#2]
uhm... like this? :)

app=CreateWindow("hello gadgettext!",0,0,320,240)

txt1=CreateTextField(32,32,80,32,app)
txt2=CreateTextField(32,80,80,32,app)

butt=CreateButton("copy",32,144,32,32,app)

Repeat

	WaitEvent()
	
	If EventSource()=app
		If EventID()=$803 Exit
	EndIf
	
	If EventSource()=butt
		If EventID()=$401
			SetGadgetText txt2,TextFieldText(txt1)
		EndIf
	EndIf
	
Forever
End



BachFire(Posted 2003) [#3]
SetGadgetText.. JESUS CHRIST!!!! Okay, learning.. :) Thanks a lot!

;)


Mark Tiffany(Posted 2003) [#4]
Learn all of those Gadget commands by heart, and remember, EVERYTHING is gadget. Even Windows. ;-)