HDTenEightyP/NetNews huggingface dataset:
From: chare@unilabs.uucp (Chris Hare)
Subject: tk window creation question
Organization: UniLabs Research Group
Date: Tue, 10 Nov 1992 15:43:26 GMT

This is stupid :-)

How do I create windows without using the toplevel command?  I want to
create windows which have parents other than the root window.

thanks!

-- 
????                --- It Always works for me! ---                           
Chris Hare, UNIX Scientist                  Preferred : chare@unilabs.org
Just a mild-mannered consultant by day ....
Newsgroups: comp.lang.tcl,news.answers
From: schwartz@roke.cs.psu.edu (Scott Schwartz)
Newsgroups: comp.lang.tcl
Subject: mixing fixed and variable components with the placer
Date: 6 Nov 92 21:56:57 GMT
Distribution: comp


Consider the following code fragment:

frame .frame -borderwidth 10 -geometry 700x100
place [scrollbar .frame.scroll -relief sunken -command ".frame.list yview"] \
	-in .frame -width 20 -relheight 1.0
place [listbox .frame.list -yscroll ".frame.scroll set" -relief sunken \
		-geometry 80x10 ] \
	-in .frame -x 20 -relheight 1.0 -relwidth 0.97

This puts a scrollbar and a listbox in a frame using the placer.  One
really unsightly feature is the ``-relwidth 0.97'' on the listbox.
There doesn't seem to be a clean way to ask the placer to let an
object fill the remaining space.  Because I want the scrollbar to be
fixed width, no relwidth for the listbox will be correct.  Because the
frame can change size, no fixed width will be correct.  What to do?
Newsgroups: comp.lang.tcl
From: welch@parc.xerox.com (Brent Welch)
Subject: Re: Running Shell commands
Keywords: Shell, Pipe, TCL/TK, exec, eval
Organization: Xerox PARC
Date: 10 Nov 92 16:48:26 GMT

bytor@grumpy.bellcore.com (Ross Huitt) writes:

>In article <1992Nov06.042401.3241@bnr.ca>, tdoan@bnr.ca (Tuan Doan) writes:

>|> Hello,
>|>   
>|>    I am trying to get the following shell command to work inside TCL/TK and
>|> is having great difficulty.  If anyone know the solution to this, please 
>|> post.
>|> 
>|>    pr -h '[tdoan@crchh404] /bnr/file1' /bnr/file1 | ipr -D"pageduplex off"

>Try something like:
>    exec {pr -h '[tdoan@crchh404] /bnr/file1' /bnr/file1 | ipr "-Dpageduplex off"}

>The '{}' will protext you from executing the regular expression and you'll have to
>move the " in the arg to ipr because of the way Tcl handles strings.


The above suggestion won't work because exec will try to run a program
named "pr -h ...", not pr.  I've just done:

exec pr -h {[welch@corvina] /tmp/foo} /tmp/foo | lpr -P snoball

The braces will cause pr to get an argv[2] that is "[welch@corvina] /tmp/foo"
There is no need for eval in this simple case.
The following little procedure also works.

proc printit { user file } {
    set header "\[$user\]"
    exec pr -h "$header $file" $file | lpr -P snoball
}

The trick to remember here is that inside the double quotes there is
only a single level of substitution.  It doesn't matter that the value
of $header looks like a TCL expression.  Only the variable substitution
occurs, and again pr gets an argv[2] of "[welch@corvina] /tmp/foo"
--

	Brent Welch
Newsgroups: comp.lang.tcl
From: tdoan@bnr.ca (Tuan Doan)
Subject: Running Shell commands
Keywords: Shell, Pipe, TCL/TK, exec, eval
Organization: Bell-Northern Research, Richardson, Tx.
Date: Fri, 06 Nov 1992 04:24:01 GMT

Hello,
  
   I am trying to get the following shell command to work inside TCL/TK and
is having great difficulty.  If anyone know the solution to this, please 
post.

   pr -h '[tdoan@crchh404] /bnr/file1' /bnr/file1 | ipr -D"pageduplex off"

I know there is some trick regarding the use of EVAL and EXEC and I have
tried several permutation of it; but no success.

Thanks,

 __  __/  /   /   __  /    |   /    Tuan T. Doan
    /    /   /   /   /   / |  /     2D53  GREENWAY BNRRICH
   /    /   /   __  /   /  | /      ID: TDOAN on BNRRCH/BNRTEX
__/  ______/ __/ __/ __/  __/       BNR/NT/MCI CCS7 Development
                                    Phone: 6-444-4575/214-684-4575
Internet:  tdoan@bnr.ca             Fax: 6-444-3716/214-684-3716
      or   tdoan@x400gate.bnr.ca
From: bagwill@swe.ncsl.nist.gov (Bob Bagwill)
Newsgroups: comp.lang.tcl
Subject: simple Tk MH interface
Date: 6 Nov 92 14:59:12 GMT
X-Newsreader: TIN [version 1.1 PL6]

I'm working on a simple Tk MH interface since it seems no one else seems
to have written one.

I have some questions:
1) should I post the code to this newsgroup?
2) or to one of the source groups
3) or just submit it to the archive?

If I post it to this newsgroup:
4) do people want to see a very primitive version, so they can critique it, or
5) wait for a gooder fuller-featured version?

--
Bob Bagwill
bagwill@swe.ncsl.nist.gov
Newsgroups: comp.lang.tcl
From: elh@netcom.com (Ed Hudson)
Subject: Re: stupid question about arrays and variables - a-ha!
Organization: Netcom - Online Communication Services  (408 241-9760 guest) 
Distribution: USA
Date: Thu, 5 Nov 1992 22:27:43 GMT

In article <1992Nov5.000824.21915@netcom.com> elh@netcom.com (Ed Hudson) writes:
>	if i understand correctly, i cannot use the name of an array as an
>	argument.  ie,
>
>		set aaa(0) 5
>		set ddd	   aaa
>
>	i would like to be able to access array "aaa" by refering thru "ddd",
>	something like:
>
>		echo ${${ddd}(0)}
>

	please don't bother answering.  i've looked thru both the FAQ and recent
	postings to this group and have found answers in both places.

		-elh
Newsgroups: comp.lang.tcl
From: brad@NeoSoft.com (Brad Morrison)
Subject: Re: what is "expect"
Organization: NeoSoft Communications Services -- (713) 684-5900
Date: Fri, 6 Nov 1992 17:35:13 GMT

In article <96290@netnews.upenn.edu> raines@bohr.physics.upenn.edu (Paul Raines)
writes:

>What is "expect" that is supposed to packaged with tcl.
>I don't recall anything being said about it in the installation
>notes.

It's not packaged with the tcl distribution; "expect" was the first major
application to feature embedded tcl.  It was written by Don Libes, it's
totally cool because it lets you drive other applications that demand
tty input (ftp, passwd, etc.).  You can get "expect" from barkley.berkeley.edu.
If your site has expired the tcl FAQ, maintained by the ever-effervescent
Larry Virden.  you can get that from barkley.  The FAQ has more details
about expect, like Don's address (he answers e-mail promptly and
thoughtfully).  It's also a wellspring of information on cool tcl
contributions.
-- 
Brad Morrison        | ...These lovers of esoterica seem to derive a great
morrison@paranet.com | deal of intellectual satisfaction out of not quite
(713) 467-3100       | understanding what they are doing.
From: garfield@cs.tu-berlin.de (Sven Delmas)
Newsgroups: comp.lang.tcl
Subject: Re: Tcl with emacs or epoch
Date: 11 Nov 1992 11:55:26 GMT
Organization: Techn. Univ. Berlin (Germany)
Distribution: world
NNTP-Posting-Host: avalanche.cs.tu-berlin.de
In-reply-to: blk@mitre.org's message of Sun, 8 Nov 1992 21:30:51 GMT

In article <BLK.92Nov8163051@vanity.mitre.org> blk@mitre.org (Brian L. Kahn) writes:

   Has anyone produced patches to incorporate tk/tcl into emacs or epoch?
   I looked in the FAQ and docs, but couldn't find a reference.
I wrote a emacs widget that makes emacs a Tk widget. You can send
emacs-lisp code to emacs (from Tcl), and send Tcl code to Tcl (from
emacs). Perhaps this may help you. I think merging Tcl directly with
emacs (linking it with Tcl) will not work, as the "extension" language
of emacs is emacs-lisp, and having two extension languages for one
program will lead into trouble (not only conceptual, but also for the
implementation :-). If you want to take a look at the widget, it is
named TkEmacs, and can be found on barkley.

Sven.

P.S. the widget was not written by me alone. The emacs-lisp part was
written by Juergen Nickelsen.

--
----
  Sven Delmas (Techn. Univ. Berlin)
    garfield@cs.tu-berlin.de
----
  For every problem there is a solution which is simple, clean and wrong.
                                                  Henry Louis Mencken
From: gwilliam@crc.ac.uk (Gary Williams x3294)
Subject: expect with tk
Organization: MRC Human Genome Resource Centre
Date: Thu, 12 Nov 1992 18:23:42 GMT


I'm a tcl neophyte who has been immediately converted to the potentials
of expect and am rapidly coming to love tk. 

I've looked through the FAQ sheet without finding an answer to a query. 
What I want to know is, how can I use them both at the same time?

Don Libes wrote expect to cover the need for such a utility in shell
scripts, but it should be fantastically useful when you want to write a
windowing front-end to an existing character-based program, and what
better windowing system to use than tk's wish utility?

Or am I grasping the wrong end of the stick? Has nobody tackled the task
of putting the expect stuff into wish because tk can deal with
front-ending existing programs without the need for the expect goodies. 
If so, then how is it done?

PS.  Don - if you're listening in, the expect manual has a misprint that
caused me a small problem 'till I figured it out:

In the EXPECT HINTS section, the permissions of the secure files should
either be 750 and 2751 or 710 and 4751, not 710 and 2751. 


-- 
GARY WILLIAMS,  Computing Services Section,  Janet:       G.Williams@UK.AC.CRC
MRC-CRC & Human Genome Mapping Centre,       Internet:    G.Williams@CRC.AC.UK
Watford Rd, HARROW, Middx, HA1 3UJ, UK
Tel 081-869 3294   Fax 081-423 1275   
Newsgroups: comp.lang.tcl
From: markd@NeoSoft.com (Mark Diekhans)
Subject: Patch available for Extended Tcl 6.4c
Organization: NeoSoft Communications Services -- (713) 684-5900
Date: Wed, 11 Nov 1992 22:37:00 GMT


   We have released a patched to Extended Tcl 6.4c.  This mainly fixes problems
with the Silicon Graphics machines as well as time zone problems on certain
other machines.  Several other minor problems are fixed.  The following
files are available from barkley.berkeley.edu in tcl/extensions

   tclX6.4c-p1.tar.Z - Complete new source including patches.
   tclX6.4c.patch1.Z - Patches to update tclX6.4c.

Please report any problems to:

        tcl-project@neosoft.com

Thanks,
Mark
From: kaye@unagi.cis.upenn.edu (Jonathan Kaye)
Newsgroups: comp.lang.tcl
Subject: Problem with scrolling in text widgets & disabling text
Date: 11 Nov 92 23:39:22 GMT
Distribution: usa
Organization: University of Pennsylvania

I noticed two odd behaviors regarding text widgets.

1. When I insert all my text (using "$w.t insert 0.0 $AllMyText"), and
my text does not include any newlines (but the word wrap feature is
set on my text widget), tk puts the information in the window but does
not update the scrollbar properly.  Particularly, even when the window
displays only a part of the text, the scrollbar shows that the window
contains ALL the text (the scrollbar is in its fully-extended form).
It is not surprising, then, that when I click on the arrow to move
down the text (or hold down button 2 and drag), nothing happens.

2. I want to put text into my text widget and then prevent it from
being edited.  I tried to disable my text widget using the "-state
disabled" but then my "$w.t insert 0.0 $AllMyText" obviously doesn't do
anything.  When I try to "$w.t configure -state disabled" after the
insert operation, it has no effect (i.e. I can still go in and edit
the text).

I'd appreciate any suggestions!

-jonathan



Newsgroups: comp.lang.tcl
From: ira@virtual.rdrc.rpi.edu (Ira Lee)
Subject: support for drag and drop in tk with Motif 1.2?
Organization: Rensselaer Polytechnic Institute, Troy NY
Distribution: usa
Date: Mon, 9 Nov 1992 19:21:49 GMT

Is there planned support for Motif's drag and drop with tk
in the near future? Thanks.
ira

Newsgroups: comp.lang.tcl
From: tewei@bnrca (Te-Wei Sun)
Subject: Scrolling Speed
Keywords: scroll canvas
Organization: Bell-Northern Research, Ottawa, Ontario, CANADA
Date: Fri, 6 Nov 92 15:38:02 GMT

To all tcl/tk experts:

I have posted a similar article before. However I did not get
any response. I guess I may have made a mistake on Distribution.
Therefore I am posting this article again.

I am trying to change the scrolling speed of the arrows and the
slider of the scroll bar in a canvas. This is rather urgent.
Any hint, help, information, comment and etc. will be very very
appreciated.

What I would like to do is the following:

1. When an arrow is pressed, the scroll speed would increase
as the time goes. For example, the first one second of scrolling
the canvas will be scrolling at one unit at a time. The next
second, the canvas will be scrolling at ten units at a time, and
so on.

2. The slider seems to be very sensitive to the mouse movement.
Therefore it is kind of hard to scroll to the desired position.
(Things go by too fast. You can hardly tell what they are.)
I would like to decrease the number of units of scrolling distance
when the slider detects a mouse movement, (if that is a reasonable
approach.)

3. I would like to achieve the above as much in tcl script as
possible.

I was planing on changing the scrollIncreament value every time
a Button-Press event on the arrow is detected by using the 
scrollIncreament option in canvas. However, this event seems to be
detected only once, even though the arrow is still being pressed.

I took a look at tkScrollbar.c and found out most of the mouse events
are handled in here, which somehow implies I might have to modify
the code to achieve what I want.

Questions:

1. Is there a way that I can get the auto-repeat event in tk, such that
   I know the arrow is still being pressed?
   If so, how? (If I can detect this event, maybe I can write a procedure
   to change the scrollIncrement value. Or is there a better approach?)

2. Is there a way to change the scrolling distance of the slider?
   If so, how?

This question may not apply to my problem, but I am very
curious about the answer.

3. When I do a configure on scrollIncrement, I saw two numbers in the
   output. One of them is the scrollIncrement distance. What about
   the other one? Is it adjustable through configure also?

This would be a suggestion for tk3.0.

4. Wouldn't it be nice to have the scroll bar mouse events been
   bound the way other widgets do, i.e. using 'bind' command in tk?

Again, thanks for any input.

---------------------------------------------------------------------------
Te-Wei Sun
tewei@bnr.ca
Newsgroups: comp.lang.tcl
From: spencer@med.umich.edu (Spencer W. Thomas)
Subject: Re: Biff revisited
Date: Fri, 13 Nov 92 11:49:42 EST
Organization: University of Michigan
Distribution: comp

And, of course, some bug fixes.  Two things: wrap actually getting the
headers in a "catch", and change the "min" to a "max", otherwise you
only get one line. Oops.

=S

***************
*** 159,170 ****
  
!       set m [open $MAIL r]
!       scanfile $scanc $m
!       close $m
  
!       set n [$l size]
        loop i 0 $n {
!               set w [max $w [string length [$l get $i]]]
        }
!       set n [min $n 1]
!       $l configure -geometry ${w}x$n
  }
--- 274,287 ----
  
!   catch {
!     set m [open $MAIL r];
!     scanfile $scanc $m;
!     close $m;
  
!     set n [$l size];
      loop i 0 $n {
!       set w [max $w [string length [$l get $i]]];
      }
!     set n [max $n 1];
!     $l configure -geometry ${w}x$n;
!   }
  }
--
=Spencer W. Thomas 		|  Info Tech and Networking, B1911 CFOB, 0704
   "Genome Informatician"	|  Univ of Michigan, Ann Arbor, MI 48109
Spencer.W.Thomas@med.umich.edu	|  313-747-2778, FAX 313-764-4133
From: ouster@sprite.Berkeley.EDU (John Ousterhout)
Newsgroups: comp.lang.tcl
Subject: Re: mixing fixed and variable components with the placer
Date: 9 Nov 1992 19:38:49 GMT
Organization: U.C. Berkeley Sprite Project
Distribution: world
NNTP-Posting-Host: tyranny.berkeley.edu

In article <BxBEBz.K6z@cs.psu.edu>, schwartz@roke.cs.psu.edu (Scott Schwartz) writes:
|> 
|> Consider the following code fragment:
|> 
|> frame .frame -borderwidth 10 -geometry 700x100
|> place [scrollbar .frame.scroll -relief sunken -command ".frame.list yview"] \
|> 	-in .frame -width 20 -relheight 1.0
|> place [listbox .frame.list -yscroll ".frame.scroll set" -relief sunken \
|> 		-geometry 80x10 ] \
|> 	-in .frame -x 20 -relheight 1.0 -relwidth 0.97
|> 
|> This puts a scrollbar and a listbox in a frame using the placer.  One
|> really unsightly feature is the ``-relwidth 0.97'' on the listbox.
|> There doesn't seem to be a clean way to ask the placer to let an
|> object fill the remaining space.  Because I want the scrollbar to be
|> fixed width, no relwidth for the listbox will be correct.  Because the
|> frame can change size, no fixed width will be correct.  What to do?

Use the packer instead.  It's designed just for situations like this.
For example, if you create widgets as above (but omit the "place"
commands), something like the following command should do the trick:

pack append .frame .frame.scroll {left filly} .frame.list {right expand fill}

I haven't actually tried this, so it may have bugs.  The placer isn't
really very powerful and I don't recommend it except for special cases.
From: raines@bohr.physics.upenn.edu (Paul Raines)
Newsgroups: comp.lang.tcl
Subject: tk_mainInterp and pish ???
Date: 6 Nov 92 23:17:49 GMT

Someone asked me this question a while back, but I erased
his message.

How does one get pish to compile from the graph-1.0 distribution
using the Tcl Extended libraries.  I get the following link error:

cc -o pish main.o graph.o htext2.o -O -prototypes -cckr
-float -L/usr/lib/tclX -ltk -ltcl -lXext  -lX11_s  -lsun -lmalloc 
-lc_s -lm
/usr/bin/ld:
Undefined:
tk_mainInterp

The problem seems to be that tclX puts the tkucbsrc/tkEvent.o file
into libtk.a but not tkucbsrc/main.o where tk_mainInterp is defined.
One can't just put main.o in since that causes all kind of errors.
Does pish not work with tclX?

-- 
Paul Raines	raines@purcell.physics.upenn.edu	215-898-8832
Dept. of Physics
University of Pennsylvania
Newsgroups: comp.lang.tcl
From: chare@unilabs.uucp (Chris Hare)
Subject: new user questions
Organization: UniLabs Research Group
Date: Tue, 10 Nov 1992 13:34:34 GMT

Tcl6.4
Tk2.3
SCO UNIX 3.2v4

Well, I'm missing something somewhere.  Consider this code extract:

catch { set fd [ open "$CategoryList" "r" ] } ok
puts stdout "fd = $fd"
set end { eof fd }
puts stdout "eof = $end"
while { $end == 0 } {
   set record { gets $fd }
   puts stdout "have $record"
   #
   # define the list
   #
   .left.list insert end $record
   set end { eof $fd }
puts stdout "eof = $end"
}

What I want to acheive is to fill a list box with the contents of a file.
The open and catch work OK (although I want to add code to test for failure
and show a dialog box ), but the problem specifically is with the call to
eof.  The puts after the call to eof says the variable end contains the
text "eof fd".  How do I do this properly?

In addition, is there a tcl command like split it perl?  I have in anotehr
file which will be processed the text for the list box, and then a keyword
which specifies the name of the file which is to be opened.  This
information separated by colons.

Thanks!
-- 
????                --- It Always works for me! ---                           
Chris Hare, UNIX Scientist                  Preferred : chare@unilabs.org
Just a mild-mannered consultant by day ....
From: gah@att.com (George A. Howlett)
Newsgroups: comp.lang.tcl
Subject: Re: graph-1.0
Date: 5 Nov 92 21:20:44 GMT
Article-I.D.: cbnewsm.1992Nov5.212044.10157
Reply-To: george.howlett@att.com
Organization: AT&T Bell Laboratories
X-Newsreader: TIN [version 1.1 PL6]

Derrick C. Cole (cole@concert.net) wrote:
: Has anyone successfully added the graph-1.0 widgets to tk2.3 with tclX6.4c?
: I've had 0 luck so far.
: 
: Any and all help will be greatly appreciated!
: Derrick
: 
: -- 
: "4. So-called "decorative floor mats" just flattened cap'n crunch boxes."
:                        -- Top Ten Signs You've Bought A Bad Car
: -----
: Derrick Cole              KC4WEJ              MCNC Center for Communications


If you have a version of tk2.3 wish that works with extended tclX6.4c, 
you are almost home free. 

In the file main.c, simply add the lines 

    extern Tcl_CmdProc GraphCmd;
    extern Tcl_CmdProc HypertextCmd;

before the main function.

And in the main function, after the line

    XSetForeground (Tk_Display (w), DefaultGCOfScreen (Tk_Screen (w)),
		    BlackPixelOfScreen (Tk_Screen (w)));

add the lines

    Tcl_CreateCommand (interp, "htext", HypertextCmd, (ClientData) w,
		       (Tcl_CmdDeleteProc *)NULL);
    Tcl_CreateCommand (interp, "xygraph", GraphCmd, (ClientData) w,
		       (Tcl_CmdDeleteProc *)NULL);
    Tcl_CreateCommand (interp, "barchart", GraphCmd, (ClientData) w,
		       (Tcl_CmdDeleteProc *)NULL);


Replace the main.c in the graph-1.0 distribution with this version.
Edit the Makefile (or Imakefile) adding in the appropiate paths
for the extended Tcl header files and the extended tcl library.
Then simply follow the instructions in the README.

--gah
Newsgroups: comp.lang.tcl
From: okamoto@hpcc05.corp.hp.com (Jeff Okamoto)
Newsgroups: comp.lang.tcl
Subject: selecting text then moving scrollbar bombs (tk2.3/tcl6.4)
Date: 13 Nov 92 02:01:09 GMT
Organization: HP Corporate Computing & Services

Got a strange problem with Tk 2.3 and Tcl 6.4 on an HP 9000/852 running
HP-UX A.08.00 displaying to a 9000/710 running A.08.07 under VUE 2.01.

Here's my script:

	scrollbar .scroll -command ".text yview" -relief raised
	text .text -yscroll ".scroll set" -width 80 -height 24 -relief sunken

	pack append . .scroll {right filly} .text {left expand fill}

	if $argc>0 {set file [lindex $argv 0]} else {set file "file-name"}

	.text insert end [exec cat $file]

The window pops up fine but if I do "certain things", my server will freeze
up, then drop me back to the Vue login screen.

After some experimentation, it *looks* like these "certain things" may be
related to selecting a portion of text, then moving the scrollbar *before
the selection is completely highlited*.  Interestingly enough, with -sync
turned on, this doesn't seem to bomb out from VUE/X.

Does anyone have any suggestions on what to do to better nail down what's
happening?
-- 
 \      oo	The New Number Who,
  \____|\mm	Jeff Okamoto
  //_//\ \_\	HP Corporate Computing & Services
 /K-9/  \/_/	okamoto@ranma.corp.hp.com
/___/_____\	
-----------	(415) 857-6236
Newsgroups: comp.lang.tcl
From: lwv26@cas.org (Larry W. Virden)
Subject: Diffs to the comp.lang.tcl FAQ for November, 1992
Followup-To: comp.lang.tcl
Reply-To: lvirden@cas.org (Larry W. Virden)
Organization: Nedriv Software and Shoe Shiners, Uninc.
Date: Sun, 8 Nov 1992 12:58:04 GMT


Below are the Unified Diffs for the 3 Tcl FAQ files.  This is provided
as an add on service to the readership.  PLEASE be sure to read either the
FAQ or the diffs to get a feel for the FAQ.  If there is info that is wrong,
incomplete or misleading be sure to let me know.  If you have written any
papers, books or in-house tutorial info on Tcl, Tk or any related packages
and can share this information, let me know so that I can add the appropriate
bibliographic information to the FAQ.  And if you have any software which uses
any of the Tcl based packages that you are willing to share - even on an
"as-is" basis, please let us know!

As always, if anyone would like to assist in maintaining these FAQs, please
let me know.  I would especially like to find someone who would like to take
over the actual question and answer section (part 2).

--- old.tcl-faq.p01	Thu Oct  8 10:11:04 1992
+++ tcl-faq.p01	Sun Nov  8 07:43:48 1992
@@ -2,7 +2,7 @@