wxFrame with parent doesn't work correctly

96 views
Skip to first unread message

Andreas Falkenhahn

unread,
Aug 2, 2015, 9:28:20 AM8/2/15
to wx-u...@googlegroups.com
So the documentation on the wxFrame constructor says for the "parent" parameter:

"The window parent. This may be NULL. If it is non-NULL, the frame will always be
displayed on top of the parent window on Windows."

However, I can't get it to work. I can still move the parent in front of the child
window. A small demo program demonstrating the issue is attached.

Is there a mistake in my code or is this a bug in wxWidgets?

Interestingly, when using a wxMiniFrame for the child, the issue doesn't show
up and the parent always stays behind the child. With a wxFrame, however, the
parent can still be moved in front of the child and I don't see anything wrong
in my code.

--
Best regards,
Andreas Falkenhahn mailto:and...@falkenhahn.com
test.cpp

Vadim Zeitlin

unread,
Aug 2, 2015, 9:33:50 AM8/2/15
to wx-u...@googlegroups.com
On Sun, 2 Aug 2015 15:29:42 +0200 Andreas Falkenhahn wrote:

AF> So the documentation on the wxFrame constructor says for the "parent" parameter:
AF>
AF> "The window parent. This may be NULL. If it is non-NULL, the frame will always be
AF> displayed on top of the parent window on Windows."

This is just wrong, thanks for pointing it out, fixed now in

https://github.com/wxWidgets/wxWidgets/commit/6339837ffac48b01b5661eab4cf38ba719fadf3f

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Andreas Falkenhahn

unread,
Aug 2, 2015, 10:16:22 AM8/2/15
to Vadim Zeitlin
On 02.08.2015 at 15:33 Vadim Zeitlin wrote:

> On Sun, 2 Aug 2015 15:29:42 +0200 Andreas Falkenhahn wrote:

AF>> So the documentation on the wxFrame constructor says for the "parent" parameter:

AF>> "The window parent. This may be NULL. If it is non-NULL, the frame will always be
AF>> displayed on top of the parent window on Windows."

> This is just wrong, thanks for pointing it out, fixed now in

> https://github.com/wxWidgets/wxWidgets/commit/6339837ffac48b01b5661eab4cf38ba719fadf3f

Thanks. While you are at it you can also fix the doc for wxWindow::SetPosition()
which currently says:

"A synonym for Centre()."

This looks wrong as well...

Shawn H Corey

unread,
Aug 2, 2015, 11:58:39 AM8/2/15
to wx-u...@googlegroups.com
On Sun, 2 Aug 2015 16:17:45 +0200
Andreas Falkenhahn <and...@falkenhahn.com> wrote:

> While you are at it you can also fix the doc for
> wxWindow::SetPosition() which currently says:
>
> "A synonym for Centre()."
>
> This looks wrong as well...

That's British spelling not American. wxWidgets was created in England.


--
Don't stop where the ink does.
Shawn

Andreas Falkenhahn

unread,
Aug 2, 2015, 12:14:02 PM8/2/15
to Shawn H Corey
On 02.08.2015 at 17:32 Shawn H Corey wrote:

> On Sun, 2 Aug 2015 16:17:45 +0200
> Andreas Falkenhahn <and...@falkenhahn.com> wrote:

>> While you are at it you can also fix the doc for
>> wxWindow::SetPosition() which currently says:

>> "A synonym for Centre()."

>> This looks wrong as well...

> That's British spelling not American.

That's obvious... I wasn't complaining about the spelling but the fact that
according to the docs SetPosition() is just a synonym for Centre()
but AFAICS SetPosition() can be used to set an arbitrary position while
Centre() does what its very name says. Hence, as a matter of fact,
SetPosition() can't be just a synonym for Centre().

Shawn H Corey

unread,
Aug 2, 2015, 12:24:01 PM8/2/15
to wx-u...@googlegroups.com
On Sun, 2 Aug 2015 18:15:22 +0200
Andreas Falkenhahn <and...@falkenhahn.com> wrote:

> That's obvious... I wasn't complaining about the spelling but the
> fact that according to the docs SetPosition() is just a synonym for
> Centre() but AFAICS SetPosition() can be used to set an arbitrary
> position while Centre() does what its very name says. Hence, as a
> matter of fact, SetPosition() can't be just a synonym for Centre().

You're correct. And they take different arguments. Definitely a bug.

Vadim Zeitlin

unread,
Aug 2, 2015, 1:54:21 PM8/2/15
to wx-u...@googlegroups.com
On Sun, 2 Aug 2015 12:23:55 -0400 Shawn H Corey wrote:

SHC> On Sun, 2 Aug 2015 18:15:22 +0200
SHC> Andreas Falkenhahn <and...@falkenhahn.com> wrote:
SHC>
SHC> > That's obvious... I wasn't complaining about the spelling but the
SHC> > fact that according to the docs SetPosition() is just a synonym for
SHC> > Centre() but AFAICS SetPosition() can be used to set an arbitrary
SHC> > position while Centre() does what its very name says. Hence, as a
SHC> > matter of fact, SetPosition() can't be just a synonym for Centre().
SHC>
SHC> You're correct. And they take different arguments. Definitely a bug.

Yes, more of a Doxygen one, to be honest, but a bug nevertheless. Fixed in
https://github.com/wxWidgets/wxWidgets/commit/949d2eeaa5c9c17805fedde8c07809cae981af3e
thanks.

BTW, please don't hesitate to submit PRs for things like this, even if
you don't use wx from git, GitHub makes it trivially simple to just edit
the file directly in your browser and submit a PR in 30 seconds or less.
Reply all
Reply to author
Forward
0 new messages