Re: c program running 2 terminal windows, how to specify in which to write?
From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 04/29/04
- Next message: Jens.Toerring_at_physik.fu-berlin.de: "Re: c program running 2 terminal windows, how to specify in which to write?"
- Previous message: Barry Margolin: "Re: FTP data connection"
- In reply to: Achraf: "c program running 2 terminal windows, how to specify in which to write?"
- Next in thread: Jens.Toerring_at_physik.fu-berlin.de: "Re: c program running 2 terminal windows, how to specify in which to write?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 28 Apr 2004 21:27:22 -0400
In article <381de918.0404281549.770e43ae@posting.google.com>,
achraf123@hotmail.com (Achraf) wrote:
> Hi all,
>
> I have a c program under linux, while running, it opens a new terminal
> windows using a system call. I would like to display messages on both
> windows.
> But I can't find a way to specify the terminal window I want to write
> in.
>
> The program is for chat and I want to keep a terminal window to write
> incoming messages, and use the other one for operation like sending
> messages or viewing list of nicks in the room....
>
> To start the new window, i use the command:
> system("gnome-terminal");
> or
> popen("gnome_terminal", "w");
> but with no results!!!
>
> but I really can't see if there is some possible way to write to it,
> all my messages keep arriving in the original window.
>
> If there is any way you can help me, I will be very thankful,
Why are you using terminal windows? You should just use the X API, or
an X toolkit, to create windows that you can manipulate directly. When
you open a terminal window and don't specify a program to run in it, it
just runs a shell -- it's not a general purpose display mechanism.
Howeer, if gnome_terminal is like xterm, it probably accepts a -S option
to let you specify a pty to send/receive its input/output. You would
first open a pty for each terminal window, and then provide this option
when running gnome_terminal. To send output to a particular window, you
would write to the corresponding master end of the pty.
-- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***
- Next message: Jens.Toerring_at_physik.fu-berlin.de: "Re: c program running 2 terminal windows, how to specify in which to write?"
- Previous message: Barry Margolin: "Re: FTP data connection"
- In reply to: Achraf: "c program running 2 terminal windows, how to specify in which to write?"
- Next in thread: Jens.Toerring_at_physik.fu-berlin.de: "Re: c program running 2 terminal windows, how to specify in which to write?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|