From: reinkor <reinkor@gmail.com>
Subject: Re: How to use/obtain output from system commands (in an Ada program) ?
Date: Mon, 20 Jun 2016 01:34:17 -0700 (PDT)
Date: 2016-06-20T01:34:17-07:00 [thread overview]
Message-ID: <4c9d4577-95ad-4706-a334-cee5f2c2dfbc@googlegroups.com> (raw)
In-Reply-To: <nk5hat$89q$1@gioia.aioe.org>
Thanks a lot,
any hint about rpm/repository for gtkada on OpenSuse (Leap) ?
reinert
On Sunday, June 19, 2016 at 9:24:16 AM UTC+2, Dmitry A. Kazakov wrote:
> On 2016-06-19 08:08, reinkor wrote:
>
> > I am looking for a simple way to obtain output from "xmessage"
> > (or dialog/kdialog) in my Ada program. Any good hints?
>
> The package System.OS_Lib has procedures Spawn that are much more
> comfortable to use than system().
>
> If you use GtkAda you can start xmessage or any other process with
> pipe-lined input/output/error. Then you will have callbacks to process
> them. It is also possible to use Gtk_Text_Buffer instead of callbacks.
>
> http://www.dmitry-kazakov.de/ada/gtkada_contributions.htm#10.1
>
> > A trivial way is to output to a file like in this test procedure:
> >
> > with Interfaces.C;
> > with Interfaces.C.Strings;
> > with Ada.Text_IO, Text_IO;
> >
> > procedure Test7 is
> > package C renames Interfaces.C;
> > use type C.char_array;
> > procedure system (Source : in C.char_array);
> > pragma Import(C, system, "system");
> > use Ada.Text_IO, Text_IO;
> > file1 : File_Type;
> > begin
> > system("xmessage -center Box1 -buttons label1:X,label2:y -print > choice_file1");
>
> Add terminating ASCII NUL here.
>
> --
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2016-06-20 8:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-19 6:08 How to use/obtain output from system commands (in an Ada program) ? reinkor
2016-06-19 7:23 ` Dmitry A. Kazakov
2016-06-20 8:34 ` reinkor [this message]
2016-06-20 8:44 ` Dmitry A. Kazakov
2016-06-20 9:22 ` reinkor
2016-06-20 9:59 ` Dmitry A. Kazakov
2016-06-20 19:25 ` reinkor
2016-06-20 19:55 ` Dmitry A. Kazakov
2016-06-22 8:14 ` briot.emmanuel
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox