Discussion:
wxSplitterWindow parent
pg
2014-09-03 15:01:02 UTC
Permalink
Hello.

I am using wxSplitterWindow in MFC application on Windows. Parent window
is wxWindow created from CWnd (MFC version of wxWindow) handle.

Problem is wxSplitterWindow asserts during OnSize event. It tries to
cast parent pointer to wxTopLevelWindow and check for IsIconized flag.
The flag is supposed to always be false on Windows. After ignoring
warning splitter works fine.

Is this assert correct? Is there a way to avoid it without creating
floating wxDialog or wxFrame window as a parent?

Thanks,
Povilas
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-09-03 15:18:18 UTC
Permalink
On Wed, 03 Sep 2014 18:01:02 +0300 pg wrote:

p> I am using wxSplitterWindow in MFC application on Windows. Parent window
p> is wxWindow created from CWnd (MFC version of wxWindow) handle.
p>
p> Problem is wxSplitterWindow asserts during OnSize event. It tries to
p> cast parent pointer to wxTopLevelWindow and check for IsIconized flag.
p> The flag is supposed to always be false on Windows. After ignoring
p> warning splitter works fine.
p>
p> Is this assert correct? Is there a way to avoid it without creating
p> floating wxDialog or wxFrame window as a parent?

I admit I didn't think about this case (wxSplitterWindow inside a non-wx
TLW) when writing this code. I'm not sure how to handle it however. Perhaps
the best thing would be to avoid sending WM_SIZE events to iconized child
windows in the first place, I don't see how can this be ever useful. In
fact, I'm not even sure if this (still) really happens. If it doesn't, we
could just remove the check for IsIconized() completely.

Could you please check this?

Thanks,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
pg
2014-09-04 14:06:19 UTC
Permalink
Post by Vadim Zeitlin
p> I am using wxSplitterWindow in MFC application on Windows. Parent window
p> is wxWindow created from CWnd (MFC version of wxWindow) handle.
p>
p> Problem is wxSplitterWindow asserts during OnSize event. It tries to
p> cast parent pointer to wxTopLevelWindow and check for IsIconized flag.
p> The flag is supposed to always be false on Windows. After ignoring
p> warning splitter works fine.
p>
p> Is this assert correct? Is there a way to avoid it without creating
p> floating wxDialog or wxFrame window as a parent?
I admit I didn't think about this case (wxSplitterWindow inside a non-wx
TLW) when writing this code. I'm not sure how to handle it however. Perhaps
the best thing would be to avoid sending WM_SIZE events to iconized child
windows in the first place, I don't see how can this be ever useful. In
fact, I'm not even sure if this (still) really happens. If it doesn't, we
could just remove the check for IsIconized() completely.
Could you please check this?
Thank you for answer. Looking from the code it looks like the usefulness
is that it prevents splitter changing position after restore for
iconized windows (by skipping event). But since it is always false under
windows, maybe it could be within precompiled directive that checks if
it is not MSW version. If it is needed at all, since I can't check if
OnSize is called on iconized windows.

Povilas
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Nathan McCorkle
2014-09-05 00:26:20 UTC
Permalink
Post by pg
Hello.
I am using wxSplitterWindow in MFC application on Windows. Parent window
is wxWindow created from CWnd (MFC version of wxWindow) handle.
Problem is wxSplitterWindow asserts during OnSize event. It tries to
cast parent pointer to wxTopLevelWindow and check for IsIconized flag.
The flag is supposed to always be false on Windows.
I use wxPython, and maybe it is different or the jargon/language is
different enough between the libraries, but I can iconize GUIs with
wxPython on Windows.
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Loading...