Text areas and text fields stuff

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

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.

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