Re: How can I port this gtk construct to gtkmm?
- From: Chris Vine <chris cvine freeserve co uk>
- To: gtkmm-list gnome org
- Cc: Jef Driesen <jefdriesen hotmail com>
- Subject: Re: How can I port this gtk construct to gtkmm?
- Date: Thu, 22 Mar 2007 00:31:14 +0000
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]