Tk Source Code

Artifact [7f77f85c]
Login

Artifact 7f77f85c3d5699930b1a99bd88d08c261f474cfa:

Attachment "testTclUlli.tcl" to ticket [3137232f] added by hirner 2010-12-15 12:31:49.
#!/bin/sh
#\
exec wish "$0" ${1+"$@"}

################################################################################
# Fehlerbeschreibung:
#   1. <Button-1> auf dem "Pfeil oben"-Knopf gedrückt halten bis Spinbox automatisch hochgezählt wird. 
#   2. Dann mit gedrückter Maustaste den Knopf verlassen. (Endlosschleife in ::tk::spinbox::Invoke)
#   3. dann die Maustaste ausserhalb los lassen und dann den Knopf "Zerstöre Toplevel" drücken.
#   4 . nach Abschluss der for-Schleife => Applikationsfehler da Spinbox in der Schleife ::Invoke 
#       nicht mehr existiert.
################################################################################

################################################################################
# Bug in spinbox.tcl
#1. Hold mouse button over the "buttonup arrow" till the spinner automatically increment the value. 
#2. Then move the mouse cursor while hold Button-1 pressed away from the "buttonup arrow" and now button release.
#3. Then TK enter a loop ::tk::spinbox::Invoke in /usr/lib/tcl/tk8.5/spinbox.tcl
#4. Now press the button "Destroy Toplevel" while -command "todo" proc is computing.
#5  After finishing the -command todo proc a Application Error occurs.
#
#6. Sorry for my english...
#invalid command name ".t.sp"
#invalid command name ".t.sp"
#    while executing
#"$w cget -repeatinterval"
#    (procedure "::tk::spinbox::Invoke" line 8)
#    invoked from within
#"::tk::spinbox::Invoke .t.sp buttonup"
#    ("after" script)
#


################################################################################
# use this example-code to test the error.

wm withdraw .
toplevel .t
set sp [spinbox .t.sp \
             -validate key \
             -command todo \
             -width 2 \
             -from 1 \
             -to 99 \
             -increment 1]
pack $sp
pack [button .t.b -text "Destroy Toplevel" -command beenden]

################################################################################ 
proc todo {} {
   for {set i 0 } {$i < 2500} {incr i} {
      puts "$i Datum: >>[exec date]<<"
   }
   return
}
################################################################################
proc beenden {} {
   destroy .t
   return
}