Text areas and text fields stuff

BlitzMax Forums/BlitzMax GUI Programming/Text areas and text fields stuff

How about using SetGadgetFilter():

Import MaxGui.Drivers

Strict 

Global window:TGadget = CreateWindow("My Window",30,20,320,200)
Global textfield:TGadget =CreateTextField(4,4,120,22,window)

SetGadgetText( textfield,"A textfield gadget" )

' Make read-only
SetGadgetFilter( textfield, ReadOnlyCallback )

While WaitEvent()
	Print CurrentEvent.ToString()
	Select EventID()
	Case EVENT_GADGETACTION
		Select EventSource()
			Case textfield
				Print "textfield updated"
		End Select
	Case EVENT_WINDOWCLOSE
		End
	End Select
Wend

Function ReadOnlyCallback(event:TEvent,context:Object)
	Return 0	' Never allow edit.
EndFunction