VSWizzard
Posts: 8
Joined: Wed Dec 16, 2015 8:55 am

GUI with C

Fri Jan 08, 2016 10:03 am

Hello dear Raspberry-Fans

Can you recommend me a good program to create a GUI on the Raspberry Pi 7" Touchscreen, where you can easy communicate with the GPIO from the Raspberry Pi B+? Thing is we want to make a GUI for a quiz-game we work on at the moment. And for example if a high-signal is detected on an input-port, we want to change something on the screen, for example a countdown starts on the screen.

Looking forward to your answers.

Sincerely VSWizzard.

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: GUI with C

Fri Jan 08, 2016 10:19 am

There's two ways.

You could use a web browser with a local server and create the pages in a Python program.

You could build it as a normal C GUI application using a toolkit such as QT (which is installed as standard IIRC.)

It depends on what other features you need and where your skill-set lies.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6074
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: GUI with C

Fri Jan 08, 2016 10:26 am

Using Qt with C would be fairly tricky. I think it would have to be GTK or wxWidgets instead.

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: GUI with C

Fri Jan 08, 2016 11:11 am

Sorry, I tend to use "C" as a general class. QT is fine with C++, but yes you would struggle with C. I've used wxWidgets in Python and it's not a bad system, but it is C++ as well.

VSWizzard
Posts: 8
Joined: Wed Dec 16, 2015 8:55 am

Re: GUI with C

Fri Jan 08, 2016 12:36 pm

Thank you for the answers

It's not so important to use C for this. We can also do it with Python. Things we need to make is: we want to use the display only to show our questions of the quiz with the answers and a countdown of 10 seconds where you have time to choose your answer. We have made controllers. These controllers are telling the answers of the people to another device, we learnt programmig with. The Raspberry tells the correct answer to the other programming device (only used in Switzerland for education, i think).

Thank you for your attention ;)

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6074
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: GUI with C

Fri Jan 08, 2016 1:08 pm

Then maybe kivy + python?

User avatar
yasriady
Posts: 27
Joined: Wed Apr 08, 2015 2:37 am
Location: Indonesia
Contact: Website

Re: GUI with C

Mon Jan 11, 2016 11:16 am

Hi,

GUI application devel for raspbery pi, I'm using using wxWidgets.
It's flexible in licensing scheme and yield portable application by statically linking.
This ui framework is very complete, not just ui, but also for stream, filesystem, string and etc ... just like what qt does....

Please check my experience using wxWidgets on following link: http://yasriady.blogspot.co.id/2016/01/ ... chain.html

Rgrds/Ddy
MyRaspberryPi : Cross Compile, wxWidgets/C++ and Linux Journal at http://yasriady.blogspot.com

pxgator
Posts: 105
Joined: Mon Feb 16, 2015 6:45 pm
Location: Southern Colorado, USA

Re: GUI with C

Mon Jan 11, 2016 7:38 pm

If you want to do GUI the easy way check this out:

viewtopic.php?f=63&t=128795&p=861114#p861114
So what's all this RPi stuff anyhow? Well folks, it's a feat of engineering from
the UK almost as remarkable as the De Havilland Mosquito and the Colossus.

VSWizzard
Posts: 8
Joined: Wed Dec 16, 2015 8:55 am

Re: GUI with C

Wed Jan 13, 2016 7:52 am

Thanks for the answers,

can you tell me if the following would work with Tkinter?
Please see the appendix.
We want to program our Quiz, so that 3 Windows pop-up with a text on it and when the GPIO's give a signal to the raspberry, it should switch the screen. That's one case I don't know how to do.

Thank y'all
Attachments
Foren-Beitrag2.PNG
Screen2
Foren-Beitrag2.PNG (9.27 KiB) Viewed 3455 times
Foren-Beitrag.PNG
Screen1
Foren-Beitrag.PNG (18.34 KiB) Viewed 3455 times

User avatar
RogerW
Posts: 286
Joined: Sat Dec 20, 2014 12:15 pm
Location: London UK

Re: GUI with C

Wed Jan 13, 2016 1:33 pm

I am not sure if this will help but it might.
https://github.com/RogerWoollett/PyView
This is a python/tkinter program that shows different aspects of system performance (a bit like task manager). It does this by switching windows. In this case I use a menu but you might be able to use the same idea but using the GPIO to make the windows swap.

Return to “C/C++”