Menu

#86 Tk work with non-wish event loops

open-remind
None
5
2003-11-12
2001-08-29
Don Porter
No

With a Tcl_SetMainLoop call in Tk 8.4 and migrating
back to 8.3.4, it's time to start testing Tk as
a loadable package. After setting up an
appropriate pkgIndex.tcl file for Tk...
Here's one problem:

$ cat test.tcl
package require Tk
after 10000 {set forever 1}
after 1000 {destroy .}
after 2000 {bell}
vwait forever
$ tclsh test.tcl
bgerror failed to handle background error.
Original error: can't invoke "bell" command:
application has been destroyed
Error in bgerror: can't invoke "option" command:
application has been destroyed

Note that all Tk commands get disabled when the
"." window is destroyed on the theory that the
"application has been destroyed". Inside a wish
event loop, it's true that destroying all windows
exits the application, but a loadable Tk will find
itself running inside other event loops. It needs
to handle that situation better.

Discussion

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2001-08-29

    Logged In: YES
    user_id=72656

    There may be some fixes involved, but for the above case
    that appears to me more like a documentation point of how
    Tk behaves as a package.

     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2003-07-18
    • status: open --> closed-wont-fix
     
  • Don Porter

    Don Porter - 2003-07-18

    Logged In: YES
    user_id=80530

    rather than argue the merits
    of this as a bug, I'll make it
    a feature request.

    I do think our goal for Tk
    should be to make it a
    nicely loadable package
    suitable for non-wish environments.

     
  • Don Porter

    Don Porter - 2003-07-18
    • status: closed-wont-fix --> open-remind
     
  • Don Porter

    Don Porter - 2003-07-18
    • summary: Tk assumes wish event loop --> Tk work with non-wish event loops
     
  • Don Porter

    Don Porter - 2003-11-12
    • assigned_to: nobody --> dgp