travisfarmer
Posts: 4
Joined: Sun Jan 07, 2018 9:33 pm
Location: Maine, USA
Contact: Website

GUI C++ programing for a Rpi 3, and a CM3L

Mon Feb 05, 2018 9:21 pm

what do i need to learn how to write GUI C++ applications for my Pi 3 and my CM3L? i am assuming i will need to use the WiringPi library, as i am most familiar with coding C++ on an Arduino. my only GUI programming experience is MS Visual Basic 6 (and i realize that bears no resemblance to C++ ;) ).

so, back on task. lets assume i have a fresh install of Rasbien on my Pi 3, and a bare 8GB SD card for my CM3L (with a cheap Chinese IO board, as that is what i could afford). i do have Linux experience, as my PWS is currently running CentOS Linux 7, and it seems to be running quite happily. :D though i have not done any GUI programming on it (no GUI installed, it is a server after all ;) ).
my project could be done on an Arduino, but the Arduino lacks the graphical interface, and many of the enjoyable parts of running Linux. i have a camper that i have converted to be a mobile utility building, of sorts. I have a 4 foot CNC router in there, and i will soon have a base for my internet radio station, as well as my Ham radio station (when i am issued my call-sign from the FCC). i would like to build a complete automation system using Arduinos for the main I/O, with an Rpi as the graphical interface to control such things as the lighting, security alarm, power for my CNC router, etc... sure, i could do all this without any automation, but what is the fun in that?

so, my working environment. i currently do all my coding on my Win10 ( :cry: ) laptop, as it is more comfortable than having to power up the Rpi every time i wish to do some coding, and that is how i code for my Arduino projects. the IDE i use is Code Blocks ( http://codeblocks.org/ ), as i am used to it. i have no problem in having to do the compile on the actual Rpi.

so what is included on Rasbien to do what i need, and what do i need to add? and secondly, what is the best resource for learning GUI C++?

and fear not, whatever i come up with for code, i strongly believe in Open Source, and it will all go onto my GitHub :D

~Travis

User avatar
topguy
Posts: 4429
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: GUI C++ programing for a Rpi 3, and a CM3L

Mon Feb 05, 2018 11:52 pm

The most common GUI frameworks on linux is (probably as far as I can tell):
- FLTK ( https://en.wikipedia.org/wiki/FLTK )
- wxWidgets ( https://en.wikipedia.org/wiki/WxWidgets )
- Qt ( https://en.wikipedia.org/wiki/Qt_(software) )
- GTK+ ( https://en.wikipedia.org/wiki/GTK%2B )

And all 4 can also be programmed on Windows too.

travisfarmer
Posts: 4
Joined: Sun Jan 07, 2018 9:33 pm
Location: Maine, USA
Contact: Website

Re: GUI C++ programing for a Rpi 3, and a CM3L

Tue Feb 06, 2018 9:29 pm

ok, thanks. i will check those out. :)

~Travis

ksharindam
Posts: 50
Joined: Sat Jan 09, 2016 4:16 pm

Re: GUI C++ programing for a Rpi 3, and a CM3L

Sat Feb 10, 2018 8:19 am

I think Qt will be best.
And please dont use GTK, it is very complicated.

Qt is not only a modern Gui library and also a large development framework. It has smart signal-slot system for function callback. It makes many things easier, such as multithreading, creating plugins ... etc.

User avatar
PeterO
Posts: 4167
Joined: Sun Jul 22, 2012 4:14 pm

Re: GUI C++ programing for a Rpi 3, and a CM3L

Sat Feb 10, 2018 8:47 am

ksharindam wrote:
Sat Feb 10, 2018 8:19 am
I think Qt will be best.
And please dont use GTK, it is very complicated.
I think Gtk will be best.
And please don't use Qt, it is very complicated.
PeterO ;)
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),Aeromodelling,1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

jahboater
Posts: 2650
Joined: Wed Feb 04, 2015 6:38 pm

Re: GUI C++ programing for a Rpi 3, and a CM3L

Sat Feb 10, 2018 8:59 am

:)

GTK is easy to install with apt.
QT is more fun to install :(

spin
Posts: 1
Joined: Mon May 18, 2015 6:16 pm

Re: GUI C++ programing for a Rpi 3, and a CM3L

Sat Feb 10, 2018 9:04 am

If you like OOP, maybe Gtkmm is also a good choice: https://www.gtkmm.org/en/.
All you have to do is install libgtkmm-3.0-dev.
I find it easier to use than the Gtk+ Api.
You can also use glade to develop your interface very quickly: https://glade.gnome.org/.
Gtkmm loads the .glade file directly using a Gtk builder, then you can use all the goodness of OOP to connect all the events (button clicks, etc.) to your functions.

Return to “C/C++”

Who is online

Users browsing this forum: No registered users and 6 guests