Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 4278

How to override an Event in a subclassed DeskTopTextField control

$
0
0

As an OOP beginner I succeeded in overriding a DeskTopTextField (DTTF) control. Just by using methods with the same name and return type.

But now I want to override the TextChanged Event of an other DTTP and although I use the same kind of procedure, it ‘doesn’t work’.

What I did was just put one statement in the TextChanged Event, called TxtChanged (removed the first letter ‘e’), calling the TxtChanged-method. Then I created methods with the same name in the level above and in the main window. In the main window is the code that should be executed.
In the subclassed DTTF’s I’ve put: Self.txtChanged. Also Super.txtChanged doesn’t work

The error that I get is a StackOverflowExeption. But why?

In the override that works fine, I’ve put: Self.Text = Self.GetResult

Is the Event working differently because it starts at the lowest level? And what would be a way to solve this? It’s not a good practice (I think) to directly call the main window’s method from the TextChanged Event. Especially because an other window is also using this DTTF.

6 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 4278

Trending Articles