ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm interested in writing a small project for the sake of learning how to do it. I would like to use c++ and glade.
I've been downloading source code for other projects as reference and would like to know a few things.
- what are *.h header files? Are they written or generated?
- I can't find a main or parent *.cpp file for running the application in any of the source code that I've downloaded (inkscape and ktoon). Is there a main file? Where should I be looking for it? If there is not a main file, how does the application know what to do when it is started?
- I'm not able to find any file(s) containing window or gui information. Should there be a file there? What should I be looking for? How is the gui generated?
Thanks for any information that you might provide related to these or any other things that I ought to know about.
Header files in C++ are written by you. They generally contain your classes and such. Helps the keep the code organized as opposed to having a GIANT main.cpp.
There isn't always a main.cpp. Well, there is a cpp file that starts the program, but its rarely called main in real programs. At least the program I've looked through the code for.
There are files that contain the GUI information, though I don't know where they're at or what they're called. Outside of VB I've never actually coded a GUI.
How familiar are you with C++ and programming in general? I think it would be best if you stepped back and looked at some simpler code. Taking a course or buying a book would a nice start.
If you're not familar with C++, I would urge you to consider another language to start with. C++ is a very complex language, and the learning curve may be a little daunting.
If you are certain you want to use C++, try looking at simpler examples than inkscape (I'm not sure about ktoon). This is a pretty big app, and you'll quickly get lost in the code if you're not careful.
I am familiar with c++ to the extend that I have taken a class in it. The problem is that I've only written one file for each program that I've written. In order to get the 'real world' c++ experience I want to make something larger. I have written some small c++ files that use glade/gladmm to create an interface. These only consist of one file, and so I haven't invested any time in tying the event-handlers to any process. I understand how that works and I just want to know the answers to these other questions.
I do understand inkscape's and ktoon's code. I need to know where the parent/main file is that is, the one that is calling the various classes and functions, in order to _fully_ understand how everything is working. **edit, I found inkscapes main *.cpp file. It resides as src/application/application.cpp
Now I just need to know more about how the gui is being generated. obviously inkscape does not use glade.
Last edited by fatblueduck; 12-07-2006 at 03:15 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.