On Wednesday 21 March 2007 12:55, Jef Driesen wrote:
> And the second was the automatic destruction of the dialog without the
> need to keep a pointer to it somewhere. Trying to do the same thing in
> C++ resulted either in a memory leak or immediate destruction of the
> dialog (when its variable goes out of scope).

If the dialog is a self-owning non-modal dialog constructed on free store, one 
common approach is for the signal handler for the hide signal (or the clicked 
signal for whatever button is intended to close the dialog) to call 'delete 
this'.  Self-owning objects such as non-modal dialogs are one of the (few) 
cases where calling 'delete this' correctly expresses the nature of the 
object and its place in the program structure.

Chris

_______________________________________________
gtkmm-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Reply via email to