HDTenEightyP/NetNews huggingface dataset:
From: scs@lokkur.dexter.mi.us (Steve Simmons)
Subject: TCL3.0 installation lack
Organization: Inland Sea
Date: Mon, 21 Dec 92 03:19:13 GMT

Very minor --

When doing `make install', neither tcl.h nor tk.h are installed.

More problematic --

'cp -f' for install bombs on SunOS 4.1.1.
-- 
 "When Dexter's on the Internet, can Hell be far behind?"
		-- Steve Simmons, scs@lokkur.dexter.mi.us
From: jak@garnet.berkeley.edu (John A. Kunze)
Newsgroups: comp.lang.tcl
Subject: setting globals in tk.tcl
Date: 17 Dec 1992 02:55:32 GMT
Organization: University of California, Berkeley
Distribution: world
NNTP-Posting-Host: garnet.berkeley.edu

When you source tk.tcl from wish.tcl, the "set" commands correctly
reference globals.  Not true when you source it in the general case.

I've fixed my code with "uplevel #0 source tk.tcl" but am wondering
if it wouldn't make more sense to declare the appropriate variables
as globals inside tk.tcl.

-John
From: joel@saffron.CS.Berkeley.EDU (Joel A. Fine)
Newsgroups: comp.lang.tcl
Subject: Disappearing scrollbars?
Date: 16 Dec 1992 23:29:12 GMT
Organization: University of California, Berkeley
Distribution: world
NNTP-Posting-Host: saffron.cs.berkeley.edu

Hi,

Is it possible to arrange for a scrollbar which only appears if there is
enough information in its corresponding window to have reason to scroll?
E.g. if an entry window is filled with text, have a scrollbar appear, but
in (say) the normal case, when there is only a little text in the entry window,
no scrollbar? Or, if a listbox has few enough entries that they are all visible,
no scrollbar, but if some are invisible, scrollbar appears?

I suppose I could do it manually with bindings and packing/unpacking at the
right moment, but that seems a bit cumbersome. Any suggestions?

- Joel
Newsgroups: bnr.lang.tcl,comp.lang.tcl
From: norm@bnr.ca (Norm MacNeil)
Subject: Re: toplevel message widgets problem
Reply-To: norm@bnr.ca
Organization: Bell-Northern Research Ltd.
Date: Wed, 16 Dec 1992 14:44:56 GMT

In article <1992Dec16.125806.29710@rchland.ibm.com>, shmdgljd@rchland.vnet.ibm.com (Jay Schmidgall) writes:
|> In article <1992Dec15.233825.18609@bcars6a8.bnr.ca>, norm@bnr.ca (Norm MacNeil) writes:
|> |> MsgCntl BEGIN "Processing - please wait..."
|> |> #life happens here
|> |> MsgCntl END ""
|> |> 
|> |> Anyway, sometimes the text appears in the message window and sometimes it
|> |> doesn't.
|> 
|> It could be that the events haven't finished processing before you start
|> your other processing.  Try putting an `update' right after MsgCntl BEGIN
|> 
|> -- 
|> : jay          jay@vnet.ibm.com    My opinions and ideas, not my employer's.
|> : shmdgljd@rchland.vnet.ibm.com    (c) Copyright 1992.  All rights reserved.

  Well, I thought that the "update" about the 4th last line in the procedure
would have been sufficient, but I tried putting another "update" as you
stated but to no avail:no message appeared.

  I still think it's something simple I've missed 'cause I modelled this proc
after the mkDialog.tcl available in the .../library/demos directory.

  Anyone else got any ideas?

  Thanks,
    Norm.
-- 
+-----------------------------------------------------------------------+
 Norm MacNeil                     Phone: (613) 763-7497
 Data Systems                     Fax:   (613) 765-2854
 Bell-Northern Research Ltd.      EMail: norm@bnr.ca (INTERNET)
 #include <disclaimer.std>       "Roller bladers do it in-line!"
From: ouster@sprite.Berkeley.EDU (John Ousterhout)
Newsgroups: comp.lang.tcl
Subject: Re: Exiting tk Apps
Date: 12 Dec 1992 00:18:49 GMT
Organization: U.C. Berkeley Sprite Project
Distribution: world
NNTP-Posting-Host: tyranny.berkeley.edu

In article <1992Dec10.151958.5766@texhrc.uucp>, schendr@texhrc.uucp (Dan R. Schenck) writes:
|> When exiting a tk application with the tcl exit command, the application is
|> destroyed except a notion of it still hangs around as evidenced by doing a 
|> winfo interps.  Example:
|> 
|> 	1) application foo is exited with: exit 0
|> 	2) in wish I do a winfo interps and foo is still listed
|> 	3) if I try to send to foo I get this message: 
|> 		receiver never heard of interpreter "foo"
|> 
|> The question is, can I exit an application with a specified return code and not
|> have it appear that the application is still there when another app does a
|> winfo?  Now I have to send the app a message and catch any error just to see
|> if it really exists.  The only alternative is to exit all tk applications
|> with "destroy .", which means I can't exit with a return code.
|> -- 
|> +--------------- Dan R. Schenck - Data Management - TEXACO EPTD ---------------+
|> |  External Email:  schendr@Texaco.COM        Texaco Email:  schendr@texhrc    |
|> |    _   __         Voice:    (713) 954-6053  Fax:  (713) 954-6911  	       |
|> |   /_) /-/ /\/     US Mail:  Texaco, Inc., 3901 Briarpark, Houston, TX 77042  |


You need to use "destroy ." to clean up all of the application's state, such
as removing its interpreter registration.  I haven't tried this, but I'll bet
you can do

destroy .
exit $value

to both clean up the window state and exit with a specific exit code.
Newsgroups: comp.lang.tcl
From: tthorn@daimi.aau.dk (Tommy Thorn)
Subject: patch to tk3.0 for HP-UX 8.0
Organization: DAIMI: Computer Science Department, Aarhus University, Denmark
Date: Fri, 18 Dec 92 15:26:12 GMT

This is my attempt to compile tk3.0 on a snake (hp9000s700) with gcc 2.3.2

  make
        gcc -O6 -I. -DTCL_LIBRARY=\"/users/tthorn/lib/tcl\" -c tclExpr.c
  In file included from tclExpr.c:33:
  tclUnix.h:297: conflicting types for `fseek'
  /usr/local/include/stdio.h:136: previous declaration of `fseek'

int/long return type conflict. Fix: #if'defed

        gcc -O6 -I. -DTCL_LIBRARY=\"/users/tthorn/lib/tcl\" -c tclTest.c
  tclTest.c:28: macro `Tcl_DumpActiveMemory' used without args

Fix: /* xx */

Passed all tests in tests.

  cd ..
  make
        gcc -I. -Itcl -O6 -DTK_LIBRARY=\"/users/tthorn/lib/tk\" -c tk3d.c
  In file included from tk3d.c:21:
  tkConfig.h:123: conflicting types for `select'
  /usr/local/include/sys/time.h:146: previous declaration of `select'

Fix: #ifdef'ed select in tkConfig.h

As a patch to tk3.0:
-----------------------------------------------------------
diff -u +recur tk3.0/tcl/tclTest.c tk3.0-hpux/tcl/tclTest.c
--- tk3.0/tcl/tclTest.c	Sun Dec 13 02:19:03 1992
+++ tk3.0-hpux/tcl/tclTest.c	Fri Dec 18 11:58:21 1992
@@ -25,7 +25,7 @@
 #include <stdlib.h>
 #include "tcl.h"
 
-extern int Tcl_DumpActiveMemory();
+/*extern int Tcl_DumpActiveMemory();*/
 
 Tcl_Interp *interp;
 Tcl_CmdBuf buffer;
diff -u +recur tk3.0/tcl/tclUnix.h tk3.0-hpux/tcl/tclUnix.h
--- tk3.0/tcl/tclUnix.h	Sat Aug 22 00:59:18 1992
+++ tk3.0-hpux/tcl/tclUnix.h	Fri Dec 18 11:53:14 1992
@@ -294,7 +294,9 @@
 extern int	execvp	   _ANSI_ARGS_((CONST char *name, char **argv));
 extern void	_exit 	   _ANSI_ARGS_((int status));
 extern pid_t	fork	   _ANSI_ARGS_((void));
+#ifndef __hpux__
 extern long	fseek	   _ANSI_ARGS_((FILE *stream, long offset, int base));
+#endif
 extern uid_t	geteuid	   _ANSI_ARGS_((void));
 extern pid_t	getpid	   _ANSI_ARGS_((void));
 extern char *	getcwd 	   _ANSI_ARGS_((char *buffer, int size));
Only in tk3.0-hpux/tcl: tclUnix.h.bak
diff -u +recur tk3.0/tkConfig.h tk3.0-hpux/tkConfig.h
--- tk3.0/tkConfig.h	Wed Nov 11 00:11:22 1992
+++ tk3.0-hpux/tkConfig.h	Fri Dec 18 14:19:24 1992
@@ -118,8 +118,10 @@
 #endif
 extern void		panic _ANSI_ARGS_(VARARGS);
 extern int		read _ANSI_ARGS_((int fd, char *buf, int numBytes));
+#ifndef __hpux__
 extern int		select _ANSI_ARGS_((int nfds, SELECT_MASK *readfds,
 			    SELECT_MASK *writefds, SELECT_MASK *exceptfds,
 			    struct timeval *timeout));
+#endif
 
 #endif /* _TKCONFIG */
--------------------------------------------------------
-- 
Tommy.Thorn@daimi.aau.dk | If you use a PC consider upgrading to a real OS.
Join the League for Pro- | Linux is Posix (Unix). It has GCC,Emacs,X11,TCP,NFS,
gramming Freedom, LPF    | Doc,Interviews,Prolog...(you name it) and it's free!
From: ouster@sprite.Berkeley.EDU (John Ousterhout)
Newsgroups: comp.lang.tcl
Subject: Re: Disappearing scrollbars?
Date: 17 Dec 1992 16:36:18 GMT
Organization: U.C. Berkeley Sprite Project
Distribution: world
NNTP-Posting-Host: tyranny.berkeley.edu

In article <1goe48INN3sg@agate.berkeley.edu>, joel@saffron.CS.Berkeley.EDU (Joel A. Fine) writes:
|> Hi,
|> 
|> Is it possible to arrange for a scrollbar which only appears if there is
|> enough information in its corresponding window to have reason to scroll?
|> E.g. if an entry window is filled with text, have a scrollbar appear, but
|> in (say) the normal case, when there is only a little text in the entry window,
|> no scrollbar? Or, if a listbox has few enough entries that they are all visible,
|> no scrollbar, but if some are invisible, scrollbar appears?
|> 
|> I suppose I could do it manually with bindings and packing/unpacking at the
|> right moment, but that seems a bit cumbersome. Any suggestions?
|> 
|> - Joel

There's no built-in mechanism for this, but this shouldn't be hard to
fake up at Tcl level.  I think that the best way to do it is to set the
"-yscrollcommand" option for the widget to call a procedure rather than
talking directly to the scrollbar.  The procedure can then check to see
if the entire object appears in the window (there's enough info passed
out by the widget to do this) and it can create or delete the scrollbar
accordingly (and also call the scrollbar's procedure to actually set the
values in the scrollbar).
From: norm@bnr.ca (Norm MacNeil)
Subject: What do the bindings do?
Reply-To: norm@bnr.ca
Organization: Bell-Northern Research Ltd.
Date: Fri, 18 Dec 1992 22:15:17 GMT

In the documentation for "bind", it mentions the different sequences such as
  ButtonPress, Expose, Gravity, etc.

My question is... some are obvious but some are not.  Is there somewhere that
I obviously haven't looked where these are described in better detail?

Thanks,
  Norm.

+-----------------------------------------------------------------------+
 Norm MacNeil                     Phone: (613) 763-3372
 Data Systems                     Fax:   (613) 765-2854
 Bell-Northern Research Ltd.      EMail: norm@bnr.ca (INTERNET)
 #include <disclaimer.std>       "Roller bladers do it in-line!"
From: estephen@whosnext.cad.gatech.edu (Eric R Stephens)
Newsgroups: comp.lang.tcl
Subject: Canvas and multiline entry = crash ?
Date: 18 Dec 1992 20:58:50 GMT
Organization: Georgia Institute of Technology, CAE/CAD Lab
NNTP-Posting-Host: whosnext.cad.gatech.edu
Keywords: canvas, entry, crash

I am trying to use scrolling multi-line entries within a canvas.  When I insert  
or type enough that not all can be displayed within the entry olvwm crashes!  I  
have experience a similar phenomenia using js-tools editor on occassion.  

Any ideas?  I'll try upgrading to Tk3.0 but recompiling may take a while.

Newsgroups: bnr.lang.tcl,comp.lang.tcl
From: norm@bnr.ca (Norm MacNeil)
Subject: toplevel message widgets problem
Reply-To: norm@bnr.ca
Organization: Bell-Northern Research Ltd.
Date: Tue, 15 Dec 1992 23:38:25 GMT

I wanted to be able to put up a "dialog" box with a message (like "Processing -
Please wait...") and then allow the program to continue on until such time as
the internal processing was complete at which time the message box would
disappear.  So I wrote a little procedure...

proc MsgCntl {Op Msg} {
  if {$Op == "END"} {
    catch {destroy .MsgCntl}
  } else {
  # Update any existing windows before continuing...
    update

  # Determine the size and placement of the window
    global .

    set WinHeight 175
    set WinWidth  350

  # Center the box in the existing "." window
    set WinX [expr {([winfo width  .]/2)-($WinWidth/2)+[winfo x .]}]
    set WinY [expr {([winfo height .]/2)-($WinHeight/2)+[winfo y .]}]

  # Create the toplevel window
    toplevel .MsgCntl -class MsgCntl
    wm geometry .MsgCntl ${WinWidth}x${WinHeight}+${WinX}+${WinY}
    wm title .MsgCntl "Message"
    wm iconname .MsgCntl "Msg"

  # Create a dummy frame
    frame .MsgCntl.top -borderwidth 3 -relief raised

  # Create the message widget
    message .MsgCntl.top.msg -justify center
    .MsgCntl.top.msg configure -text [join $Msg]
    pack append .MsgCntl.top .MsgCntl.top.msg {top expand fill}
    pack append .MsgCntl .MsgCntl.top {top expand fill}

  # Now show the message window
    update

  # Now bind all actions to this window
    focus .MsgCntl
    bind .MsgCntl <Visibility> {grab .MsgCntl; focus .MsgCntl}
    grab .MsgCntl
  }

}


So in the program, it would be used like...

MsgCntl BEGIN "Processing - please wait..."
#life happens here
MsgCntl END ""

Anyway, sometimes the text appears in the message window and sometimes it
doesn't.  The above code is littled hacked up from the number of iterations of
trying to get this to work.  One test, I got the message windows to display the
text, exited from the program, and restarted it, and this time the text did NOT
appear so I know it's not from code-fiddling.

What gives on the apparent inconsistency in displaying the text?

Thanks much in advance,
  Norm.
-- 
+-----------------------------------------------------------------------+
 Norm MacNeil                     Phone: (613) 763-7497
 Data Systems                     Fax:   (613) 765-2854
 Bell-Northern Research Ltd.      EMail: norm@bnr.ca (INTERNET)
 #include <disclaimer.std>       "Roller bladers do it in-line!"
Newsgroups: comp.lang.tcl
From: lwv26@cas.org (Larry W. Virden)
Subject: Version 3.0 and the FAQ (Was: Re: CAPS LOCK)
Followup-To: comp.lang.tcl
Reply-To: lvirden@cas.org (Larry W. Virden)
Organization: Nedriv Software and Shoe Shiners, Uninc.
Date: Wed, 16 Dec 1992 16:56:22 GMT

Note that due to vacation plans on my part, I will in all likelihood be
out of town when version 3.0 hits the disks.  This means, since I tend
to post the FAQ during the first week or two of the month, that unless you
folk contribute VIA EMAIL updates to the FAQ, that it will be at least
February before the FAQ starts reflecting info on the new version.

On the other hand, if folk would LIKE to contribute to the FAQ, or even
better, like to moderate one of the currently 3 parts of the FAQ, please
let me know!  Thanks all and if you celebrate any particular special
events during the next couple of months (Oriental New Years, Hannukah,
Christmas, other) be sure to have a happy one!
-- 
Larry W. Virden                 UUCP: osu-cis!chemabs!lvirden
Same Mbox: BITNET: lvirden@cas  INET: lvirden@cas.org
Personal: 674 Falls Place,   Reynoldsburg, OH 43068-1614
From: dragon@ossi.com (Norman Morse)
Newsgroups: comp.lang.tcl
Subject: Data transfer over modem using expect
Date: 15 Dec 1992 21:52:02 -0800
Organization: Open Systems Solutions Inc.
NNTP-Posting-Host: tao.ossi.com
Summary: Need way to transfer files over modem using Expect
Keywords: zmodem xmodem expect tip

I dial another system using tip, under the control of an expect script.  

How can I transfer a file in either direction?  Is there a way I can do this
using sz or rz?  How about some sample code?  

I need to retain the modem connection, do transfers in both directions, 
and keep my expect script in control.

Can anyone suggest a better way than rz or sz?

-Norman
From: libes@cme.nist.gov (Don Libes)
Newsgroups: comp.lang.tcl
Subject: Re: Data transfer over modem using expect
Date: 20 Dec 92 02:44:29 GMT
Organization: National Institute of Standards and Technology
In-reply-to: dragon@ossi.com's message of 16 Dec 92 05:52:02 GMT

In article <1gmg62INN4f7@tao.ossi.com> dragon@ossi.com (Norman Morse) writes:
   I dial another system using tip, under the control of an expect script.  

   How can I transfer a file in either direction?  Is there a way I can do this
   using sz or rz?  How about some sample code?  

   I need to retain the modem connection, do transfers in both directions, 
   and keep my expect script in control.

   Can anyone suggest a better way than rz or sz?

Two approaches come to mind.  If you have to use rz/sz, you can play
the same games that kibitz does.  Alternatively, you can do exactly
what tip does to transfer a file.

Don
Newsgroups: comp.lang.tcl
From: rossw@march.co.uk (Ross Wakelin)
Subject: Shrinking frames in TK
Organization: March Systems Consultancy Ltd
Date: Thu, 10 Dec 1992 10:01:46 GMT

Greetings

I have a small, but annoying problem with tk/tcl 2.3

I am creating a frame:

	frame .noddy -relief sunken -geometry 200x10

and a subframe within it:

	frame .noddy.subframe -relief raised -background blue -geometry 10x10

The intention is that I am creating a stripchart type environment, and that
I will vary the geometry of the subframe to change the size of the stripchart.

They are packed together using:
	pack apend .noddy .noddy.subframe {bottom}

Unfortunately, the superior frame (.noddy) keeps resizing itself to the size 
of the subframe (.noddy.subframe), completely destroying the layout of the
display.

I have tried using explicity x and y instead of geometry, and no change.
HELP!!!!

Thanks all

-- 
Ross Wakelin                                        r.wakelin@march.co.uk
Open Systems Director                  or ..mcsun!uknet!uknet!march!rossw 
March Systems Consultancy Ltd 

Newsgroups: comp.lang.tcl
From: karl@NeoSoft.com (Karl Lehenbauer)
Subject: Re: tk3.0 - menu strangeness in widget demo
Organization: NeoSoft Communications Services -- (713) 684-5900
Distribution: na
Date: Sat, 19 Dec 1992 02:35:49 GMT

In article <1992Dec18.214007.2257@walter.bellcore.com>
bytor@grumpy.NoSubdomain.NoDomain (Ross Huitt) writes:
             ^^^^^^^^^^^^^^^^^^^^ little config problem there
>Actually 'install -c' would be more appropriate. It works around the
>problems with read-only permissions that 'cp -f' was intended to address.

Unfortunately lots of Sys V'ish people do not have "install".
-- 
-- Email info@NeoSoft.com for info on getting interactive Internet access.
"In a minute, I'll burp up your droid."
From: ouster@sprite.Berkeley.EDU (John Ousterhout)
Newsgroups: comp.lang.tcl
Subject: Re: Shrinking frames in TK
Date: 18 Dec 1992 00:47:51 GMT
Organization: U.C. Berkeley Sprite Project
Distribution: world
NNTP-Posting-Host: tyranny.berkeley.edu

In article <1992Dec10.100146.20371@march.co.uk>, rossw@march.co.uk (Ross Wakelin) writes:
|> Greetings
|> 
|> I have a small, but annoying problem with tk/tcl 2.3
|> 
|> I am creating a frame:
|> 
|> 	frame .noddy -relief sunken -geometry 200x10
|> 
|> and a subframe within it:
|> 
|> 	frame .noddy.subframe -relief raised -background blue -geometry 10x10
|> 
|> The intention is that I am creating a stripchart type environment, and that
|> I will vary the geometry of the subframe to change the size of the stripchart.
|> 
|> They are packed together using:
|> 	pack apend .noddy .noddy.subframe {bottom}
|> 
|> Unfortunately, the superior frame (.noddy) keeps resizing itself to the size 
|> of the subframe (.noddy.subframe), completely destroying the layout of the
|> display.
|> 
|> I have tried using explicity x and y instead of geometry, and no change.
|> HELP!!!!
|> 
|> Thanks all
|> 
|> -- 
|> Ross Wakelin                                        r.wakelin@march.co.uk
|> Open Systems Director                  or ..mcsun!uknet!uknet!march!rossw 
|> March Systems Consultancy Ltd 
|> 

The packer overrides the requested size (200x10) of the parent frame.
To get around this problem, use the placer to manage one or both of
the parent frame and the child frame (I presume you're using the packer
for both parent and child right now).  For example, replace the pack
command above with

place .noddy.subframe -relx 0.5 -rely 1.0 -anchor s

The packer should probably have an option not to modify the requested
geometry of the parent.  I'll put this on my ToDo list.
Newsgroups: comp.lang.tcl
From: spencer@med.umich.edu (Spencer W. Thomas)
Subject: Re: tclMotif, any info?
Date: Fri, 11 Dec 92 17:35:36 EST
Organization: University of Michigan

In article <1992Dec10.155238.13437@cs.hw.ac.uk> censjg@caledonias3.caledonia.hw.ac.uk (Simon Greaves) writes:

> 	exec xterm -e someprog &

> works fine, but
> 	exec xterm &

> gives 
> 	ioctl: not owner

This is probably coming from the csh.  When you do xterm -e someprog, it
doesn't run csh.  Do you get this message in the window where you
started your wish, or in the new xterm window?

--
=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: jak@garnet.berkeley.edu (John A. Kunze)
Newsgroups: comp.lang.tcl
Subject: printing man pages in correct order?
Date: 17 Dec 1992 03:03:36 GMT
Organization: University of California, Berkeley
Distribution: world
NNTP-Posting-Host: garnet.berkeley.edu

Is there an easy way to troff all the Tcl/Tk man pages in an order
that it makes sense to bind them in?  Right now I do something like

	troff -man *.man | lpr -Pmyprinter

and stuff comes out in *mostly* the right order.  The choice of filenames
for some of the pages (sections really) causes weird ordering glitches:

  library(3) falls off the end,
  tk_listboxSingleSelect(1) sits with listbox(1) instead of with tk_menus(1),
  tk_menus(1) comes after toplevel(1) instead of before, and
  DoOneEvent(1) comes before CreateFileHandler(1) instead of after

I think there are others too.  A script would help, or changing filenames.

-John
Newsgroups: comp.lang.tcl,bnr.lang.tcl
From: karl@NeoSoft.com (Karl Lehenbauer)
Subject: Re: Compiling tk2.3 on SUN Sparc
Organization: NeoSoft Communications Services -- (713) 684-5900
Date: Sun, 20 Dec 1992 05:28:02 GMT

In article <1992Dec18.193538.18570@bcars6a8.bnr.ca> norm@bnr.ca writes:
>Well, the docs say it should compile Ok on the SUN Sparc; however, on the
>Sparc 2 w/ SUNOS4.1.1 I get the following:
>ld: Undefined symbol:
>      _strtoul
>      _strerror

I don't suppose you ran "csh config" in the tcl6.4 directory first?

This is documented in the README.

Under Tcl 6.5 make will complain if config has not been run.
-- 
-- Email info@NeoSoft.com for info on getting interactive Internet access.
"In a minute, I'll burp up your droid."
From: joel@saffron.CS.Berkeley.EDU (Joel A. Fine)
Newsgroups: comp.lang.tcl
Subject: Re: toplevel message widgets problem
Date: 16 Dec 1992 18:49:00 GMT
Organization: University of California, Berkeley
Distribution: world
NNTP-Posting-Host: saffron.cs.berkeley.edu

In article <1gnls5INNpi0@agate.berkeley.edu>, ouster@sprite.Berkeley.EDU (John Ousterhout) writes:
|> In article <1992Dec15.233825.18609@bcars6a8.bnr.ca>, norm@bnr.ca (Norm MacNeil) writes:
|> |> I wanted to be able to put up a "dialog" box with a message (like "Processing -
|> |> Please wait...") and then allow the program to continue on until such time as
|> |> the internal processing was complete at which time the message box would
|> |> disappear.
|> |> 
|> |> Anyway, sometimes the text appears in the message window and sometimes it
|> |> doesn't.
|> The bottom line is that you have to explicitly wait until you *know* that
|> the window has been displayed.  The way to do this is with the tkwait command.
|> Set up a binding for <Expose> on the window you want to see, with the
|> binding set to modify a particular variable.  Then use tkwait to wait for
|> the variable to change to the given value.  Once you know the window's up,
|> then you can go off and do your other work.  Be sure to do one more update
|> so that the window gets displayed, and also be sure to remove the binding
|> when you're done.  Sorry this is so complicated... there should probably
|> be a procedure in the Tk script library to do this automatically.

In the meantime, here's a procedure to do just that:

proc waitFor {w} {
  set $w.iHaveBeenExposed 0
  bind $w <Expose> "set $w.iHaveBeenExposed 1"
  tkwait variable $w.iHaveBeenExposed
  bind $w <Expose> ""
  update
}


And you call it with:

toplevel .mywin
addInterestingWidgetsTo .mywin
waitFor .mywin

Of course, if you happen to want an actual binding on the Expose event on
the new window, you have to add it back in after the waitFor command.

- Joel Fine
joel@cs.berkeley.edu