lmi
[Top][All Lists]
Advanced

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

Re: Determine whether window created yet [Was: [lmi] wx segfault iterati


From: Greg Chicares
Subject: Re: Determine whether window created yet [Was: [lmi] wx segfault iterating on GetChildren()]
Date: Wed, 15 Mar 2006 17:23:41 +0000
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

On 2006-3-11 15:06 UTC, Vadim Zeitlin wrote:
> On Sat, 11 Mar 2006 14:36:07 +0000 Greg Chicares <address@hidden> wrote:
> 
> GC> It's somewhat distasteful to use IsShown() to determine whether
> GC> a window has been "fully created". After all, a notebook that was
> GC> once shown may be temporarily hidden. But is there any better way?
> 
>  No, not out of the box. But you can assume that the window is fully
> created as soon as you get almost any message for it so it's common to set
> a m_isCreated flag in EVT_WINDOW_CREATE or even EVT_SIZE or EVT_IDLE
> handlers.

Okay. I want to add a variable to a wxDialog-derived class:

  /// is_fully_created_: True iff dialog construction has completed and
  /// destruction has not yet begun.

The ctor initializes it to false.

Some event handler sets it to true (probably I'll use EVT_INIT_DIALOG).

When should I change its value back to false, so that I can use this
flag to prevent a dialog that's in the process of destruction from
trying to do something it shouldn't?
  - a wxWindow::Destroy() virtual override?
  - an EVT_CLOSE handler?
  - my class's destructor?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]