Calling function on widget destruction




Hello again.

I want to dynamically create some widgets and would like to know if it is possible to call a specified function when it is destroyed. Imagine I would parse a file that has, besides many other content, the string <entry>, and do:

Gtk::Entry *m_pEntry = manage(new Gtk::Entry());

I would pack it correctly and would create an exit button to this window.
When the Entry is destroyed, it it possible to automatically get_text() its content and write it to a file?

Should I override its destructor to do this? This should be done to all input-capable widgets that would be created dynamically.

This seems like a silly question with a simple answer, but I cannot figure that out (I should go to bed).

Thanks in advance.
Arthur





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]