Some ideas to make wxWidgets friendlier Topic is solved

This forum is reserved for everything you want to talk about. It could be about programming, opinions, open source programs, development in general, or just cool stuff to share!
Post Reply
nasu45
In need of some credit
In need of some credit
Posts: 2
Joined: Wed May 04, 2022 10:51 am

Some ideas to make wxWidgets friendlier

Post by nasu45 »

I'm learning wxWidgets. I find it interesting but can be more if:
- wxFrame's default background color should be a brighter color instead of grey color. The default Grey color make wxWidget on Windows look a bit outdated. It's better when I change the background color to nearly-white color.
- The starting guide section (Programming Guides>Starting with wxWidgets) should be extended a bit to include more basic controls: such as button, textctrl, listctrl, layout with the hope that after reading the starting guide people can develop a simple form and be able to look at more Samples. The current starting guides only show frame, menu, status bar. Makes me slightly confused when I read the Sample/Widgets code (it contains lots of widgets) and have to find more examples (such as wxSizer, wxTextCtrl and wxListCtrl) in other sections.
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Some ideas to make wxWidgets friendlier

Post by doublemax »

Hello and welcome to the forum.

First of all: This is a user forum, the core wx devs usually won't see what's written here.
- wxFrame's default background color should be a brighter color instead of grey color. The default Grey color make wxWidget on Windows look a bit outdated. It's better when I change the background color to nearly-white color.
Create a wxPanel as the only immediate child of the wxFrame. (You don't need an additional sizer. As long as the panel is the only child of the frame, it will always be stretched to fill the whole client area). Then put all other controls onto the panel.
The starting guide section (Programming Guides>Starting with wxWidgets) should be extended a bit to include more basic controls
I recommend this excellent tutorial https://zetcode.com/gui/wxwidgets
and this one to learn about sizers: http://neume.sourceforge.net/sizerdemo/
Use the source, Luke!
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4182
Joined: Sun Jan 03, 2010 5:45 pm

Re: Some ideas to make wxWidgets friendlier

Post by PB »

Regarding the default frame color. As doublemax said, there should be always a wxPanel as the only child of the wxFrame and the parent of actual controls.

This is not just a matter of color, without the panel, <tab>bing between the controls would not work.

This is probably because wxFrame is generally not supposed to be a "form" where wxDialog should be used instead where the color and tabbing are correct by default.

Regarding the minimal sample. As the name indicates this is the minimal sample. Other controls are demonstrated in the other samples, often named after the control (text, listctrl). It is true that a step-by-step tutorial is missing, but again, as doublemax already wrote, there are 3rd party tutorials for that.
nasu45
In need of some credit
In need of some credit
Posts: 2
Joined: Wed May 04, 2022 10:51 am

Re: Some ideas to make wxWidgets friendlier

Post by nasu45 »

Yes. Thanks for 3rd-party tutorial links. But I still prefer the official starting guides to include more examples (such as wxPanel if it's that necessary for a frame) someday.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4182
Joined: Sun Jan 03, 2010 5:45 pm

Re: Some ideas to make wxWidgets friendlier

Post by PB »

nasu45 wrote: Thu May 05, 2022 11:38 am ... uch as wxPanel if it's that necessary for a frame) someday.
For what it's worth, I will submit a PR adding this information to wxFrame documentation and perhaps a FAQ entry on the website.

BTW, when one uses wxFrame, which is by default resizable, as a form, IMO it would be better to use wxScrolledWindow instead of wxPanel, to make sure all the controls can be easily accessed regardless of the frame size. Here is a simple example of doing it (using wxDialog but it does not matter here): viewtopic.php?p=183153#p183153
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4182
Joined: Sun Jan 03, 2010 5:45 pm

Re: Some ideas to make wxWidgets friendlier

Post by PB »

FWIW, I have created a PR expanding wxFrame docs and suggesting to add two entries to the official wxWidgets FAQs.
Post Reply