Adding page dynamically does not work on Windows

38 views
Skip to first unread message

Gatti Gianluca

unread,
Jun 16, 2026, 8:24:21 AM (8 days ago) Jun 16
to wx-u...@googlegroups.com
Hello,

I have a problem adding dynamically a page (a Panel) on a notebook (a wxAuiNotebook): on Linux it does work correctly, while on Windows does not work. It does not show the page (with its internal widgets) I added.

This is the line of code (I think it is not necessary share all the source code):

    _my_dialog->m_auinotebook1->AddPage(new MyPanel(_my_dialog), "");

I tried whith wxWidgets version 3.3.2 and 3.2.10.
The compiler I used is GCC (with Mingw on Windows).

As I said before, on Linux (Ubuntu 24) it does work, therefore I can not understand the problem.

Thank you in advance for your suggestions.

    Gianluca Gatti

Vadim Zeitlin

unread,
Jun 16, 2026, 8:33:20 AM (8 days ago) Jun 16
to wx-u...@googlegroups.com
On Tue, 16 Jun 2026 12:06:05 +0000 Gatti Gianluca wrote:

GG> This is the line of code (I think it is not necessary share all the source code):

Hello,

In general it's really best to provide a full, self-contained example
reproducing the problem, please see our bug reporting guidelines for details:

https://wxwidgets.org/develop/how-to-report-issues/

GG>     _my_dialog->m_auinotebook1->AddPage(new MyPanel(_my_dialog), "");

But in this case this line is indeed enough to show the problem: MyPanel
must use wxAuiNotebook as its parent, not the dialog. It's actually strange
that using a wrong parent doesn't result in an assert failure, I think it
should.

GG> As I said before, on Linux (Ubuntu 24) it does work

The promise of wxWidgets is that correct code will work on all the
supported platforms, it's too difficult to guarantee that wrong code fails
in the same way everywhere.

Regards,
VZ

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

Gatti Gianluca

unread,
Jun 16, 2026, 8:47:32 AM (8 days ago) Jun 16
to wx-u...@googlegroups.com
No, even so it does not work:

    _my_dialog->m_auinotebook1->AddPage(new MyPanel(_my_dialog->m_auinotebook1), "");

What could be wrong?
Thank you,

    Gianluca




Da: wx-u...@googlegroups.com per conto di Vadim Zeitlin
Inviato: Martedì, 16 Giugno, 2026 14:33
A: wx-u...@googlegroups.com
Oggetto: Re: Adding page dynamically does not work on Windows

On Tue, 16 Jun 2026 12:06:05 +0000 Gatti Gianluca wrote:

GG> This is the line of code (I think it is not necessary share all the source code):

 Hello,

 In general it's really best to provide a full, self-contained example
reproducing the problem, please see our bug reporting guidelines for details:



GG>     _my_dialog->m_auinotebook1->AddPage(new MyPanel(_my_dialog), "");

 But in this case this line is indeed enough to show the problem: MyPanel
must use wxAuiNotebook as its parent, not the dialog. It's actually strange
that using a wrong parent doesn't result in an assert failure, I think it
should.

GG> As I said before, on Linux (Ubuntu 24) it does work

 The promise of wxWidgets is that correct code will work on all the
supported platforms, it's too difficult to guarantee that wrong code fails
in the same way everywhere.

 Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support

Vadim Zeitlin

unread,
Jun 16, 2026, 9:06:10 AM (8 days ago) Jun 16
to wx-u...@googlegroups.com
On Tue, 16 Jun 2026 12:47:23 +0000 Gatti Gianluca wrote:

GG> No, even so it does not work:
GG>
GG>     _my_dialog->m_auinotebook1->AddPage(new MyPanel(_my_dialog->m_auinotebook1), "");
GG>
GG> What could be wrong?

I don't know, you'd need to make a self-contained example or a small patch
reproducing the problem in the aui sample.

Regards,
VZ

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

Gatti Gianluca

unread,
Jun 16, 2026, 9:21:30 AM (8 days ago) Jun 16
to wx-u...@googlegroups.com
I send you my source code in attachment.
Thank you,
Gianluca



Da: wx-u...@googlegroups.com per conto di Vadim Zeitlin
Inviato: Martedì, 16 Giugno, 2026 15:06
A: wx-u...@googlegroups.com
Oggetto: Re: R: Adding page dynamically does not work on Windows

src.zip

Gatti Gianluca

unread,
Jun 17, 2026, 3:02:08 AM (7 days ago) Jun 17
to Larry Bruce Daniel, wx-u...@googlegroups.com
Thank you Bruce for the answer; but, from a practically point of view, what does it mean? How can I increase the stack on Windows to fix the problem?
It is a very minimal program, so I'm surprised that this can not work on Windows.

Thank you,
Gianluca

Da: Larry Bruce Daniel <larrybruc...@gmail.com>
Inviato: martedì 16 giugno 2026 16:43
A: Gatti Gianluca <Gianluc...@fincantierinxt.it>
Oggetto: Re: Adding page dynamically does not work on Windows
 
Linux has a larger stack than Windows On 6/16/26 8: 06 AM, Gatti Gianluca wrote: Hello, I have a problem adding dynamically a page (a Panel) on a notebook (a wxAuiNotebook): on Linux it does work correctly, while on Windows does not work. It
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
 
ZjQcmQRYFpfptBannerEnd

Linux has a larger stack than Windows

--
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
---
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wx-users+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/wx-users/DU0PR10MB572810F0BD45DFB97C578D0C9EE52%40DU0PR10MB5728.EURPRD10.PROD.OUTLOOK.COM.

Gatti Gianluca

unread,
Jun 18, 2026, 2:41:48 AM (6 days ago) Jun 18
to Larry Bruce Daniel, wx-u...@googlegroups.com
I tried to increase the stack size changing the compiling options, but the result is the same.

I think that maybe this is not the root of the problem, also because the object I use are pointers, therefore allocated on the heap.

Does anyone have any suggestions?
Thank you very much,
Gianluca



Da: Gatti Gianluca <Gianluc...@fincantierinxt.it>
Inviato: mercoledì 17 giugno 2026 09:01
A: Larry Bruce Daniel <larrybruc...@gmail.com>
Cc: wx-u...@googlegroups.com <wx-u...@googlegroups.com>
Oggetto: R: Adding page dynamically does not work on Windows
 

Maarten Bent

unread,
Jun 18, 2026, 2:37:07 PM (6 days ago) Jun 18
to wx-u...@googlegroups.com
Hi, I see two problems.

The dialog that is created doesn't have a size, adding _my_dialog->Fit(); shows its contents.
Your example creates a MyDialog instead of a MyFrame, which results in the app never exiting when closing the dialog.

Regards,
Maarten
--
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
---
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wx-users+u...@googlegroups.com.

Gatti Gianluca

unread,
Jun 19, 2026, 2:28:12 AM (5 days ago) Jun 19
to wx-u...@googlegroups.com
Thank you very much Maarten, the Fit() method solves the problem (on Ubuntu it is not needed...).

(For the other issue you mention: it is just a test, just to give Myframe as the parent of MyDialog...)

Thank you,
Gianluca



Da: wx-u...@googlegroups.com <wx-u...@googlegroups.com> per conto di Maarten Bent <maart...@gmail.com>
Inviato: giovedì 18 giugno 2026 20:37
A: wx-u...@googlegroups.com <wx-u...@googlegroups.com>
Oggetto: Re: R: R: Adding page dynamically does not work on Windows
 
Hi, I see two problems. The dialog that is created doesn't have a size, adding _my_dialog->Fit(); shows its contents. Your example creates a MyDialog instead of a MyFrame, which results in the app never exiting when closing the dialog. Regards,
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
 
ZjQcmQRYFpfptBannerEnd
Reply all
Reply to author
Forward
0 new messages