Page 1 of 1

GUI Question

Posted: Wed Aug 02, 2017 8:55 am
by Ashnook13
I want to create a program for my Pi which when powered up comes up as a Use Interface for a ventilation system. I don't want it to run within the current Raspbian UI but on it's own. I have configured a Pi with a 5 inch touch screen display.

I have looked at Tkinter but this seems to always want to run inside the Raspbian UI. Not sure I care what I write it in (python, C etc.).

Any recommendations please?

Thanks, Brian

Re: GUI Question

Posted: Wed Aug 02, 2017 9:10 am
by DougieLawson
TKinter with python is relatively simple.

Page 44 in https://www.raspberrypi.org/magpi-issues/MagPi29.pdf has a tutorial.

Re: GUI Question

Posted: Wed Aug 02, 2017 9:25 am
by Ashnook13
Hi Dougie, yes it is, I have played with it but I cannot see a way for a created dialog to be the only display on a full screen.

The dialog/window will contain items/controls for the system and I don't want to see any of the Raspbian window widgets. Also we are susceptible to power cuts here so if the pi re-boots I want the Tkinter system to come back up and be running as normal.

Brian

Re: GUI Question

Posted: Wed Aug 02, 2017 9:47 am
by DougieLawson
You can make TKinter windows with no controls (so they run like a kiosk).
Lots of Stackoverflow examples for that https://www.google.co.uk/search?q=tkint ... w+controls

The other way to do a GUI is HTML/CSS/JavaScript and run that in a kiosk mode web browser (KWeb probably fits that best). If you serve that stuff from a small web server you can make a dynamic kiosk GUI.

Re: GUI Question

Posted: Wed Aug 02, 2017 9:54 am
by Ashnook13
OK, that looks like what I want to do. I want to continue with a python based language if possible as I have lots do do controlling the Pi behind the front window.

Will experiment!!!

Thanks Dougie.

Re: GUI Question

Posted: Wed Aug 02, 2017 11:38 am
by Ashnook13
I am still a bit confused Dougie, I cannot see anything from the search link you gave me that allows Tkinter code to replace the Raspbian top level gui with mine? That is make a Tk inter developed window automatically be the top level window with stuff within it. I don't mind if the Raspbian top level has to loaded first then automatically start my Tk python code to overwrite it or just sit in to of it (all of it). (ho do I do that???).

Are then any simple examples around you can point me to?

Cheers, Brian

Re: GUI Question

Posted: Thu Aug 03, 2017 4:53 am
by treeHouse
Here is an old thread discussing this very issue.
viewtopic.php?t=7709

Seems SDL is what you want, though they suggest using C or C++.
I believe PyGame uses SDL, so maybe you can use python after all.

Re: GUI Question

Posted: Thu Aug 03, 2017 10:03 am
by DougieLawson
If you don't start the desktop, but start Xwindows with just a single application that'll give you what you want.

To experminent set-up Raspbian to login to a command prompt only (it's a Raspi-Config option). Then try a startx /home/pi/mygui.program.py command.

Re: GUI Question

Posted: Thu Aug 03, 2017 10:48 am
by Ashnook13
Thanks again Dougie, I have decided to go with the standard desktop with my GUI filling to space under the tool-bar. I now know how to automatically start a python program when the gui boots so I am getting there.

I found a link to a gui-builder called wxpython but not sure if it is supported on the pi, will look further.

Brian