Hi,
I'm planning on using C for a project of mine, but need a cross platform GUI so wxWidgets seems to be a good one. Can I code the backend seperatley and plugin the GUI to it like that? Or does it all have to be coded together and in C++. As I barely know C yet, let alone C++.
Thanks in advance for answers.
C backend whilst using wxWidgets
-
- In need of some credit
- Posts: 3
- Joined: Mon Sep 18, 2006 10:32 am
- Location: UK, Bucks.
- Contact:
As you barely know C, why bother coding in it, rather go straight for learning C++ and picking up C along the way (ie where necessary). C is not a necessary pre-requisite for learning C++ (some would say a hinderance).
You will find that using the wxWidgets libraries and samples along with some good C++ tutorials, you will be able to produce something constructive while you learn.
During the learning phase you will write some horrible code, but if it works you've achieved something. Having the discipline to revise your code as your learning progresses is very valuable.
You will find that using the wxWidgets libraries shields you from a lot of learning that to start with can seem somewhat daunting.
Have fun and good luck
Peter
You will find that using the wxWidgets libraries and samples along with some good C++ tutorials, you will be able to produce something constructive while you learn.
During the learning phase you will write some horrible code, but if it works you've achieved something. Having the discipline to revise your code as your learning progresses is very valuable.
You will find that using the wxWidgets libraries shields you from a lot of learning that to start with can seem somewhat daunting.
Have fun and good luck
Peter
Using Win XP, Dev C++ 4.9.9.2 wx-beta 6.9
-
- In need of some credit
- Posts: 3
- Joined: Mon Sep 18, 2006 10:32 am
- Location: UK, Bucks.
- Contact:
Thank-you for your comments, I'd really like to know C and I have a lot of reference material, I know how to solve my problem in C already practically. I know how to code the algorithm that is, and my sorting routines shouldn't be hard either.
I was wandering really if there is some standard way of seperating a GUI and the backend code, like variables in the commandline that the GUI will select or such. (Since I'm sure this is probably at the end of all my C books)
This way I can begin coding my solution and then learn the relevant C++ to help with coding the GUI in wxWidgets.
Thanks.
I was wandering really if there is some standard way of seperating a GUI and the backend code, like variables in the commandline that the GUI will select or such. (Since I'm sure this is probably at the end of all my C books)
This way I can begin coding my solution and then learn the relevant C++ to help with coding the GUI in wxWidgets.
Thanks.
"standard" not, but probably the most common one...Dead1nside wrote: I was wandering really if there is some standard way of seperating a GUI and the backend code, like variables in the commandline that the GUI will select or such. (Since I'm sure this is probably at the end of all my C books)
in your GUI/cmd line app, write one (or several if you think it's better) function(s) to handle the command line/graphical options.
create a class to perform your task, call it with the needed parameters (or option structure).
therefore, you can call your working class from a GUI/CLI app (even from a component-oriented container), and it just has the knowledge of its needed parameters.
of course, the working class can be replaced by a set of classes, and you can have several options structures (display options, working options, verbose/debug modes...)
Note: wxWidgets already has a command line parser class to make the arguments parsing easier. It works well. Thus, you don't need to play with argc/argv.
-
- In need of some credit
- Posts: 3
- Joined: Mon Sep 18, 2006 10:32 am
- Location: UK, Bucks.
- Contact:
From the looks of the two responders above (thank-you very much for your replies); it looks like I should straight away look into wxWidgets first, as it provides ways around these non-standard techniques that were mentioned.
I haven't really done much OOP before so some of those terms were a bit misty in my head.
Thanks for the advice.
I haven't really done much OOP before so some of those terms were a bit misty in my head.
Thanks for the advice.