Creating a Paste event definition

This is an update to a previous conversation.
how-to-create-a-new-event-definition

I’m posting it as separate as I’m not getting something.
My text isn’t pasting into me.Text. I’ve tried several things that aren’t working and this is the last development.
I know it’s not something stupid like Enable the menuhandler as the debugger goes into the menuitem EditPaste.

Here’s the project:MyTextAreaTest.xojo_binary_project

What do I need to do to get this project to work?

you should need to do NOTHING… Cut/Copy and Paste are automatically implemented for TextfField and TextArea
and there should be no need to override these unless you are needing to do something beyond the scope of the automatic events

I agree, but I want to be able to handle it at that time to clean up text by eliminating empty lines, trimming text, and removing extra and unwanted characters.
I can wait for something else to happen like tabbing out of the area, or add in some extra handling like testing it against a copy. That gets useless when the event handler changes fires on every character.
All I want to do is handle the paste.

Change this:

[code]Function EditPaste() As Boolean
Dim str As String = Self.Text
OnPaste(str)
Return True

End Function[/code]

to this:

[code]Function EditPaste() As Boolean
Dim c As New Clipboard
Dim str As String = c.Text
OnPaste(str)
Return True

End Function
[/code]

That was simpke. Thanks

Or just use the CHANGE event