[Lazarus] Running an app on boot

2017-01-25 Thread Ed Murashie via Lazarus
I wrote a simple Lazarus program that displays a window and a button and did
the same thing using Glade which also uses Gtk+.

I am using a Beaglebone Black with the latest stock Debian Jessie image
which start a LxQt desktop program after it boots up.

When I run my program in the LxQt window or in a terminal window, it runs
fine.

Now I want my Lazarus or Glade/Gtk program to run when I boot and not see
the LxQt desktop program.

I have tried using the Crontab with @reboot command method and the create a
.service and use systemctl to register and start it.

No matter what I try I get " Gtk-WARNING **: cannot open display: ".  This
also happen on a Beaglebone Green and happens when I use Wheezy or Jessie.

 

What am I doing wrong and how can I fix it?

 

Thanks,

Newbie Ed

 

-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Running an app on boot

2017-01-25 Thread zeljko via Lazarus

On 01/25/2017 11:40 AM, Ed Murashie via Lazarus wrote:

I wrote a simple Lazarus program that displays a window and a button and
did the same thing using Glade which also uses Gtk+.

I am using a Beaglebone Black with the latest stock Debian Jessie image
which start a LxQt desktop program after it boots up.

When I run my program in the LxQt window or in a terminal window, it
runs fine.

Now I want my Lazarus or Glade/Gtk program to run when I boot and not
see the LxQt desktop program.

I have tried using the Crontab with @reboot command method and the
create a .service and use systemctl to register and start it.

No matter what I try I get “ Gtk-WARNING **: cannot open display: “.
This also happen on a Beaglebone Green and happens when I use Wheezy or
Jessie.



What am I doing wrong and how can I fix it?


You cannot run an X11 application without running X11 server. That's 
wrong. If you need headless server gui app then you can use xfvb for 
such purpose , or normally run X11 wm and then run your app there.


zeljko

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Running an app on boot

2017-01-25 Thread Paul Breneman via Lazarus

On 01/25/2017 08:09 AM, zeljko via Lazarus wrote:

On 01/25/2017 11:40 AM, Ed Murashie via Lazarus wrote:

I wrote a simple Lazarus program that displays a window and a button and
did the same thing using Glade which also uses Gtk+.

I am using a Beaglebone Black with the latest stock Debian Jessie image
which start a LxQt desktop program after it boots up.

When I run my program in the LxQt window or in a terminal window, it
runs fine.

Now I want my Lazarus or Glade/Gtk program to run when I boot and not
see the LxQt desktop program.

I have tried using the Crontab with @reboot command method and the
create a .service and use systemctl to register and start it.

No matter what I try I get “ Gtk-WARNING **: cannot open display: “.
This also happen on a Beaglebone Green and happens when I use Wheezy or
Jessie.



What am I doing wrong and how can I fix it?


You cannot run an X11 application without running X11 server. That's
wrong. If you need headless server gui app then you can use xfvb for
such purpose , or normally run X11 wm and then run your app there.


Or switch to a Raspberry Pi and use https://Ultibo.org ?  Maybe Ultibo 
can be ported later to Beaglebone?


Regards,
Paul
www.ControlPascal.com

--
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Running an app on boot

2017-01-25 Thread Graeme Geldenhuys via Lazarus
On 2017-01-25 13:26, Paul Breneman via Lazarus wrote:
> Or switch to a Raspberry Pi and use https://Ultibo.org ?

And then you can also use fpGUI Toolkit  to keep things small and
“lite” (no large 3rd party libraries required or there dependencies. eg:
GTK, Qt etc).

Regards,
  Graeme


-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Running an app on boot

2017-01-25 Thread Santiago A. via Lazarus
El 25/01/2017 a las 15:15, Graeme Geldenhuys via Lazarus escribió:
> On 2017-01-25 13:26, Paul Breneman via Lazarus wrote:
>> Or switch to a Raspberry Pi and use https://Ultibo.org ?
> And then you can also use fpGUI Toolkit  to keep things small and
> “lite” (no large 3rd party libraries required or there dependencies. eg:
> GTK, Qt etc).
>
> Regards,
>   Graeme
>
>
fpgui needs a "graphic environment", Windows or X (or Mac?) . Doesn't it?


-- 
Saludos

Santiago A.

-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Running an app on boot

2017-01-25 Thread Graeme Geldenhuys via Lazarus
On 2017-01-25 15:28, Santiago A. via Lazarus wrote:
> fpgui needs a "graphic environment", Windows or X (or Mac?) . Doesn't it?

There is a port to Ultibo that doesn't require X11 or GDI.

Take a look at the section “Ultibo with fpGUI support” on
http://fpgui.sourceforge.net/community.shtml


Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Running an app on boot

2017-01-25 Thread Marc Santhoff via Lazarus
On Mi, 2017-01-25 at 02:40 -0800, Ed Murashie via Lazarus wrote:
> I wrote a simple Lazarus program that displays a window and a button and did
> the same thing using Glade which also uses Gtk+.
> 
> I am using a Beaglebone Black with the latest stock Debian Jessie image
> which start a LxQt desktop program after it boots up.
> 
> When I run my program in the LxQt window or in a terminal window, it runs
> fine.
> 
> Now I want my Lazarus or Glade/Gtk program to run when I boot and not see
> the LxQt desktop program.
> 
> I have tried using the Crontab with @reboot command method and the create a
> .service and use systemctl to register and start it.
> 
> No matter what I try I get " Gtk-WARNING **: cannot open display: ".  This
> also happen on a Beaglebone Green and happens when I use Wheezy or Jessie.

That depends on what you want to achive. Ich you want to make a POS like
device that is only showing your program and no window manager menu,
task launchers or the like you could do:

Edit the file ".xinitrc" in the standard users home directory.
There is one line starting with a programm name only, should be sth.
like "lxqt" in your case.
Replace that line with the name of your programm to run. Disable any
unwanted background programs by commenting them out with a '#' in front
or deleteing that line(s).

Before that you should prepare your program to run full screen by
setting the size of the main screen to exactly matching the dipslay
size, e.g. for a vga display you use 640 for the width and 480 for the
hight. You could additionally block each movement of the main window.

That way you have a one program only device. If you end it, X, the gui
system, is shut down. There may be other things to watch and handle,
maybe you need to make the cursor invisible or force the main window to
stay on top. Or you may want to add a "shutdown -ph" or similar directly
after your program in ".xinitrc" so the os of the device shuts down if
the user end your program.

HTH,
Marc


-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Running an app on boot

2017-01-25 Thread Marc Santhoff via Lazarus
On Mi, 2017-01-25 at 08:26 -0500, Paul Breneman via Lazarus wrote:
> On 01/25/2017 08:09 AM, zeljko via Lazarus wrote:

> > You cannot run an X11 application without running X11 server. That's
> > wrong. If you need headless server gui app then you can use xfvb for
> > such purpose , or normally run X11 wm and then run your app there.
> 
> Or switch to a Raspberry Pi and use https://Ultibo.org ?  Maybe Ultibo 
> can be ported later to Beaglebone?

I don't understand. Does Ultibo drive screens, does it have gui
capabilities? The web site has many words but not so many explanations I
get...

Regards,
Marc

-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Running an app on boot

2017-01-25 Thread Lars via Lazarus
On Wed, January 25, 2017 6:26 am, Paul Breneman via Lazarus wrote:
>
> Or switch to a Raspberry Pi and use https://Ultibo.org ?  Maybe Ultibo
> can be ported later to Beaglebone?
>

Beaglebone is more "open" hardware than pi but I guess that's another
topic. The price of pi certainly is attractive compared to beagle bone
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Running an app on boot

2017-01-30 Thread Michael Schnell via Lazarus

On 25.01.2017 11:40, Ed Murashie via Lazarus wrote:

No matter what I try I get “ Gtk-WARNING **: cannot open display: “.  
This also happen on a Beaglebone


What am I doing wrong and how can I fix it?


Do you *want* a GUI ?

-Michael
-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Running an app on boot

2017-02-01 Thread Ed Murashie via Lazarus
I want to thank everyone for their comments and suggestions and give a summary 
of what worked for me.  
First my background and hardware I used. I am an electronics engineer with 
experience in C with PIC and Cortex M3/4 ARM processors and windows with Visual 
Studio. I had two weeks to learn enough Linux, BeagleBone Black and Lazarus to 
create a demo of a graphical thermostat using a BeagleBone Black Rev C and the 
800x480 5" SEEED Studio LCD with resistive touch panel.  What I finally did was 
the following:

1. Read most of Exploring BeagleBone by Derek Molloy. A great book that starts 
with very little knowledge of Linux, electronics and the BeagleBone and yet you 
wind up learning all the different type of programming methods including QT & 
GTK+ and interfacing to hardware.
2. Learned Lazarus and familiarized myself with Pascal which I learned 20+ 
years ago by watching the excellent School Freeware Pascal and Lazarus YouTube 
videos also at 
http://www.schoolfreeware.com/Free_Pascal_Lazarus_App_GUI_Tutorials_With_Example_Code_.html
 
3. Update the BeagleBone operating system to the latest Debian Jessie with the 
LXQt desktop.  This is well documented at 
http://beagleboard.org/getting-started  
4. In Lazarus, I set the Form properties BorderStyle to bsNone, the WindowState 
to wsMinimized and the FormStyle to fsSystemStayOnTop and built a simple 
application with buttons, pictures, labels, etc. Clicked on Build to build my 
program.
5. In LXQt I set the startup application to run on boot by going to 
Preferences, then LXQt Settings, then Session Settings and finally Autostart. 
Clicked Add, gave the startup a name and then browsed to the Lazarus executable 
I built in step 4 and left the Wait for system tray box unchecked.  When I 
rebooted the system powered up into the application with no log on, task bar, 
etc.

Next I am going to explore a stripped down operating system, X11 and fpGUI to 
see if I can speed up the bootup time.

Thanks again, everyone who responded to my inquiry,
Ed


-- 
___
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus