From owner-freebsd-libh Tue Oct 9 16:51:32 2001 Delivered-To: freebsd-libh@freebsd.org Received: from winston.freebsd.org (adsl-64-173-15-98.dsl.sntc01.pacbell.net [64.173.15.98]) by hub.freebsd.org (Postfix) with ESMTP id A6DA337B407 for ; Tue, 9 Oct 2001 16:51:25 -0700 (PDT) Received: from localhost (jkh@localhost [127.0.0.1]) by winston.freebsd.org (8.11.6/8.11.6) with ESMTP id f99NomH57528; Tue, 9 Oct 2001 16:50:52 -0700 (PDT) (envelope-from jkh@freebsd.org) To: anarcat@anarcat.dyndns.org Cc: freebsd-libh@freebsd.org Subject: Re: How to create a GUI console in tclh In-Reply-To: <20011009194322.E601@shall.anarcat.dyndns.org> References: <20011009143206.A27943@shall.anarcat.dyndns.org> <20011009163733T.jkh@freebsd.org> <20011009194322.E601@shall.anarcat.dyndns.org> X-Mailer: Mew version 1.94.1 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20011009165048X.jkh@freebsd.org> Date: Tue, 09 Oct 2001 16:50:48 -0700 From: Jordan Hubbard X-Dispatcher: imput version 20000228(IM140) Lines: 37 Sender: owner-freebsd-libh@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG The Tcl "channel" abstraction should provide everything you need - in particular, you can stack channels on top of one another in order to implement this kind of redirection or you can close a channel, like stdout, and reassign it to something like a pipe. - Jordan > On Tue Oct 09, 2001 at 04:37:33PM -0700, Jordan Hubbard wrote: > > This should be fairly easy to do - just take a look at what tclsh does > > to implement its command parser. You basically just want to read in a > > text string, call TCL's evaluator on it, > > I'm absolutely non-worried about that. I already implemented some basic > Tk tcl shell as a primary Tk exercise. :) > > > and insert the results back into the console window. > > That is the whole problem. How can I redirect a stream to a window??? > > > > I'm sure libh has some sort of scrolling > > text widget already, right? I'm ashamed to say I haven't looked > > lately, but this should be a very straight-forward "junior libh > > hacker" sort of project. > > Yah... Well, my only concern is with streams redirection... > > > You may also want to redirect stdout > > somewhere so that things like "puts" behave correctly, given some > > definition of "correct." > > I guess the only way would be to "read" the output line by line and then > write it to the window... > > Thanks! > > A. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message