Ashnook13
Posts: 82
Joined: Wed Sep 26, 2012 3:43 pm

A Gambas Question

Mon Mar 06, 2017 7:15 pm

I am running Gambas3 in Debian and have created a simple (for now) user interface for my ventilation system. It runs, save a data file, loads a data file and works so I have made an executable. I can run the executable from within a command terminal and it comes up withing the desktop.
What I want to do is for the Gambas program I have created to come up on boot but not in the desktop but to take over the whole display as a stand alone UI.
Whatever I have tried I cannot get it to run on boot at all, let alone instead of the desk top.
I have tried disabling the desktop on boot via the raspi-config system.
Help please.

Many thanks, Brian

ghans
Posts: 7878
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: A Gambas Question

Mon Mar 06, 2017 7:42 pm

Can you get the program to run in fullscreen automatically when started manually ? I would suggest
enabling auto-login / boot to desktop and using the autostart folders first. After you get that working ,
you can decide yourself if you really want to meddle with lightdm.conf or even .xinitrc .

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Ashnook13
Posts: 82
Joined: Wed Sep 26, 2012 3:43 pm

Re: A Gambas Question

Tue Mar 07, 2017 7:13 am

Thanks, but I am not sure I understand the answer at all!

Ashnook13
Posts: 82
Joined: Wed Sep 26, 2012 3:43 pm

Re: A Gambas Question

Tue Mar 07, 2017 7:21 am

On another point, is Gambas the best / easiest way to develop a separate UI for the PI? I want to develop a front end to controlling a ventilation system, it's not a complex system, much like a boiler control with some more settings (speed, flow....)

Brian

ghans
Posts: 7878
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: A Gambas Question

Tue Mar 07, 2017 7:31 am

The best language is the language you know best. There are very few
languages which won't work on the Pi (like Visual Basic 6) ,
but if you only know Gambas/VB6 the question is moot.

So , if you manually start your program (double-click ? LXTerminal ?
double-click on a .desktop file ?) , does automatically go into fullscreen mode ?

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Ashnook13
Posts: 82
Joined: Wed Sep 26, 2012 3:43 pm

Re: A Gambas Question

Tue Mar 07, 2017 7:42 am

Thanks again. We have occasional power cuts in our village so I need a front end that starts automatically when the poser returns. The current trial code (Gambas based) writes data to a file of the current settings etc. When it re-starts it reads this file and re-sets everything. If I could get this executable to start up automatically - even inside the Debain UI - it would be a start!

In the past I have used C and Visual Basic a lot. I am dabbling in Python on the Pi so I am reasonably code literate!

I have seen posts on GTK but have not looked into it yet - Gambas looked too good to be true (perhaps it is) - what would you (or others) recommend for my task.

Cheers, Brian

User avatar
SteveDee
Posts: 343
Joined: Thu Dec 29, 2011 2:18 pm
Location: Sunny Southern England
Contact: Website

Re: A Gambas Question

Fri Mar 24, 2017 5:06 pm

Ashnook13 wrote:... What I want to do is for the Gambas program I have created to come up on boot but not in the desktop but to take over the whole display as a stand alone UI...
If I understand you correctly, you have created a GUI app in Gambas, but you want to run it at the command-line without loading a desktop.

The [simplified] answer is that you cannot run a GUI app without desktop support.

I suggest you re-create your app in Gambas as a command-line app and include the ncurses library (gb.ncurses). Then you can create a simple terminal interface (alsamixer is an example).

See this link: http://gambaswiki.org/wiki/tutorial/ncursestut

ghans
Posts: 7878
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: A Gambas Question

Fri Mar 24, 2017 8:05 pm

I suppose you don't need a real desktop (like PIXEL or GNOME) to run a Gambas app in fullscreen.
But you will need to have X running.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
SteveDee
Posts: 343
Joined: Thu Dec 29, 2011 2:18 pm
Location: Sunny Southern England
Contact: Website

Re: A Gambas Question

Sat Mar 25, 2017 8:34 am

ghans wrote:I suppose you don't need a real desktop to start a Gambas app in fullscreen....
...well, I did say it was a simplified answer.

If you want to run a Gambas GUI app you would need a windowing system and you would also need a widget toolkit (e.g. either GTK or Qt). So you might as well run a light-weight desktop, unless you want the system to be up and running very quickly. Then ncurses is probably the way to go, as your app could be running on a Raspbian Pi in about 15-20s (maybe less using Arch Linux).

A few years ago I created a Thin Client using Gambas on Lubuntu running LXDE for a local school. The students could only see and interact with the Gambas screen (unless they knew the admin password). So that is another possibility. Or maybe look at one of the Pi "Kiosk" systems.

Return to “Graphics programming”