From owner-freebsd-libh Sat Oct 13 11:19:22 2001 Delivered-To: freebsd-libh@freebsd.org Received: from tomts10-srv.bellnexxia.net (tomts10.bellnexxia.net [209.226.175.54]) by hub.freebsd.org (Postfix) with ESMTP id 0B1F037B40C for ; Sat, 13 Oct 2001 11:19:18 -0700 (PDT) Received: from khan.anarcat.dyndns.org ([65.94.128.156]) by tomts10-srv.bellnexxia.net (InterMail vM.4.01.03.16 201-229-121-116-20010115) with ESMTP id <20011013181916.DXEP4321.tomts10-srv.bellnexxia.net@khan.anarcat.dyndns.org> for ; Sat, 13 Oct 2001 14:19:16 -0400 Received: from shall.anarcat.dyndns.org (shall.anarcat.dyndns.org [192.168.0.1]) by khan.anarcat.dyndns.org (Postfix) with ESMTP id 5EA431AC5 for ; Sat, 13 Oct 2001 14:19:13 -0400 (EDT) Received: by shall.anarcat.dyndns.org (Postfix, from userid 1000) id F1DA720B50; Sat, 13 Oct 2001 14:19:29 -0400 (EDT) Date: Sat, 13 Oct 2001 14:19:29 -0400 From: The Anarcat To: Libh Subject: tclh hui console ready! Message-ID: <20011013141929.F739@shall.anarcat.dyndns.org> Mail-Followup-To: The Anarcat , Libh Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kjpMrWxdCilgNbo1" Content-Disposition: inline User-Agent: Mutt/1.3.22.1i 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 --kjpMrWxdCilgNbo1 Content-Type: multipart/mixed; boundary="E7i4zwmWs5DOuDSH" Content-Disposition: inline --E7i4zwmWs5DOuDSH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I made a primitive hui console. It does not take care of stdout/err redirection yet, but does return the "value" of tcl commands and also the errors in such commands. How to use: source console.tcl open_console $hui or from command line: $ tclh console_init.tcl Anyways, anyone knows how I could *read* from *stdout*? :) A. --E7i4zwmWs5DOuDSH Content-Type: application/x-tcl Content-Description: console include code Content-Disposition: attachment; filename="console.tcl" Content-Transfer-Encoding: quoted-printable global cons_w=0A=0Aproc read_cmd {hui button data} {=0A=0A global comman= d=0A =0A catch [$command text] sid=0A cons_append $sid=0A =0A}= =0A=0Aproc cons_append {string} {=0A global cons_out=0A =0A # XXX: t= his is probably not the (c) good way=0A $cons_out text [format "%s%s" [$= cons_out text] $string]=0A if {$string !=3D "" && $string !=3D "\n"} {= =0A cons_append "\n"=0A }=0A}=0A=0A# make the console openable on= ly once=0Aproc open_console {hui} {=0A=0A global cons_w=0A if {[info = vars cons_w] =3D=3D "cons_w" &&=0A ![catch {set cons_w $cons_w}] &&= =0A ![H::is_null $cons_w]=0A } {=0A $cons_w show=0A = return=0A } else {=0A cons_make_main_win $hui=0A } =0A= =0A=0A}=0A=0A# Create the main-window and its elements=0A#=0A# do not call = this from outside console.tcl, use open_console instead=0Aproc cons_make_ma= in_win {hui} {=0A global command=0A global cons_out=0A global cons= _w=0A =0A set cons_w [$hui window cons_w "Console" "0 0" "25 20" "ver= tical"] =0A =0A set cmd_cont [$cons_w container "container"]=0A = =0A set command [$cmd_cont inputLine "Console Command" "" -1]=0A $cmd= _cont button "gobutton" "&Eval" {read_cmd ""} "default"=0A =0A set co= ns_out [$cons_w textEdit "Console Output" "" FALSE]=0A =0A $cmd_cont = resize "3 -1"=0A # Finally, show the window=0A $cons_w show=0A} --E7i4zwmWs5DOuDSH Content-Type: application/x-tcl Content-Description: console bootstrap code Content-Disposition: attachment; filename="console_init.tcl" Content-Transfer-Encoding: quoted-printable source console.tcl=0A=0A# Init UI=0Aset hui [Hui::open "auto"]=0A=0A# Creat= e the main-window=0Acons_make_main_win $hui=0A=0A# Run hui=0A$hui run --E7i4zwmWs5DOuDSH-- --kjpMrWxdCilgNbo1 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjvIhbAACgkQttcWHAnWiGeE7gCeK+0EUSXItDyEdDeDORsDgJYZ rHAAn2Vgh7/6tFvttk0LQUVvvbOvBkzR =8XN+ -----END PGP SIGNATURE----- --kjpMrWxdCilgNbo1-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-libh" in the body of the message