LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 11-26-2008, 09:16 AM   #1
geekbynature
LQ Newbie
 
Registered: Jul 2008
Location: Colorado
Distribution: Fedora 9
Posts: 21

Rep: Reputation: 0
Question Passing value from a terminal to a GTK text box


I've done some searching, and I just can't find anything to my satisfaction about this.

I have a program written in bash for balancing my checkbook. I started making a GUI for it, written in C, and ultimately I need to be able to read a value from the terminal (such as "echo foo", it would get "foo") and insert it into a text-entry box on the GUI.

I know how to get a string from one entry box and send it to another; as well as get a string from a box and send it to the terminal; but for the life of me I can't figure out how to do this.
 
Old 11-26-2008, 09:47 AM   #2
MicahCarrick
Member
 
Registered: Jul 2004
Distribution: Fedora
Posts: 241

Rep: Reputation: 31
Have a look at http://www.gtkforums.com/about906.html which shows how to run a terminal command and put the output (STDOUT) into a GtkTextView using the GLib function g_spawn_command_line_sync(). The concept is similar for other widgets like text boxes and there are other--more advanced methods if need be. You can read the manual on the g_spawn** functions.
 
  


Reply


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
Passing args in terminal window is OK. but isn't when passing in GNOME launcher why? majrys1962 Debian 0 11-18-2008 06:00 PM
How to reach to my mail box using text mode terminal grupoapunte Linux - Newbie 4 05-08-2005 10:03 AM
Passing a text file in Redhat 9 to honeyd james_cwy Programming 1 11-11-2003 12:22 PM
Passing a text file in Redhat 9 to honeyd james_cwy Linux - Newbie 2 11-08-2003 01:08 AM
passing terminal commands joey Linux - General 3 03-21-2002 11:24 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:58 AM.

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