what is the correct way: scrolledwindow in a notebook page

24 views
Skip to first unread message

acwn...@gmail.com

unread,
Mar 13, 2025, 4:37:36 PM3/13/25
to wx-users
Hi,
I would like to add a scrolledwindow as a top panel of a notebook page.
What I have:

wxNotebook *f_notebook = new wxNotebook (f_toppanel, wxID_ANY);
wxScrolledWindow *f_scrolled_window = new wxScrolledWindow (f_notebook, wxID_ANY);
wxPanel *f_credentials_panel = new wxPanel (f_scrolled_window, wxID_ANY);
wxFlexGridSizer *f_credentials_sizer = new wxFlexGridSizer (7, 2, 2, 2);
... fill the sizer with widgets ...
f_credentials_panel->SetSizer (f_credentials_sizer);
f_notebook->AddPage (f_scrolled_window, "Credentials");


All I get is a white rectangle with no widgets.
Can somebody please explain how I can do it the correct way?

TIA
Alexander

Kenneth Porter

unread,
Mar 13, 2025, 7:43:39 PM3/13/25
to wx-u...@googlegroups.com
I find it useful to mock up my GUI code using wxFormBuilder. In most
cases I can simply derive from the generated classes. In cases where I
need to dynamically create controls, I use it to create a prototype and
then copy and paste what I need into my dynamic code.

Add a suffix to the generated class like _FB. For example, design your
dialog as MyDialog_FB and then, in a separate pair of cpp/h files,
define your logic in a class MyDialog that inherits MyDialog_FB.


acwn...@gmail.com

unread,
Mar 14, 2025, 8:16:16 AM3/14/25
to wx-users
That solved my problem. Thank you very much for your help.
Reply all
Reply to author
Forward
0 new messages