howto redirect command line to ada gtk.text_buffer ?
currently I'm using this procedure in order to display the output of a command line program in an (ada) gtk.text buffer. After the program is launched (in this example /bin/ls), the output goes into a text file (see comment A). Finally the file content is sent to the text_buffer (see comment B).
widget : access gtk.widget.gtk_widget_record'class;
data : string_access
pragma unreferenced (widget);
if data.all = "START" then
Create( result_file, Name => result_file_name);
-- launch external command
Program_Name => "/bin/ls",
Args => ( 1=> new String'("-l")),
Output_File => result_file_name, -- comment A
Success => var_success,
Return_Code => Result
-- comment B
-- display the file result_file_name in the text buffer
gtk.text_buffer.set_text (textbuf, read_result_file);
The drawback is that I can't see the program output at runtime as it is required for the command line program "top" or the like.
What do I have to change ?
Thank you all !
Last edited by Mario Blunk; 01-31-2013 at 05:26 AM.