Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 01-31-2013, 04:23 AM   #1
Mario Blunk
Registered: Dec 2008
Location: Wild Eastern Germany
Distribution: Suse 9.x , 11.x, 12.1, 13.x
Posts: 127

Rep: Reputation: 21
howto redirect command line to ada gtk.text_buffer ?

Hi friends,

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).

procedure button_callback
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);

end button_callback;

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 04:26 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Ada gtk on OpenSuse 12.x Mario Blunk SUSE / openSUSE 2 01-29-2013 10:48 AM
[SOLVED] Howto run bash-built-in programs from inside a Ada-Program ? Mario Blunk Programming 7 10-15-2012 05:08 AM
How to redirect the command line output to the clipboard kejing Linux - Software 1 02-03-2009 12:21 AM
howto add a mouse on the command line? Fred Caro Linux - Newbie 4 12-29-2008 12:50 PM
pppd from command line...howto Crasherz Linux - Networking 1 03-05-2004 10:52 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:59 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration