Newbie question

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
Thunderchook
Earned a small fee
Earned a small fee
Posts: 17
Joined: Wed Feb 01, 2017 9:59 am

Newbie question

Post 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.
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Newbie question

Post 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.

http://docs.wxwidgets.org/trunk/overview_sizer.html
http://neume.sourceforge.net/sizerdemo/
Use the source, Luke!
Thunderchook
Earned a small fee
Earned a small fee
Posts: 17
Joined: Wed Feb 01, 2017 9:59 am

Re: Newbie question

Post 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.
Thunderchook
Earned a small fee
Earned a small fee
Posts: 17
Joined: Wed Feb 01, 2017 9:59 am

Re: Newbie question

Post 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?

Thanks.

Thunderchook.
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: Newbie question

Post by DavidHart »

Hi,
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.

Regards,

David
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Newbie question

Post by doublemax »

There is the wxWidgets book, it's a little outdated, but most things still apply:
https://ptgmedia.pearsoncmg.com/images/ ... 6_book.pdf

I think this tutorial is pretty good to understand the basic concepts:
http://zetcode.com/gui/wxwidgets/

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.
Use the source, Luke!
Thunderchook
Earned a small fee
Earned a small fee
Posts: 17
Joined: Wed Feb 01, 2017 9:59 am

Re: Newbie question

Post by Thunderchook »

Thanks doublemax!

The zetcode.com 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.
Post Reply