gui validation

BlitzMax Forums/BlitzMax Programming/gui validation

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Chris,
This works.
SuperStrict

Global win:tgadget=CreateWindow("a window!",150,150,120,80,Null,WINDOW_TITLEBAR)
Global edit1:tgadget=CreateTextField(10,10,90,20,win)

AddHook EmitEventHook,myhook
ActivateGadget edit1 '<---------need to activate

While TextFieldText(edit1)<>"EXIT"

	PollSystem()
	Delay(100)

Wend


End


Function MyHook:Object( id:Int,data:Object,context:Object )
	Local p:Int
	Local Event:TEvent=TEvent(Data) '<---------added	
	Print TextFieldText(edit1)'<---------for debugging

	If Event.ID=EVENT_WINDOWCLOSE Then End'<---------use object.ID

	If Event.ID=EVENT_GADGETACTION Then
		Local s:String
		s=TextFieldText(edit1)
		s=Upper(s)
		SetGadgetText edit1,s
	EndIf
	
	Return data

End Function

I'm guessing calling pollevent from eventhook could be dodgy