At 16:40 29-05-97 -0500, you wrote:
>
>Has anyonehad this situation?
>
>I built a trivial application where I take the default panel and place a
>button on it.  then I double click the button and put the code in it.
>
>I put: exit
>in the code windows and clicked OK.
>
>THen I get the message 
>Error: bad window path name ".vTcl.com__top17_but18"
>
>I got this on my Linux box and a guy got this on his Sun machine too.
>
>Any suggestions?
>
>Mark
>[EMAIL PROTECTED]
> 
>

YES I HAVE SEEN THIS MANY TIMES AND EVEN HAVE SOME "INFO" THAT MIGHT HELP.
Sorry, I don't have a fix.

If readers have more insite or other constructive comments, PLEASE send them
along.

The Symptom
===========
    You press a TCL/TK button (or other widget ["control" to the VB crowd])
and get "bad window path name..."

Analysis
========
    The widget (dash) command [list ...] destroys the window that holds the
widget.  A mouse-button-one "click event" destroys the window and all works
as planned.  However, a mouse-button-one "double click event" has problems
because the default binding runs the command [list...] on the first click
and there is no window for the second click in spite.  Therefore you get an
error.
    If you create two copies of the same toplevel and stack them precisely,
the second click of the double click event fires the command [list...] of
the second window's button.

Recommendataion
===============
1.  Avoid "computational" scripts in favor or event driven.  
2.  Learn to use UPDATE and UPDATE IDLETASKS effectively.
[NOTICE -- Some FAQ notes on this from those who **know** would be very nice.]

Comments
========
    This is aggrivated on slower systems that take obvious time to create
and destroy toplevel windows or in TCL/TK scripts that spend large amounts of
time interpreting script statments [aka, computational] without using UPDATE or
UPDATE IDLETASKS.
    We use an approach with three layers:  (1) proc that draws the form and
sets bindings  (2) callback proc for each widget on the form  (3) work procs
used by the callbacks to do whatever the real-work of the widget is supposed
to be.  The callback procs always UPDATE IDLETASKS.  The work procs always
UPDATE.

=== Dan 0:-D
============================================================================
========
  "In a dragon fight, often times, the bleachers get scorched."
  ... let The GRILLON Group help you slay your dragons.  Call Today.
============================================================================
========
    Daniel M. St.Andre'                         The GRILLON Group
    voice:  512.331.8271                        Information Management
Consultants
    fax:    512.331.8915                        10511 Weller Drive
    ofc email:   [EMAIL PROTECTED]          Austin, TX 78750  USA
============================================================================
========

Reply via email to