Textarea detect cursor movement

BlitzMax Forums/BlitzMax GUI Programming/Textarea detect cursor movement

I display the current line when the textarea is the eventsource,
but moving the cursor with the mouse or keyboard isnt treated as an event.
How do I make it into an event?

Look up SetGadgetSensitivity()

[edit] An EVENT_GADGETSELECT event occurs whenever the cursor or selected text region is modified by the user. Did you try that one already?

no not yet thanks

I tried it but it didnt work.

It does indeed work, as MaxIDE somehow manages to do just that.
Search the source of maxide for UpdateCursor() and you will find out how.

they handle events manually in Maxide with pollsystem

TextArea with all events on:

'Source Code created on 10 Mar 2009 18:59:04 with Logic Gui Version 4.1 Build 379
SuperStrict
Import MaxGui.Drivers

Local Window1:TGadget = CreateWindow:TGadget("Window1",151,63,453,239,Null,WINDOW_TITLEBAR|WINDOW_RESIZABLE |WINDOW_STATUS |WINDOW_CLIENTCOORDS )
	Local TextArea1:TGadget = CreateTextArea:TGadget(13,20,426,208,Window1:TGadget,Null)
		SetTextAreaText( TextArea1:TGadget , "TextArea1" )

Repeat
	WaitEvent()
	Select EventID()
		Case EVENT_WINDOWCLOSE
			Select EventSource()
				Case Window1	Window1_WC( Window1:TGadget )
			End Select

		Case EVENT_GADGETACTION
			Select EventSource()
				Case TextArea1	TextArea1_GA( TextArea1:TGadget )
			End Select

		Case EVENT_GADGETSELECT
			Select EventSource()
				Case TextArea1	TextArea1_GS( TextArea1:TGadget )
			End Select

		Case EVENT_GADGETMENU
			Select EventSource()
				Case TextArea1	TextArea1_GM( TextArea1:TGadget , Window1:TGadget )
			End Select

		Case EVENT_GADGETLOSTFOCUS
			Select EventSource()
				Case TextArea1	TextArea1_GF( TextArea1:TGadget )
			End Select

	End Select
Forever

Function Window1_WC( Window:TGadget )
	DebugLog "Window Window1 wants to be closed"

	End
End Function

Function TextArea1_GA( TextArea:TGadget )
	DebugLog "TextArea TextArea1 was modified"
	
End Function

Function TextArea1_GS( TextArea:TGadget )
	DebugLog "TextArea TextArea1 was modified (CursorPosition Or SelectedText)"
	
End Function

Function TextArea1_GM( TextArea:TGadget , Window:TGadget=Null )
	DebugLog "TextArea TextArea1 was right clicked"
	
End Function

Function TextArea1_GF( TextArea:TGadget )
	DebugLog "TextArea TextArea1 lost focus"
	
End Function


they handle events manually in Maxide with pollsystem

And how else are one to handle events? how exactly are you using maxgui?

oh yeah sorry I was doing it wrong,
thanks for the help