HDTenEightyP/NetNews huggingface dataset:
From: shmdgljd@rchland.vnet.ibm.com (Jay Schmidgall)
Subject: Core dump when delete chars in text widget
Date: Sat, 26 Sep 1992 19:41:23 GMT
Reply-To: jay@vnet.ibm.com
Disclaimer: This posting represents the poster's views, not necessarily those of IBM
Organization: IBM Rochester, MN

I've been getting core dumps when deleting characters in the text widget.

call stack is usually Rebalance, TkBTreeDeleteChars, tkText.DeleteChars().

codecenter tells me that on

tkTextBTree.c:722   nodePtr = line2Ptr->parentPtr;

line2Ptr is pointing to freed memory; unfortunately, I haven't been able
to track down where it is being freed.

Of course, if I recompile tcl/tk with TCL_MEM_DEBUG defined, everything
works fine.  I've also tried using a local malloc debug package which
did basically the same things as the tcl memory stuff; the core dump still
occurred but the information I got didn't help much.

I'm on AIX 3.2.2, x11r4.  Has anyone else seen this problem?

-- 
: jay          jay@vnet.ibm.com    My opinions and ideas, not my employer's.
: shmdgljd@rchland.vnet.ibm.com    (c) Copyright 1992.  All rights reserved.
Newsgroups: comp.lang.tcl
From: alan@ulka.zso.dec.com (F. Alan Jones)
Subject: Is there a tcl interface to Motif, even commercial? 
Reply-To: alan@ulka.zso.dec.com (F. Alan Jones)
Organization: Digital Equipment Corporation
Date: Tue, 6 Oct 1992 17:26:54 GMT


The subject says it all.

Alan
From: douglas@bcsaic.boeing.com (Douglas Schuler)
Newsgroups: comp.lang.tcl
Subject: Several questions about Tcl/Tk
Keywords: tcl, tk, WWW, mail readers, widgets, et cetera
Date: 2 Oct 92 22:05:16 GMT
Organization: Boeing Computer Services, Seattle



I've just started to look at Tcl/Tk and I'm pretty excited about
the possibilities.  I have several questions and requests that 
I'm curious about.  If anybody has an insights on these questions,
please post your thoughts to this group or mail them to me.
Thanks!

-- Doug Schuler
   Boeing Computer Services


1.  Is there an archive of previous postings to this newsgroup?
I'd like to get a copy of these to scan through.

2.  Does a cookbook/tutorial exist that shows the steps that
one takes to add a tcl interpreter to an existing application?

3.  I'm working on an "intelligent mail" ("Imail") application
where I want to embed source code (in some language) within
pieces of mail which will then be interpreted by the reader.
I'd like to use tcl for this.  Does anybody have any thoughts on
this or pointers to similar approaches taken with other platforms,
mail readers, or interpreted languages?   Some aspects of the WWW 
(World Wide Web) approach might be useful.

4.  Speaking of the WWW, what are Hyper widget or XYGraph widgets?

5.  The Tk approach of using "send" is very useful and flexible.
I'm wondering, however, if there is there an approach that would make 
the Tk widgets more secure by "turning off" access (by any mechanism)
to some programs or users that might be issuing send commands that
shouldn't be interpreted.

6.  I'm wondering if there is any way that the send command can be
issued to widgets *not* on the desktop.

7.  I'd like any and all references to additional papers on Tcl or
Tk besides the two winter Usenix papers.  Are there more?

8.  I read that there were over 50 applications using tcl/tk.  It
would be very interesting and useful to hear some about those 
efforts.


Apologies in advance if any [or all] of these questions are stupid
or not well thought out.  That's the way I prefer to work!


 
-- 
   ** MY VIEWS MAY NOT BE IDENTICAL TO THOSE OF THE BOEING COMPANY **
	Doug Schuler     (206) 865-3832
	douglas@atc.boeing.com
From: larry@tweety.cs.berkeley.edu (Larry Rowe)
Newsgroups: comp.lang.tcl
Subject: Commercial use of Tcl/Tk
Date: 29 Sep 1992 14:43:14 GMT
Organization: U.C. Berkeley EECS Dept.
Distribution: world
Reply-To: larry@cs.Berkeley.EDU
NNTP-Posting-Host: tweety.cs.berkeley.edu

Some time ago I conducted a survey to see if folks on the newsgroup 
wanted to hear about commercial products that use Tcl/Tk.  Surprisingly,
the answer was an overwhelming YES from the people that responded.  I got
19 responses (listed below) and everyone said yes.  So, the next message
will contain the first description of a commercial use of Tcl/Tk.

If you want to submit a description of how you are using Tcl/Tk in a 
commercial product, send me a message saying who the company is, what
the product is, and a short description of your use of Tcl/Tk.  In the
interest of brevity, I suggest we keep these announcements under 250
words.  People interested in more details can send email to the sender.

I'll keep an updated copy of these descriptions and eventually merge
them into the FAQ.
	Larry
------------------
People who voted YES:


  bacon!IMSI.COM!jordan@uu3.psi.com Tue Aug 25 17:58:10 1992
  bjv@shasta.tivoli.com Thu Aug 27 11:30:20 1992
  cpetterb@javelin.sim.es.com Fri Aug 28 16:57:28 1992
  david@twg.com Thu Aug 27 10:48:36 1992
  decwrl!uucp@ucbvax.Berkeley.EDU Tue Aug 25 14:38:49 1992
  faustus@ygdrasil.CS.Berkeley.EDU Fri Aug 28 08:46:19 1992
  jackm@sparrow.pica.army.mil Tue Aug 25 04:54:28 1992
  kjx@comp.vuw.ac.nz Mon Aug 24 22:14:26 1992
  lwv26@cas.org Tue Aug 25 03:24:22 1992
  markd@grizzly.com Tue Aug 25 04:56:49 1992
  mooney@oxygen.aps1.anl.gov Tue Sep  1 11:25:18 1992
  nitin@ingres.com Fri Aug 28 17:04:26 1992
  ouster@sprite.Berkeley.EDU Mon Aug 24 17:09:23 1992
  para1!paranet.com!sheik@uunet.UU.NET Mon Aug 31 08:01:21 1992
  pierson@cra.mlo.dec.com Mon Aug 31 08:03:22 1992
  sugar!karl@uu.psi.com Sat Aug 29 08:31:59 1992
  sylvaner!sani@alux2.att.com Tue Aug 25 04:38:40 1992
  tjt@blink.att.com Fri Aug 28 18:10:45 1992
  wave@MEDIA-LAB.MEDIA.MIT.EDU Mon Aug 24 22:22:07 1992
From: ouster@sprite.Berkeley.EDU (John Ousterhout)
Newsgroups: comp.lang.tcl
Subject: Re: Tcl bug? Array indices containing spaces
Date: 2 Oct 1992 15:53:18 GMT
Organization: U.C. Berkeley Sprite Project
Distribution: world
NNTP-Posting-Host: tyranny.berkeley.edu

In article <1992Oct1.201804.52@awdprime.austin.ibm.com>, madere@julius.austin.ibm.com (Steve Madere) writes:
|> I tried to do the following in Tcl and got some interesting errors:
|> 
|> set vector("a b") "dog"
|> 
|> It failed because Tcl doesn't handle array indices that contain
|> spaces.  The following works:
|> 
|> set vector("a.b") "dog"
|> 
|> It was difficult to figure out that this was the problem because the
|> Tcl man page does not mention any problems with spaces in array
|> indices.  What it says is:
|> 
|>           There are two special forms for variable  substitution.   If  |
|>           the next character after the name of the variable is an open  |
|>           parenthesis, then the variable is assumed  to  be  an  array  |
|>           name, and all of the characters between the open parenthesis  |
|> 		    --------------------------------------------------
|>           and the next close parenthesis are taken as  an  index  into  |
|>           ------------------------------------------------------------
|>           the array.  Command substitutions and variable substitutions  |
|>           ----------
|>           are performed on the  information  between  the  parentheses  |
|>           before it is used as an index.  For example, if the variable  |
|>           x is an array with one element named first and value 87  and  |
|>           another element named 14 and value more, then the command     |
|> 
|> 
|> Is this an oversite in the man page or a bug in Tcl?
|> 
|> 
|> Steve Madere
|> (Do not reply with R! use the following address)
|> madere%aixserv@uunet.uu.net

Both the manual entry and the behavior described above are "correct", but
I'll admit it's confusing.  If you say

set b $vector("a b")

then the reference to vector is handled using variable substitution in
the Tcl parser.  In this case, the parser includes everything between
the parentheses in the variable name, even though there's a space there.
This is the behavior described in the manual entry excerpt above.

However, if you say

set vector("a b") dog

no variable substitution occurs, so the manual excerpt above isn't relevant.
This is just a normal Tcl command.  Unfortunately, the space between a and
b causes a word break (normal Tcl parsing rules), so the set command receives
three arguments:
    vector("a
    b")
    dog
When this command is parsed Tcl has no idea that the first argument is
supposed to be a variable name so it can't apply the rules for variable
substitution.  The solution is just to enclose the whole argument in
quotes:

set "vector(a b)" dog

I'm sorry for the confusion this must cause, but I don't know of any
way to avoid the problem.
Newsgroups: comp.lang.tcl
From: madere@julius.austin.ibm.com (Steve Madere)
Newsgroups: comp.lang.tcl
Subject: Re: Core dump when delete chars in text widget
Date: 1 Oct 92 20:07:20 GMT
Reply-To: madere%aixserv@uunet.uu.net
Organization: IBM, Austin


In article <1992Oct01.115218.26376@rchland.ibm.com>,
shmdgljd@rchland.vnet.ibm.com (Jay Schmidgall) writes:
|> In article <1992Oct1.084817.15289@aragorn.unibe.ch>,
haedener@iacrs1.unibe.ch (Konrad Haedener) writes:

|> |> I'm getting the same behaviour under 3.2.1/R4.
|> |> Setting 
|> |>   MALLOCTYPE=3.1
|> |>   export MALLOCTYPE
|> |> prior to invoking my tk based application makes the core dump phenomenon
|> |> disappear. Programs running well with version 3.1 malloc strategy and 
|> |> producing SIGSEGVs with MALLOCTYPE 3.2 are _always_ referencing freed
|> |> memory or corrumping malloc-internal structures or violating malloc rules
|> 
|> Unfortunately, tcl/tk has been compiled under 3.1.5. I.e. MALLOCTYPE=3.1
|> by default.  I've also tried compiling it under 3.2.2 and gotten the
|> error as well.
|> 
|> -- 
|> : jay          jay@vnet.ibm.com    My opinions and ideas, not my employer's.
|> : shmdgljd@rchland.vnet.ibm.com    (c) Copyright 1992.  All rights reserved.


Compiling under 3.1.5 does not imply MALLOCTYPE=3.1 unless you are also
running on a 3.1.5 machine.  We have seen plenty of 3.2-specific problems
here when running 3.1.5 code on 3.2 machines.  By default on a 3.2 machine,
the newer version of malloc is used regardless of the compiler that
produced the executable (The wonders of shared libraries!).

So, the analysis by Haedener is correct.

As for myself, I am getting by temporarily by defining TCL_MEM_DEBUG.
I hope a 'real' fix for this comes out soon.
It is my guess that the only way to track this bug down on a non-
AIX 3.2 machine is to put some really anal-retentive consistency checking
into ckmalloc() and ckfree() and delete alot of text in small chunks.

    ie:  fill all freed memory with a unique identifier byte
	 fill all newly allocated memory with another unique identifier byte
	 set all invalidated pointers to a unique value like 0xdeadbeef
	 check for all of these at every opportunity.

Like I said before, the code in which the bug occurs looks really hairy
so it would be a tremendous time sink for anyone but the author to try
to find it.

Steve Madere
(Do not reply with R! use the following address)
madere%aixserv@uunet.uu.net
From: ouster@sprite.Berkeley.EDU (John Ousterhout)
Newsgroups: comp.lang.tcl
Subject: Re: Excluding modifiers when bind-ing
Date: 30 Sep 1992 15:44:54 GMT
Organization: U.C. Berkeley Sprite Project
Distribution: world
NNTP-Posting-Host: tyranny.berkeley.edu

In article <1992Sep29.212530.26209@rchland.ibm.com>, shmdgljd@rchland.vnet.ibm.com (Jay Schmidgall) writes:
|> I'd like to set up a bind for a text widget much like the default binding
|> from tk.tcl:
|> 
|> bind Text <Any-KeyPress> {
|>     if {"%A" != ""} {
|> 	%W insert insert %A
|> 	%W yview -pickplace insert
|>     }
|> }
|> 
|> except I'd like it to be for any keypress where the Ctrl key is _not_ a
|> modifier.  I RTFM and didn't find any means of excluding modifiers like
|> in translations for Xt/Motif.  I also didn't see anything I could pass
|> to my command that I could check the modifier state.
|> 
|> Is there a way to do this that I overlooked? (I hope!)  Thanks.
|> 
|> -- 
|> : jay          jay@vnet.ibm.com    My opinions and ideas, not my employer's.
|> : shmdgljd@rchland.vnet.ibm.com    (c) Copyright 1992.  All rights reserved.

There's no direct support for this in the "bind" command, but you can
do it with a Tcl script such as the following:

bind Text <Any-KeyPress> {key %W %A %s}

proc key {w char state} {
    if {$state & 4} return
    if {$char != ""} {
        $w insert insert $char
	$w yview -pickplace insert
    }
}

The binding passes the state (%s) from the event through to the
procedure, then the procedure checks the state for the control
modifier (4) and ignores the event if it's set.  You also could
do the same thing with a direct binding as in your message,
instead of the procedure, if you prefer.
From: libes@cme.nist.gov (Don Libes)
Newsgroups: comp.lang.tcl
Subject: Re: Clearing spawned process output
Date: 28 Sep 92 13:37:18 GMT
Organization: National Institute of Standards and Technology

In article <1992Sep23.182509.22938@bnr.ca> colton@bnr.ca (Kevin Colton) writes:
>Can someone tell me how to clear the expect input buffers
>of any "old" spawned process output?  I'd like to do the
>following:
>
>  clear old output
>  send "command"
>  expect "command_output" { ... }

According to the man page:
                                                  ....  The  pat-
               tern  "*"  will  flush  the  output buffer without
               reading any more output from the process.

Interestingly, there is no special coding to handle this (so you
shouldn't need special coding in your brain to remember it).  It's
just a natural by-product of "*" that it matches everything (and
nothing).

Don
From: eo@ansa.co.uk (Ed Oskiewicz)
Newsgroups: comp.lang.tcl
Subject: How do you turn off grab?
Date: 5 Oct 92 12:23:53 GMT


Sorry if the question is a bit vague, I'll try to clarify: I want to exec a
process in a new window and have the exec'd child and it's parent both able to
process X events.

I want to press a button and fire up an emacs window, so I create a button in
which the command is a proc called Comp (yes it's a tk replacement for xmh and
it's nearly ready for alpha test).

Comp looks like:

proc Comp  {} {
  EditDraft some args
}

proc Edit Draft {} {
  do some stuff
  WhatNow some args
}

proc WhatNow {file} {
  exec emacs some args here
  lots more stuff
}

I don't think the nesting is relevant but you never know. Now the problem is
that while the emacs is running no X events like refresh or mouse tracking,
button press recognition are recognised in my main browser window but they are
in any other window.

I've tried putting "after 10 Comp" as the button command and putting "grab
none" before the exec of emacs all to no avail. I guess what I've got here is
a local grab, is there any way of turning it off (or of making the emacs seem
like another application)? If this is an RTFM I'd be grateful for chapter and
verse.

Cheers,

Ed Oskiewicz

email:	eo@ansa.co.uk (mcsun!uknet!ansa!eo)	ANSA,
tel:	+44 223 323 010				Poseidon House,
fax:	+44 223 359 779				Castle Park,
						Cambridge CB3 0RD, UK
Newsgroups: comp.lang.tcl
From: ellson@ontap.att.com (John C Ellson)
Subject: dld on SunOS 4.1.1 ?
Reply-To: ellson@hotsand.att.com
Organization: AT&T
Date: Sun, 4 Oct 1992 08:58:20 GMT
Originator: ellson@ontap

I would like to embed extensions into wish using the dynamic loader
facilities provided by barkley.berkely.edu:/tcl/extensions/tclX_dld.shar.Z 
and prep.ai.mit.edu:/pub/gnu/dld-3.2.3.tar.Z

Is there some trick to getting dld-3.2.3 to work under SunOS 4.1.1 ?

dld compiles without problem, but I get memory faults when I run the
test programs.  For example:

	homebrew:~/dld-3.2.3/test/simple> ./simple
	Hello world from ./simple
	Memory fault

John.Ellson@att.com
From: larryt@canada.sun.com (Larry Tsui - OpCom Staff)
Newsgroups: comp.lang.tcl
Subject: scan.test fail on Solaris2.0FCS
Keywords: scan, test, tcl6.4, solaris2.0
Date: 29 Sep 92 17:05:17 GMT
Reply-To: larryt@canada.sun.com
Organization: Sun Microsystems Computer Corp., OPCOM.

Folks,

I have successfully compiled tcl 6.4 on Solaris2.0 machine.  I ran
tclTest and all tests passed except the following:

scan.test 
 
 
==== scan-2.22 floating-point scanning 
==== Contents of test case: 
 
    set a {}; set b {}; set c {}; set d {}
    scan "4.6 99999.7 876.43e-1 118" "%f %f %f %e" a b c d
    set b
 
==== Result was: 
100000 
---- Result should have been: 
99999.7 
---- scan-2.22 FAILED 


Does anyone have any ideas?  All hints welcomed.


Thanks!

Larry
---
larry.tsui@canada.sun.com  -or-  sun!suncan!larryt
Newsgroups: comp.lang.tcl
From: shmdgljd@rchland.vnet.ibm.com (Jay Schmidgall)
Subject: Insertion cursor color change ?
Date: Sat, 26 Sep 1992 22:28:03 GMT
Reply-To: jay@vnet.ibm.com
Disclaimer: This posting represents the poster's views, not necessarily those of IBM
Organization: IBM Rochester, MN

How can I change the color of the insertion cursor in the text widget?

If I change the colors to a dark background with light foreground, the
cursor stays black and gets lost in the background...

-- 
: jay          jay@vnet.ibm.com    My opinions and ideas, not my employer's.
: shmdgljd@rchland.vnet.ibm.com    (c) Copyright 1992.  All rights reserved.
Newsgroups: comp.lang.tcl
From: dov@menora.weizmann.ac.il (Dov Grobgeld)
Subject: regsub question
Organization: Mail to News Gateway at Wang Labs
Date: Tue, 6 Oct 92 12:38:26 WET

I'm having troubles understanding regsub. Here is a piece of tcl
code in which I triy to use it:

    proc smartCloseBrace {w} {
        textDisplayCaret $w false;
        set ip [textGetInsertionPoint $w];
        set l [getCurrentLine $w];

        if [[regsub "    \$" $l {} l] != 0] {
            setCurrentLine $w $l\};
            setInsertionPoint $w [expr $ip - 3];
        }
        { callActionProc $w insert-string "\}"; }
        textDisplayCaret $w true;
    }

Whenever I try to invoke this procedure I get the error message:

    Wafe(execActionProc): invalid command name: "1"

What am I doing wrong? I think I have exhausted all possibilities
of "expr", "eval" and braces...

In Perl what I want to do would look something like

       if ($l=~ s/    $//) {
           &setCurrentLine($l);
           &setInsertionPoint($w, $ip-3);
       }
       else {
           &callActionProc($w, 'insert-string "\}');
       }
Any help is appreciated.

--
     'tsom kal!'                                        ___   ___
                                                      /  o  \   o \
Dov Grobgeld                                         ( o  o  ) o   |
The Weizmann Institute of Science, Israel             \  o  /o  o /
"Where the tree of wisdom carries oranges"              | |   | |
                                                       _| |_ _| |_
From: madere@julius.austin.ibm.com (Steve Madere)
Newsgroups: comp.lang.tcl
Subject: Re: Core dump when delete chars in text widget
Date: 29 Sep 92 16:10:48 GMT
Reply-To: madere%aixserv@uunet.uu.net (Steve Madere)
Organization: IBM, Austin


In article <1992Sep26.194123.24976@rchland.ibm.com>,
shmdgljd@rchland.vnet.ibm.com (Jay Schmidgall) writes:
|> I've been getting core dumps when deleting characters in the text widget.
|> 
|> call stack is usually Rebalance, TkBTreeDeleteChars, tkText.DeleteChars().
|> 
|> codecenter tells me that on
|> 
|> tkTextBTree.c:722   nodePtr = line2Ptr->parentPtr;
|> 
|> line2Ptr is pointing to freed memory; unfortunately, I haven't been able
|> to track down where it is being freed.
|> 
|> Of course, if I recompile tcl/tk with TCL_MEM_DEBUG defined, everything
|> works fine.  I've also tried using a local malloc debug package which
|> did basically the same things as the tcl memory stuff; the core dump still
|> occurred but the information I got didn't help much.
|> 
|> I'm on AIX 3.2.2, x11r4.  Has anyone else seen this problem?
|> 
|> -- 
|> : jay          jay@vnet.ibm.com    My opinions and ideas, not my employer's.
|> : shmdgljd@rchland.vnet.ibm.com    (c) Copyright 1992.  All rights reserved.

I tried to reply via e-mail but your address is unknown around here.

YES, I'VE HAD EXACTLY THE SAME PROBLEM!

Since we both had this problem on a RS6000 and no one else has reported
the problem (it seems like they would have run across it by now!),
it must be specific to the 6000.

OK, so now we've got it narrowed down a bit.  

We need to talk about operating system versions etc. to find the
real source of this problem.

Please call me on tl/793-8430 when you get a chance.
(Or post your VM address so we can converse via e-mail)


Steve Madere
(Do not reply with R! use the following address)
madere%aixserv@uunet.uu.net
From: shmdgljd@rchland.vnet.ibm.com (Jay Schmidgall)
Newsgroups: comp.lang.tcl
Subject: Re: Pre-creating Dialog Boxes
Date: 1 Oct 92 15:49:55 GMT
Reply-To: jay@vnet.ibm.com
Organization: IBM Rochester, MN
Disclaimer: This posting represents the poster's views, not necessarily those of IBM

In article <1992Oct1.135632.17579@walter.bellcore.com>, tjj@thumper..bellcore.com (J Tim Jordan) writes:
|> I've noticed a problem with the above solution. If you were to
|> 
|> toplevel .t 
|> wm withdraw .t
|> 
|> the window won't be withdrawn. I found that I need to wait about 3 seconds
|> or so after creating the toplevel before withdrawing it.

I haven't seen this; in fact, I can do

wm withdraw [toplevel .a]

and I don't see any flicker or anything.

-- 
: jay          jay@vnet.ibm.com    My opinions and ideas, not my employer's.
: shmdgljd@rchland.vnet.ibm.com    (c) Copyright 1992.  All rights reserved.
Newsgroups: comp.lang.tcl
From: pjyamamo@watdragon.uwaterloo.ca (Peter Yamamoto)
Subject: How to...
Organization: University of Waterloo
Date: Thu, 1 Oct 1992 21:17:04 GMT
X-Mailer: ELM [version 2.3 PL11]

Sorry if this is an FAQ but I have read through man pages
and documents and ....

I wrote a script to connect to our library's on-line
catalogue and to look up issn #'s given a file of call no's.
[the call no are distributed elctronicly from the library
but not the issn's].

Ok fine the script goes through the paces ok except...

the output basicly looks like
FIELDHEADER: field value^M
where I write ^ and M here but of course I mean CTL-M.

so I match something like:
-re "ISSN: (\[^^M\]+)" {set issn expect_out(1,string)}

which as I say works ok but...

Sometimes it doesn't catch the whole string.
I can see that it started to match since it prints out some
prefix but it doesn't always catch it.

The Question:

Is this possibly because the output from the catalogue system
is coming too fast (and if so wat can I do?)
or is something else inherent in the expect statement:

for {set i 0} {$i < $numcall} {set i [expr $i+1]} {

	set callno [lindex $callnos $i]
	set cmd cat/4/1/$callno/1/ful

	set issn ""
	set title ""

	send $cmd\r

	expect {
		-re "TITLE: (\[^\]+)"             {set title $expect_out(1,string); continue -expect}
		-re "ISSN/CODEN/ETC\.:\ (\[^\]+)" {set issn $expect_out(1,string); continue -expect}
		-re {.*CARRIAGE RETURN.*$}      {}
	}

	send_user \n$callno\t$issn\t$title\n

}

Oh yeah and if there is an easier way of collecting the output in a file
than send_user and redirecting the script's output into a file,
please tell me.

Standard request: PLEASE at least Cc: answers via email as I do not
regularly read this group. If anybody is interested in the answer email
me and I will forward any (hopefully some) replies.

Thank you,
Peter
Newsgroups: comp.lang.tcl