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: Vadim Zeitlin
Subject: Re: Determine whether window created yet [Was: [lmi] wx segfault iterating on GetChildren()]
Date: Sat, 11 Mar 2006 16:06:37 +0100

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.

GC> I use IsShown() only for wxDialog or similar classes like
GC> wxNotebook: classes that handle GUI input. I use it to avoid
GC> doing things that shouldn't be done while the window is in the
GC> process of being created--like vetoing a notebook page change.

 The easiest way to work around this is to not use the static event table
but use Connect() to only connect your EVT_PAGE_CHANGING handler after the
notebook is fully created.

 Regards,
VZ





reply via email to

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