Question:
How to write apps that are gui apps In C/C++?
anonymous
1970-01-01 00:00:00 UTC
How to write apps that are gui apps In C/C++?
Three answers:
jplatt39
2009-07-06 15:22:47 UTC
Okay if you are coding for GNU/Linux, then what you want to learn is how to code for X-Windows.



Marshall's e-book is still one of the classics. It covers Motif which if you are using Ubuntu you will probably have to install but...



http://w0.sao.ru/hq/sts/linux/book/xbook_marshall/index.html



Kenton Lee's X Windows site hasn't been updated (apparently) in years but it STILL MATTERS:



http://www.rahul.net/kenton/xsites.framed.html



For the time being though, coding either windows or X-Windows in C++ is HARD. Try using the scripting language TCL/TK (even though it's based on LISP).



http://tldp.org/HOWTO/Scripting-GUI-TclTk/



If you have Fedora it's probably already installed, if Ubuntu, you'll have to install it through synaptic -- but believe me, it's WORTH it.
DC2000
2009-07-06 15:17:18 UTC
I would start with Allegro. It is a game programming library but it does include a very rudimentary GUI, it would be a good place to start I would think.
anonymous
2009-07-06 15:21:09 UTC
I'd recommend using wxWidgets for C++ applications, or GTK+ for plain C.



Why?

They're cross platform (No point in learning something that you can't take with you)

They're documented (you'd be surprised to see how many aren't)

They're quite popular, so you won't have trouble finding samples.

They're pretty straightforward to use.



And a protip: Grab yourself a copy of the Code::Blocks IDE. It has a built in wxWidgets form designer which will save you tonnes of time. You basically drag and drop each component you want on the form, using separators to place them where you want, and then just add code to the event when they're clicked (The IDE will create the code templates for you).

Code::Blocks itself is written using wxWidgets, so you can see how capable it is.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...