Page 1 of 1

Newbie question

Posted: Thu Feb 02, 2017 7:13 am
by Thunderchook
Hi all,

I'm reasonably proficient in C++ but completely, totally and utterly new to writing GUI applications.
WxWidgets is my first foray into GUI development.

So, here it is - I am struggling with the part I thought would be the simplest and most intuitive- the GUI form builder.
Dragging and dropping items like buttons etc, resizing them etc. (They all seem to just pop back into a predermined size and ignore my attempts to resize them!)

Can anyone point me to a tutorial that might make this a little more clear to me?

Any help would be appreciated.

Re: Newbie question

Posted: Thu Feb 02, 2017 8:12 am
by doublemax
As different OS have very different default control sizes, using absolute sizes and positions does not make sense for a cross-platform development framework. wxWidgets uses so called "sizers" for automatic layout. Understanding sizers is often difficult for new wxWidgets users, but once you get to know them, you'll appreciate them :)

Even if it may sound too complicated in the beginning, i'd recommend to start building layouts by writing the sizer code directly. Once you understand how sizers work, it'll be easier to build layouts using a GUI editor.

Re: Newbie question

Posted: Thu Feb 02, 2017 8:30 am
by Thunderchook
Yes, amongst the copious piles of documentation, I detected a general gist of this, but found no clear "Dummies' Guide."

Many thanks for your help.

Re: Newbie question

Posted: Sun Feb 05, 2017 12:37 pm
by Thunderchook
Still struggling to just... get going on wxWidgets.

I've read through and tried to follow a number of tutorials etc but they often give small bits of fragmented code.
When I fire up a basic wxWidgets project in Code::Blocks (on Ubuntu), it provides a large amount of code pre-supplied in a number of files.
I'd really like a "From scratch" dummies guide that starts blank, explains the different files, file structures, files supplied and their purpose, pre-supplied code, what needs to be added, what is redundant, what can simply be changed etc.

Scouring through the different tutorials I see several different things but nothing that clearly goes through the numbers.

Does such a tutorial/book exist?



Re: Newbie question

Posted: Sun Feb 05, 2017 12:56 pm
by DavidHart
I'd really like a "From scratch" dummies guide that starts blank
That isn't really possible. Any gui toolkit will inevitably come with stuff that's needed just to interact with the bits that actually do the work. Using the analogy of a car, whatever design you come up with for its shape/colour/seating, it's going to need wheels, tyres, axles, an engine etc if it's to be of any use.

I suggest you ignore the bits that are needed to get it to work, and ignore the tutorials too (they're often dated or buggy). Instead look at the samples that come with the wx source-code; on ubuntu they are in the wx3.0-examples package which installs to /usr/share/doc/wx-examples/. Look at 'minimal' first. As its name suggests, it's the smallest possible wx gui app that you'll get. Examining the source, which is commented, should give you a feel for what's going on.

Many people (i.e. me) get started by taking one of those samples and gradually altering it to do extra things until it becomes your intended project.



Re: Newbie question

Posted: Sun Feb 05, 2017 1:00 pm
by doublemax
There is the wxWidgets book, it's a little outdated, but most things still apply: ... 6_book.pdf

I think this tutorial is pretty good to understand the basic concepts:

Before you start with a big IDE like CodeBlocks that also uses a dialog editor, build the "minimal" sample from the command line and try to understand every single line in it. What it does what's it good for. Then you have a good basis to continue.

Re: Newbie question

Posted: Tue Feb 07, 2017 8:14 am
by Thunderchook
Thanks doublemax!

The link has been most helpful and the fuzzy picture is starting to become clearer.
I wasn't expecting to got back to my purist days of non-IDE development, but I am happy to do so, if it teaches me what I need to know.

Again, many thanks.