christianjayleoncio
Posts: 9
Joined: Mon Nov 10, 2014 3:22 am

GUI using C++

Wed Nov 12, 2014 12:24 am

So I have this project that involves raspberry pi. I need to create a GUI on it using C++. I believe that the pre-installed IDLE is for python. How can I acquire a C++ programming language on my Raspberry or something that I can use to create a GUI using a C++ language. Btw, I used NOOBS in installing OS for my raspberry.

knute
Posts: 550
Joined: Thu Oct 23, 2014 12:14 am
Location: Texas
Contact: Website

Re: GUI using C++

Wed Nov 12, 2014 2:45 am

I installed from NOOBS, the C++ compiler is in there already.

beta-tester
Posts: 1373
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: GUI using C++

Wed Nov 12, 2014 6:22 am

you can install code:blocks

Code: Select all

sudo apt-get -y --force-yes install codeblocks
. you can use its IDE under LXDE.
but i don't know if there is a tool for design GUI elements... like under windows with VisualStudio.
maybe Qt has such a tool that runs on the RPi as well.
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

beta-tester
Posts: 1373
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: GUI using C++

Tue Dec 16, 2014 8:06 am

or try glade
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

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

Re: GUI using C++

Tue Dec 16, 2014 10:08 am

beta-tester wrote:or try glade
Have YOU tried glade ?
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

beta-tester
Posts: 1373
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: GUI using C++

Tue Dec 16, 2014 9:41 pm

PeterO wrote:Have YOU tried glade ?
no, not yet... i just found the "tool", if i find time, i will give it a try.
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

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

Re: GUI using C++

Wed Dec 17, 2014 9:20 am

beta-tester wrote:
PeterO wrote:Have YOU tried glade ?
no, not yet... i just found the "tool", if i find time, i will give it a try.
Last time I tries it was so slow it was pretty much unusable on a PI.

However if you have a faster Linux PC you can use that to design your GUI and just use the resulting xml gui description file on the PI at run time.

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

PiGraham
Posts: 3929
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: GUI using C++

Wed Dec 17, 2014 9:31 am

The OP is asking for means to create a GUI for Pi, not necessarily to run such tools on a Pi, and not to have a GUI IDE running on Pi. Glade might be appropriate. Presumably you can run it on a more capable machine and cross compile for Pi.

QT4/5 is another option. IIRC QT4 is available and ready to go for Rasbian. QT5, with GPU support, can be built for Pi. Again development is probably best done on another machine.
wxWidgets is another option discussed here http://www.raspberrypi.org/forums/viewt ... 5&p=292883

Tzarls
Authorised Reseller
Authorised Reseller
Posts: 248
Joined: Tue Feb 26, 2013 6:59 am

Re: GUI using C++

Wed Dec 17, 2014 9:37 am

I've used fltk. I develop using windows and/or Linux and then transfer source files to the Rpi and build there using code::blocks or just gcc and a makefile. It works just fine and it includes a tool called "fluid" which lets you create GUIs visually and then it gives you the source for that GUI.

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

Re: GUI using C++

Wed Dec 17, 2014 9:41 am

PiGraham wrote:The OP is asking for means to create a GUI for Pi, not necessarily to run such tools on a Pi, and not to have a GUI IDE running on Pi. Glade might be appropriate. Presumably you can run it on a more capable machine and cross compile for Pi.
See my answer two posts above....

And since you don't seem to know much about Glade.... It writes an xml file that describes the GUI and the callbacks to use when things happen. At run time the xml is parsed by GtkBuilder and the windows and widgets created. Callbacks are automatically linked to the specified handlers.

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

PiGraham
Posts: 3929
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: GUI using C++

Wed Dec 17, 2014 10:14 am

PeterO wrote:
PiGraham wrote:The OP is asking for means to create a GUI for Pi, not necessarily to run such tools on a Pi, and not to have a GUI IDE running on Pi. Glade might be appropriate. Presumably you can run it on a more capable machine and cross compile for Pi.
See my answer two posts above....

And since you don't seem to know much about Glade.... It writes an xml file that describes the GUI and the callbacks to use when things happen. At run time the xml is parsed by GtkBuilder and the windows and widgets created. Callbacks are automatically linked to the specified handlers.

PeterO
No disagreement there, is there? You are saying Glade is fine for creating GUIs to run on Pi if you develop on a faster machine. Yes?

Return to “Beginners”