WM_DESTROY equivalent

Added by Frank B 10 months ago

Hi,

is there a signal or other possibility to get informed when a widgets gets destroyed (like the WM_DESTROY Message from WinAPI or wxEVT_DESTROY in wxWidgets)?

I wan't to connect a Fire-And-Forget-Handler to all my TableViews to change the Selection-Behaviour so that it behaves like anyone who ever used a computer expects it to do.

Because I don't wan't to copy and paste the same code over and over I thought I just write a class, so I can do a simple

new FixSelectionBehaviour(myTableView);

in my Constructors.

But to prevent leaks I need a way to detect when the table view gets destroyed, so I can do a "delete this" in my Fire-And-Forget-Handler.

Thanks
Frank


Replies (2)

RE: WM_DESTROY equivalent - Added by Wim Dumon 10 months ago

Hello Frank,

Just one thought: if FixSelectionBehaviour is a WObject who's parent is set to myTableView, it will be deleted when the parent disappears.

Can you elaborate what's so off-worldish about the TableViews selection behaviour?

Regards,
Wim.

RE: WM_DESTROY equivalent - Added by Frank B 10 months ago

Hi Wim,

Oh, that was easy. Thank you.

What sucks about the selection behaviour is that it's different from any other software that supports selection via mouse.

It's even different in Wt itself. Compare it with wt's own WSelectionBox, which does it correctly.

Greetings
Frank

(1-2/2)