wxWidgets n00b. Feeling Disheartened.

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.
Terran
Knows some wx things
Knows some wx things
Posts: 35
Joined: Wed Apr 30, 2008 12:35 pm

wxWidgets n00b. Feeling Disheartened.

Post by Terran » Wed Jun 18, 2008 3:30 pm

So I'm definitely new to wxWidgets, but not programming. But i feel like the learning curve for it is just so steep. I've got the "Cross-Platform GUI Programming
with wxWidgets" PDF, which seems to blow. I've read a bunch of the tutorials linked from the site, but i just can't seem to get a firm enough grip on it to make anything useful happen.

It seems that everybody just focuses on creating pretty looking widgets and i'm left out in the cold on how to make anything actually functional. Nobody goes into real depth on making the events do work for you.

I really want to make some GUI apps, but i feel really disheartened with the toolkit, and i'm considering at looking at something like QT instead that has better learning documentation.


Somebody need to write a REAL book.

catalyn269
Experienced Solver
Experienced Solver
Posts: 66
Joined: Wed Dec 12, 2007 2:40 pm
Contact:

Post by catalyn269 » Wed Jun 18, 2008 3:39 pm

I know the feeling, I'm still on the learning curve and it is steep.

Events are difficult to document since there are so many possibilities. But with some practice you will get the hang of it.

I've built a tetris game at first and used as many events as possible (keys, timer, textboxes, network ...). I had a lot of problems that seemed mind blowing at the time but I always managed to find a good answer on this forum or just by fidelling with the options.

I agree with you that the docs on event handling could be a lot better. Especially "Connect" should receive more attention since it's easier to use that the event macros.

I'm starting with Qt to hopefully be able to give a hand on the Qucs project and I think it's a lot more complicated than wxWidgets.

Don't give up, it will be worth the effort!! You'll see!!
Just me!

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

Post by DavidHart » Wed Jun 18, 2008 4:32 pm

Hi,

It's a common problem: tutorials seem to go straight from "Hello world" to "Build your own solar system", missing out the intermediate levels. However I suggest you look at the wx samples that come with the source packages. Start with 'minimal', and once you have a good understanding of what's happening and how, progress to others that do things you're interested in.
catalyn269 wrote:Especially "Connect" should receive more attention since it's easier to use that the event macros.
I suspect most people would disagree with you; a fair proportion of the questions here relate to Connect() problems. For simple things, event tables are much easier.

Regards,

David

mc2r
wxWorld Domination!
wxWorld Domination!
Posts: 1195
Joined: Thu Feb 22, 2007 4:47 pm
Location: Denver, Co
Contact:

Re: wxWidgets n00b. Feeling Disheartened.

Post by mc2r » Wed Jun 18, 2008 4:44 pm

Terran wrote:I've read a bunch of the tutorials linked from the site, but i just can't seem to get a firm enough grip on it to make anything useful happen.
The best thing I think is to start a small app and just do it. Tackle each problem you come across one at a time. If the tutorials and docs blow, which I won't argue with, search the forum here or post a question on each of the problems.
Terran wrote:It seems that everybody just focuses on creating pretty looking widgets and i'm left out in the cold on how to make anything actually functional. Nobody goes into real depth on making the events do work for you.
There isn't alot of depth to go into. The event handlers are just member functions as any other that take an event object argument(based on the type of event). You add an entry to the event table(unless you are doing something way complex but if you are left out in the cold and can't do anything start with tables), for the type of event, id of the control, and handler to call. Thats it, when whatever happens that fires the event happens the handler will be called. This is the same as anyother function call. Play with it. make an app, add a frame and a button, have the button pop up a message box.
Terran wrote:I really want to make some GUI apps, but i feel really disheartened with the toolkit, and i'm considering at looking at something like QT instead that has better learning documentation.
This has nothing to do with the toolkit and more to do with the docs and if you are so quick to give up here I don't think you will be any happier going to QT. Just my opinion.
Terran wrote:Somebody need to write a REAL book.
Yeah, they should... Are you volunteering to do so after you learn how to use the toolkit? I love when people pick on an open source effort and say SOMEBODY should do this or that. You are somebody if you aren't willing to yourself, you should be more tolerant of everyone else. The developers all have lives and jobs outside of wxWidgets.

Thats not to be a dick, or discourge you from learning widgets but to explain why the docs are as they are. The best thing I think is still to start small and write actual code, when you can't get a bit working post the code and ask questions. The forum is interactive no tutorial or book can top that.

-Max

mrmarky2
Earned some good credits
Earned some good credits
Posts: 113
Joined: Fri Apr 04, 2008 1:02 pm

Post by mrmarky2 » Wed Jun 18, 2008 4:47 pm

Thats what I thought when I first started.
What I did was used Sof's programming tutorial, but even then I still hadn't got a clue on wxWidgets. I had to ask a lot of questions on this forum, and now after about 3 months I can write programs reasonably. The only problem is I sometimes dont know what widgets there are available to use, so I sometimes write inefficient code to work round it.
Sof's programming tutorial is a good place to start, and the tetris tutorial is quite good to use as well.

Mark

Terran
Knows some wx things
Knows some wx things
Posts: 35
Joined: Wed Apr 30, 2008 12:35 pm

Re: wxWidgets n00b. Feeling Disheartened.

Post by Terran » Wed Jun 18, 2008 6:13 pm

mc2r wrote:
Terran wrote: Yeah, they should... Are you volunteering to do so after you learn how to use the toolkit?
-Max
Yes, if i'm ever at that level. I'm surprised somebody else already hasn't.

It seems to make sense, but when i sit down to work with it, all i'm seeing is a bunch of widgets with no interaction, and no-sense on how to make them interact.

Sure i can us wxFormbuilder and make what i want for a basic program, but adding functionality seems to go out the window.

mc2r
wxWorld Domination!
wxWorld Domination!
Posts: 1195
Joined: Thu Feb 22, 2007 4:47 pm
Location: Denver, Co
Contact:

Re: wxWidgets n00b. Feeling Disheartened.

Post by mc2r » Wed Jun 18, 2008 6:52 pm

Terran wrote:Yes, if i'm ever at that level. I'm surprised somebody else already hasn't.
Kudos for that, most would be content to complain and leave it at that.

Maybe thats a place for you to start. Figure out what it is that you would like answered for yourself. How do the components interact for instance. Start by making yourself a small app that will answer that for you. In this example an app with a single frame and a button to start. have the button pop up a message box. Then add to it. maybe a text control. Document as you go.

Post any questions you have here, you should get a fair amount of help.

As an aside everyone learns in their own way I know, but I've found that there is no substitue for sitting down and writting code for learning something. And yes it nothing you do will work at first, unless you have better luck than me ;)

-Max

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria » Wed Jun 18, 2008 6:57 pm

I'd also like to point that the wiki contains lots of very short samples that are likely easier to understand than the huge samples included in wx.

I myself learned by reading the samples and trying.

I may come to write a serie of wxWidgets tutorial someday if I have time... but I just don't have this time right now ;)

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Thu Jun 19, 2008 7:09 am

Hi!
Coming from the "pre wxWidget book era" I know that getting information can sometimes be hard.

I have the feeling that David is right: You can't build a car if you know how the motor works. It's especially hard if you had no clue what the car might look like.

I don't really know what application you want to write, except that it should be a "real" application. I remember my first "real" wxWidgets application was a small simulation. But before I actually started working on that, I spend a lot of time trying out the samples, writing small modifications and coding up a simple tictactoe, just to see how things work. wxWidgets is a GUI toolkit in the first place, so better concentrate on that, rather then reading and worrying about things like socket, threads, etc.

BTW: Besides that the book is indeed not too well suited for a beginner, it is a good reference later on. There is a tutorial which I think is great, as it covers many aspects and presents a working application in the end. That's why we link to it in the top bar (http://zetcode.com/tutorials/wxwidgetstutorial/).

About switching to Qt: Well, it wouldn't hurt to check it out. I worked with a fairly old version of it for a rather large project and I was happy to be back with wxWidgets after that. True, there may be more documentation and things are done more "graphically", but IMHO there is nothing in Qt that wxWidgets doesn't offer. You might also want to have a look at MFC. Although I suppose Microsoft is about to drop it, it isn't bad. In addition to that MFC and wxWidgets share some similarities.

Still it would be nice to know what application you are planning to write. Maybe we can give you some pointers and advice on this.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

Terran
Knows some wx things
Knows some wx things
Posts: 35
Joined: Wed Apr 30, 2008 12:35 pm

Post by Terran » Fri Jun 20, 2008 1:48 am

Well lets say i want to make a scheduler program, wherer you can add and delete items on a wxCalenderCtrl, so i have the program made where a wx calender control and a menu comes up, but i'm not really sure how to make the events tables work, and i'm really not sure where to add the object arrays that will store the information for each date on the calender. ect.

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Fri Jun 20, 2008 7:48 am

Terran wrote:so i have the program made where a wx calender control and a menu comes up, but i'm not really sure how to make the events tables work,
Check the wxBook again, have a look at the samples, read the tutorial I mentioned.
IMHO The book has a good chapter about event handling.
Terran wrote:and i'm really not sure where to add the object arrays that will store the information for each date on the calender. ect.
Not a wxWidgets problem. How would you do that in C++, not using wxWidgets? Maybe write a class to handle one entry and store it in a vector, or use a database...
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Fri Jun 20, 2008 8:18 am

Following this discussion on the side line I have the feeling your C++ knowledge is not yet up the par. I think you are confusing what you can do with wxWidgets and what you need to do yourself in order to get the bare bone part of your application. Remember that wxWidgets is all about the GUI, with some helper objects to make it easier for you to integrate with your data.

I would suggest to put wxWidgets aside for now, and only use C++. In C++ make your scheduler as simple as possible as a console project. This way you are focused on the data model first with all helper functions. Consider the wxCalenderCtrl as a view of our data, nothing else. So under the hood you will have scheduler ojects that have an interval on which they need to run, and possibly a fixed date to run them on.

Try to draw in UML your object model on paper, in your mind, run the application as a user doing various tasks like adding new schedule entries, letting the scheduler run, and deleting scheduler entries. Make the methods in your objecs as they are needed. Then, when yu feel confident you have teh skeleton code of your model, fill in most methods and test them with simple pieces of code in your main() function. When that works, go back to wxWidgets and set up your application and integrate your data model.

Doing both at the same time when both concepts (C++ and wxWidgets) are new, will onyl confuse you and as you said, discourage and leave you dishearthed.

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

dynamoman
Knows some wx things
Knows some wx things
Posts: 32
Joined: Sun Aug 26, 2007 2:38 pm

I agree with the admins

Post by dynamoman » Fri Jun 20, 2008 5:04 pm

I started with wxWidgets last year but in this year is when I really started using them, at first they are confuse, but I dont remember having that much of trouble, and the forums are a great place to hang around, I dont have the knowledge to help a lot of the people around here, but I try whenever I can.

So feel free to ask, but I think wxWidgets(like many other GUISDK) requires a good understanding of C++, but dont feel bad, just try to do what you can, and if you dont get something, just ask.

Terran
Knows some wx things
Knows some wx things
Posts: 35
Joined: Wed Apr 30, 2008 12:35 pm

Post by Terran » Sat Jun 21, 2008 12:24 am

it's not so much that my c++ isn't up to par as it is that i have trouble understanding the heirarchy of the wxWidgets form. I understand the idea of declaring the class data sturcture, but i'm not yet exactly sure how some of the functions interact.

Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria » Sat Jun 21, 2008 12:54 am

Terran wrote:it's not so much that my c++ isn't up to par as it is that i have trouble understanding the heirarchy of the wxWidgets form. I understand the idea of declaring the class data sturcture, but i'm not yet exactly sure how some of the functions interact.
which ones? precise questions are often more helpful than abstract debates over documentation

Post Reply