lmi
[Top][All Lists]
Advanced

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

Determine whether window created yet [Was: [lmi] wx segfault iterating o


From: Greg Chicares
Subject: Determine whether window created yet [Was: [lmi] wx segfault iterating on GetChildren()]
Date: Sat, 11 Mar 2006 14:36:07 +0000
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

On 2006-3-11 13:07 UTC, Greg Chicares wrote:
>
> Probably I'll
> have to add special logic to prevent vetoing a page change
> if IsShown() returns false.

It's somewhat distasteful to use IsShown() to determine whether
a window has been "fully created". After all, a notebook that was
once shown may be temporarily hidden. But is there any better way?

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

The ancient 'owl' library had a "FullyCreated" flag. In wx terms,
it would be set after EVT_INIT_DIALOG, and cleared when Destroy()
is called. I've looked at all the member variables in wxWindow and
wxDialog, but can't find anything that works that way. GetId()
already has a value distinct from wxID_ANY at the time of the
EVT_NOTEBOOK_PAGE_CHANGING event, which is before the notebook is
shown.

I guess I could derive from wxDialog and implement my own
"FullyCreated" flag this way. Hasn't anyone else ever wished for
something like this?




reply via email to

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