Forum > General

Interface for a terminal application

(1/1)

Dibo:
Hi,

I am a novice user of Linux (Ubuntu). How can I write UI for console application using Lazarus?
Example: Program "shred" od "wipe" which delete files permanently. How can I run this programs with parameters and read states, progress etc?

Regards

theo:
http://wiki.lazarus.freepascal.org/Executing_External_Programs

xircon:
I had some fun with this, I run Mandriva Cooker KDE4, just replace konsole with gnome-terminal:


--- Code: ---procedure TForm1.Button7Click(Sender: TObject);
var S: longint;
begin
   S := fpsystem ('/usr/lib/kde4/libexec/kdesu '+'"konsole -e /home/steve/repos"');
end;                                          

--- End code ---

Runs a script in my home folder in a root console.  This took me hours to work out!!!!

Another example (Mandriva uses su not sudo so YMMV) runs Nautilus as root:

--- Code: ---procedure TForm1.Button8Click(Sender: TObject);
var S: longint;
begin
  S := fpsystem ('/usr/lib/kde4/libexec/kdesu nautilus');
end;        

--- End code ---

I am slowly writing a gui based program of helpful utilites for my own use.

HTH

Steve

Dibo:
Thanks everyone! Don't close topic because I still can have some problems with this ;)

Navigation

[0] Message Index

Go to full version