Index: doc/tkvars.n =================================================================== RCS file: /cvsroot/tk/doc/tkvars.n,v retrieving revision 1.2 diff -c -r1.2 tkvars.n *** tkvars.n 1998/09/14 18:23:00 1.2 --- tkvars.n 2000/07/17 06:26:03 *************** *** 44,52 **** The patch level is incremented for each new release or patch, and it uniquely identifies an official version of Tk. .TP ! \fBtkPriv\fR This variable is an array containing several pieces of information ! that are private to Tk. The elements of \fBtkPriv\fR are used by Tk library procedures and default bindings. They should not be accessed by any code outside Tk. .TP --- 44,52 ---- The patch level is incremented for each new release or patch, and it uniquely identifies an official version of Tk. .TP ! \fBtk::Priv\fR This variable is an array containing several pieces of information ! that are private to Tk. The elements of \fBtk::Priv\fR are used by Tk library procedures and default bindings. They should not be accessed by any code outside Tk. .TP Index: generic/tkBind.c =================================================================== RCS file: /cvsroot/tk/generic/tkBind.c,v retrieving revision 1.13 diff -c -r1.13 tkBind.c *** tkBind.c 2000/04/19 01:06:50 1.13 --- tkBind.c 2000/07/17 06:26:27 *************** *** 293,299 **** * One of the following structures exists for each interpreter. This * structure keeps track of the current display and screen in the * interpreter, so that a script can be invoked whenever the display/screen ! * changes (the script does things like point tkPriv at a display-specific * structure). */ --- 293,299 ---- * One of the following structures exists for each interpreter. This * structure keeps track of the current display and screen in the * interpreter, so that a script can be invoked whenever the display/screen ! * changes (the script does things like point tk::Priv at a display-specific * structure). */ *************** *** 2542,2557 **** * * This procedure is invoked whenever the current screen changes * in an application. It invokes a Tcl procedure named ! * "tkScreenChanged", passing it the screen name as argument. ! * tkScreenChanged does things like making the tkPriv variable * point to an array for the current display. * * Results: * None. * * Side effects: ! * Depends on what tkScreenChanged does. If an error occurs ! * them tkError will be invoked. * *---------------------------------------------------------------------- */ --- 2542,2557 ---- * * This procedure is invoked whenever the current screen changes * in an application. It invokes a Tcl procedure named ! * "tk::ScreenChanged", passing it the screen name as argument. ! * tk::ScreenChanged does things like making the tk::Priv variable * point to an array for the current display. * * Results: * None. * * Side effects: ! * Depends on what tk::ScreenChanged does. If an error occurs ! * them bgerror will be invoked. * *---------------------------------------------------------------------- */ *************** *** 2568,2574 **** char screen[TCL_INTEGER_SPACE]; Tcl_DStringInit(&cmd); ! Tcl_DStringAppend(&cmd, "tkScreenChanged ", 16); Tcl_DStringAppend(&cmd, dispName, -1); sprintf(screen, ".%d", screenIndex); Tcl_DStringAppend(&cmd, screen, -1); --- 2568,2574 ---- char screen[TCL_INTEGER_SPACE]; Tcl_DStringInit(&cmd); ! Tcl_DStringAppend(&cmd, "tk::ScreenChanged ", 18); Tcl_DStringAppend(&cmd, dispName, -1); sprintf(screen, ".%d", screenIndex); Tcl_DStringAppend(&cmd, screen, -1); Index: generic/tkMenu.c =================================================================== RCS file: /cvsroot/tk/generic/tkMenu.c,v retrieving revision 1.7 diff -c -r1.7 tkMenu.c *** tkMenu.c 2000/06/27 17:15:58 1.7 --- tkMenu.c 2000/07/17 06:26:47 *************** *** 1070,1076 **** if (mePtr->type == TEAROFF_ENTRY) { Tcl_DString ds; Tcl_DStringInit(&ds); ! Tcl_DStringAppend(&ds, "tkTearOffMenu ", -1); Tcl_DStringAppend(&ds, Tk_PathName(menuPtr->tkwin), -1); result = Tcl_Eval(interp, Tcl_DStringValue(&ds)); Tcl_DStringFree(&ds); --- 1070,1076 ---- if (mePtr->type == TEAROFF_ENTRY) { Tcl_DString ds; Tcl_DStringInit(&ds); ! Tcl_DStringAppend(&ds, "tk::TearOffMenu ", -1); Tcl_DStringAppend(&ds, Tk_PathName(menuPtr->tkwin), -1); result = Tcl_Eval(interp, Tcl_DStringValue(&ds)); Tcl_DStringFree(&ds); *************** *** 2638,2644 **** } } ! menuDupCommandArray[0] = Tcl_NewStringObj("tkMenuDup", -1); menuDupCommandArray[1] = Tcl_NewStringObj(Tk_PathName(menuPtr->tkwin), -1); menuDupCommandArray[2] = newMenuNamePtr; if (newMenuTypePtr == NULL) { --- 2638,2644 ---- } } ! menuDupCommandArray[0] = Tcl_NewStringObj("tk::MenuDup", -1); menuDupCommandArray[1] = Tcl_NewStringObj(Tk_PathName(menuPtr->tkwin), -1); menuDupCommandArray[2] = newMenuNamePtr; if (newMenuTypePtr == NULL) { Index: generic/tkTextDisp.c =================================================================== RCS file: /cvsroot/tk/generic/tkTextDisp.c,v retrieving revision 1.9 diff -c -r1.9 tkTextDisp.c *** tkTextDisp.c 2000/01/06 02:18:59 1.9 --- tkTextDisp.c 2000/07/17 06:27:16 *************** *** 1304,1310 **** */ TkTextPrintIndex(&index, string); ! Tcl_SetVar2(textPtr->interp, "tk_textRelayout", (char *) NULL, string, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); } --- 1304,1310 ---- */ TkTextPrintIndex(&index, string); ! Tcl_SetVar2(textPtr->interp, "tk::textRelayout", (char *) NULL, string, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); } *************** *** 1465,1471 **** char string[TK_POS_CHARS]; TkTextPrintIndex(&dlPtr->index, string); ! Tcl_SetVar2(textPtr->interp, "tk_textRelayout", (char *) NULL, string, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); } --- 1465,1471 ---- char string[TK_POS_CHARS]; TkTextPrintIndex(&dlPtr->index, string); ! Tcl_SetVar2(textPtr->interp, "tk::textRelayout", (char *) NULL, string, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); } *************** *** 2171,2177 **** Tcl_Preserve((ClientData) interp); if (tkTextDebug) { ! Tcl_SetVar2(interp, "tk_textRelayout", (char *) NULL, "", TCL_GLOBAL_ONLY); } --- 2171,2177 ---- Tcl_Preserve((ClientData) interp); if (tkTextDebug) { ! Tcl_SetVar2(interp, "tk::textRelayout", (char *) NULL, "", TCL_GLOBAL_ONLY); } *************** *** 2192,2198 **** } numRedisplays++; if (tkTextDebug) { ! Tcl_SetVar2(interp, "tk_textRedraw", (char *) NULL, "", TCL_GLOBAL_ONLY); } --- 2192,2198 ---- } numRedisplays++; if (tkTextDebug) { ! Tcl_SetVar2(interp, "tk::textRedraw", (char *) NULL, "", TCL_GLOBAL_ONLY); } *************** *** 2338,2344 **** if (dInfoPtr->flags & REDRAW_BORDERS) { if (tkTextDebug) { ! Tcl_SetVar2(interp, "tk_textRedraw", (char *) NULL, "borders", TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); } --- 2338,2344 ---- if (dInfoPtr->flags & REDRAW_BORDERS) { if (tkTextDebug) { ! Tcl_SetVar2(interp, "tk::textRedraw", (char *) NULL, "borders", TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); } *************** *** 2430,2436 **** if (tkTextDebug) { char string[TK_POS_CHARS]; TkTextPrintIndex(&dlPtr->index, string); ! Tcl_SetVar2(textPtr->interp, "tk_textRedraw", (char *) NULL, string, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); } --- 2430,2436 ---- if (tkTextDebug) { char string[TK_POS_CHARS]; TkTextPrintIndex(&dlPtr->index, string); ! Tcl_SetVar2(textPtr->interp, "tk::textRedraw", (char *) NULL, string, TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); } *************** *** 2459,2465 **** } if (bottomY < dInfoPtr->topOfEof) { if (tkTextDebug) { ! Tcl_SetVar2(textPtr->interp, "tk_textRedraw", (char *) NULL, "eof", TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); } --- 2459,2465 ---- } if (bottomY < dInfoPtr->topOfEof) { if (tkTextDebug) { ! Tcl_SetVar2(textPtr->interp, "tk::textRedraw", (char *) NULL, "eof", TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT); } Index: library/bgerror.tcl =================================================================== RCS file: /cvsroot/tk/library/bgerror.tcl,v retrieving revision 1.12 diff -c -r1.12 bgerror.tcl *** bgerror.tcl 2000/06/30 06:38:38 1.12 --- bgerror.tcl 2000/07/17 06:27:18 *************** *** 73,79 **** } } ! # bgerror -- # This is the default version of bgerror. # It tries to execute tkerror, if that fails it posts a dialog box containing # the error message and gives the user a chance to ask to see a stack --- 73,79 ---- } } ! # ::bgerror -- # This is the default version of bgerror. # It tries to execute tkerror, if that fails it posts a dialog box containing # the error message and gives the user a chance to ask to see a stack *************** *** 81,87 **** # Arguments: # err - The error message. ! proc bgerror err { global errorInfo tcl_platform set butvar ::tk::dialog::error::button --- 81,87 ---- # Arguments: # err - The error message. ! proc ::bgerror err { global errorInfo tcl_platform set butvar ::tk::dialog::error::button *************** *** 261,267 **** # may take the focus away so we can't redirect it. Finally, # restore any grab that was in effect. ! tkwait variable $butvar set button $::tk::dialog::error::button; # Save a copy... catch {focus $oldFocus} catch {destroy .bgerrorDialog} --- 261,267 ---- # may take the focus away so we can't redirect it. Finally, # restore any grab that was in effect. ! vwait $butvar set button $::tk::dialog::error::button; # Save a copy... catch {focus $oldFocus} catch {destroy .bgerrorDialog} Index: library/button.tcl =================================================================== RCS file: /cvsroot/tk/library/button.tcl,v retrieving revision 1.10 diff -c -r1.10 button.tcl *** button.tcl 2000/05/25 17:19:57 1.10 --- button.tcl 2000/07/17 06:27:21 *************** *** 19,129 **** if {[string match "macintosh" $tcl_platform(platform)]} { bind Radiobutton { ! tkButtonEnter %W } bind Radiobutton <1> { ! tkButtonDown %W } bind Radiobutton { ! tkButtonUp %W } bind Checkbutton { ! tkButtonEnter %W } bind Checkbutton <1> { ! tkButtonDown %W } bind Checkbutton { ! tkButtonUp %W } } if {[string match "windows" $tcl_platform(platform)]} { bind Checkbutton { ! tkCheckRadioInvoke %W select } bind Checkbutton { ! tkCheckRadioInvoke %W select } bind Checkbutton { ! tkCheckRadioInvoke %W deselect } bind Checkbutton <1> { ! tkCheckRadioDown %W } bind Checkbutton { ! tkButtonUp %W } bind Checkbutton { ! tkCheckRadioEnter %W } bind Radiobutton <1> { ! tkCheckRadioDown %W } bind Radiobutton { ! tkButtonUp %W } bind Radiobutton { ! tkCheckRadioEnter %W } } if {[string match "unix" $tcl_platform(platform)]} { bind Checkbutton { if {!$tk_strictMotif} { ! tkCheckRadioInvoke %W } } bind Radiobutton { if {!$tk_strictMotif} { ! tkCheckRadioInvoke %W } } bind Checkbutton <1> { ! tkCheckRadioInvoke %W } bind Radiobutton <1> { ! tkCheckRadioInvoke %W } bind Checkbutton { ! tkButtonEnter %W } bind Radiobutton { ! tkButtonEnter %W } } bind Button { ! tkButtonInvoke %W } bind Checkbutton { ! tkCheckRadioInvoke %W } bind Radiobutton { ! tkCheckRadioInvoke %W } bind Button {} bind Button { ! tkButtonEnter %W } bind Button { ! tkButtonLeave %W } bind Button <1> { ! tkButtonDown %W } bind Button { ! tkButtonUp %W } bind Checkbutton {} bind Checkbutton { ! tkButtonLeave %W } bind Radiobutton {} bind Radiobutton { ! tkButtonLeave %W } if {[string match "windows" $tcl_platform(platform)]} { --- 19,129 ---- if {[string match "macintosh" $tcl_platform(platform)]} { bind Radiobutton { ! tk::ButtonEnter %W } bind Radiobutton <1> { ! tk::ButtonDown %W } bind Radiobutton { ! tk::ButtonUp %W } bind Checkbutton { ! tk::ButtonEnter %W } bind Checkbutton <1> { ! tk::ButtonDown %W } bind Checkbutton { ! tk::ButtonUp %W } } if {[string match "windows" $tcl_platform(platform)]} { bind Checkbutton { ! tk::CheckRadioInvoke %W select } bind Checkbutton { ! tk::CheckRadioInvoke %W select } bind Checkbutton { ! tk::CheckRadioInvoke %W deselect } bind Checkbutton <1> { ! tk::CheckRadioDown %W } bind Checkbutton { ! tk::ButtonUp %W } bind Checkbutton { ! tk::CheckRadioEnter %W } bind Radiobutton <1> { ! tk::CheckRadioDown %W } bind Radiobutton { ! tk::ButtonUp %W } bind Radiobutton { ! tk::CheckRadioEnter %W } } if {[string match "unix" $tcl_platform(platform)]} { bind Checkbutton { if {!$tk_strictMotif} { ! tk::CheckRadioInvoke %W } } bind Radiobutton { if {!$tk_strictMotif} { ! tk::CheckRadioInvoke %W } } bind Checkbutton <1> { ! tk::CheckRadioInvoke %W } bind Radiobutton <1> { ! tk::CheckRadioInvoke %W } bind Checkbutton { ! tk::ButtonEnter %W } bind Radiobutton { ! tk::ButtonEnter %W } } bind Button { ! tk::ButtonInvoke %W } bind Checkbutton { ! tk::CheckRadioInvoke %W } bind Radiobutton { ! tk::CheckRadioInvoke %W } bind Button {} bind Button { ! tk::ButtonEnter %W } bind Button { ! tk::ButtonLeave %W } bind Button <1> { ! tk::ButtonDown %W } bind Button { ! tk::ButtonUp %W } bind Checkbutton {} bind Checkbutton { ! tk::ButtonLeave %W } bind Radiobutton {} bind Radiobutton { ! tk::ButtonLeave %W } if {[string match "windows" $tcl_platform(platform)]} { *************** *** 132,138 **** # Windows implementation ######################### ! # tkButtonEnter -- # The procedure below is invoked when the mouse pointer enters a # button widget. It records the button we're in and changes the # state of the button to active unless the button is disabled. --- 132,138 ---- # Windows implementation ######################### ! # ::tk::ButtonEnter -- # The procedure below is invoked when the mouse pointer enters a # button widget. It records the button we're in and changes the # state of the button to active unless the button is disabled. *************** *** 140,174 **** # Arguments: # w - The name of the widget. ! proc tkButtonEnter w { ! global tkPriv if {[string compare [$w cget -state] "disabled"] } { # If the mouse button is down, set the relief to sunken on entry. # Overwise, if there's an -overrelief value, set the relief to that. ! if {[string equal $tkPriv(buttonWindow) $w]} { $w configure -state active -relief sunken } elseif { [string compare [$w cget -overrelief] ""] } { ! set tkPriv(relief) [$w cget -relief] $w configure -relief [$w cget -overrelief] } } ! set tkPriv(window) $w } ! # tkButtonLeave -- # The procedure below is invoked when the mouse pointer leaves a # button widget. It changes the state of the button back to # inactive. If we're leaving the button window with a mouse button ! # pressed (tkPriv(buttonWindow) == $w), restore the relief of the # button too. # # Arguments: # w - The name of the widget. ! proc tkButtonLeave w { ! global tkPriv if {[string compare [$w cget -state] "disabled"]} { $w configure -state normal } --- 140,174 ---- # Arguments: # w - The name of the widget. ! proc ::tk::ButtonEnter w { ! variable ::tk::Priv if {[string compare [$w cget -state] "disabled"] } { # If the mouse button is down, set the relief to sunken on entry. # Overwise, if there's an -overrelief value, set the relief to that. ! if {[string equal $Priv(buttonWindow) $w]} { $w configure -state active -relief sunken } elseif { [string compare [$w cget -overrelief] ""] } { ! set Priv(relief) [$w cget -relief] $w configure -relief [$w cget -overrelief] } } ! set Priv(window) $w } ! # ::tk::ButtonLeave -- # The procedure below is invoked when the mouse pointer leaves a # button widget. It changes the state of the button back to # inactive. If we're leaving the button window with a mouse button ! # pressed (Priv(buttonWindow) == $w), restore the relief of the # button too. # # Arguments: # w - The name of the widget. ! proc ::tk::ButtonLeave w { ! variable ::tk::Priv if {[string compare [$w cget -state] "disabled"]} { $w configure -state normal } *************** *** 176,190 **** # Restore the original button relief if the mouse button is down # or there is an -overrelief value. ! if {[string equal $tkPriv(buttonWindow) $w] || \ [string compare [$w cget -overrelief] ""] } { ! $w configure -relief $tkPriv(relief) } ! set tkPriv(window) "" } ! # tkCheckRadioEnter -- # The procedure below is invoked when the mouse pointer enters a # checkbutton or radiobutton widget. It records the button we're in # and changes the state of the button to active unless the button is --- 176,190 ---- # Restore the original button relief if the mouse button is down # or there is an -overrelief value. ! if {[string equal $Priv(buttonWindow) $w] || \ [string compare [$w cget -overrelief] ""] } { ! $w configure -relief $Priv(relief) } ! set Priv(window) "" } ! # ::tk::CheckRadioEnter -- # The procedure below is invoked when the mouse pointer enters a # checkbutton or radiobutton widget. It records the button we're in # and changes the state of the button to active unless the button is *************** *** 193,213 **** # Arguments: # w - The name of the widget. ! proc tkCheckRadioEnter w { ! global tkPriv if {[string compare [$w cget -state] "disabled"]} { ! if {[string equal $tkPriv(buttonWindow) $w]} { $w configure -state active } if { [string compare [$w cget -overrelief] ""] } { ! set tkPriv(relief) [$w cget -relief] $w configure -relief [$w cget -overrelief] } } ! set tkPriv(window) $w } ! # tkButtonDown -- # The procedure below is invoked when the mouse button is pressed in # a button widget. It records the fact that the mouse is in the button, # saves the button's relief so it can be restored later, and changes --- 193,213 ---- # Arguments: # w - The name of the widget. ! proc ::tk::CheckRadioEnter w { ! variable ::tk::Priv if {[string compare [$w cget -state] "disabled"]} { ! if {[string equal $Priv(buttonWindow) $w]} { $w configure -state active } if { [string compare [$w cget -overrelief] ""] } { ! set Priv(relief) [$w cget -relief] $w configure -relief [$w cget -overrelief] } } ! set Priv(window) $w } ! # ::tk::ButtonDown -- # The procedure below is invoked when the mouse button is pressed in # a button widget. It records the fact that the mouse is in the button, # saves the button's relief so it can be restored later, and changes *************** *** 216,246 **** # Arguments: # w - The name of the widget. ! proc tkButtonDown w { ! global tkPriv # Only save the button's relief if it has no -overrelief value. If there ! # is an overrelief setting, tkPriv(relief) will already have been set, and # the current value of the -relief option will be incorrect. if { [string equal [$w cget -overrelief] ""] } { ! set tkPriv(relief) [$w cget -relief] } if {[string compare [$w cget -state] "disabled"]} { ! set tkPriv(buttonWindow) $w $w configure -relief sunken -state active # If this button has a repeatdelay set up, get it going with an after ! after cancel $tkPriv(afterId) set delay [$w cget -repeatdelay] ! set tkPriv(repeated) 0 if {$delay > 0} { ! set tkPriv(afterId) [after $delay [list tkButtonAutoInvoke $w]] } } } ! # tkCheckRadioDown -- # The procedure below is invoked when the mouse button is pressed in # a button widget. It records the fact that the mouse is in the button, # saves the button's relief so it can be restored later, and changes --- 216,246 ---- # Arguments: # w - The name of the widget. ! proc ::tk::ButtonDown w { ! variable ::tk::Priv # Only save the button's relief if it has no -overrelief value. If there ! # is an overrelief setting, Priv(relief) will already have been set, and # the current value of the -relief option will be incorrect. if { [string equal [$w cget -overrelief] ""] } { ! set Priv(relief) [$w cget -relief] } if {[string compare [$w cget -state] "disabled"]} { ! set Priv(buttonWindow) $w $w configure -relief sunken -state active # If this button has a repeatdelay set up, get it going with an after ! after cancel $Priv(afterId) set delay [$w cget -repeatdelay] ! set Priv(repeated) 0 if {$delay > 0} { ! set Priv(afterId) [after $delay [list tk::ButtonAutoInvoke $w]] } } } ! # ::tk::CheckRadioDown -- # The procedure below is invoked when the mouse button is pressed in # a button widget. It records the fact that the mouse is in the button, # saves the button's relief so it can be restored later, and changes *************** *** 249,267 **** # Arguments: # w - The name of the widget. ! proc tkCheckRadioDown w { ! global tkPriv if { [string equal [$w cget -overrelief] ""] } { ! set tkPriv(relief) [$w cget -relief] } if {[string compare [$w cget -state] "disabled"]} { ! set tkPriv(buttonWindow) $w ! set tkPriv(repeated) 0 $w configure -state active } } ! # tkButtonUp -- # The procedure below is invoked when the mouse button is released # in a button widget. It restores the button's relief and invokes # the command as long as the mouse hasn't left the button. --- 249,267 ---- # Arguments: # w - The name of the widget. ! proc ::tk::CheckRadioDown w { ! variable ::tk::Priv if { [string equal [$w cget -overrelief] ""] } { ! set Priv(relief) [$w cget -relief] } if {[string compare [$w cget -state] "disabled"]} { ! set Priv(buttonWindow) $w ! set Priv(repeated) 0 $w configure -state active } } ! # ::tk::ButtonUp -- # The procedure below is invoked when the mouse button is released # in a button widget. It restores the button's relief and invokes # the command as long as the mouse hasn't left the button. *************** *** 269,278 **** # Arguments: # w - The name of the widget. ! proc tkButtonUp w { ! global tkPriv ! if {[string equal $tkPriv(buttonWindow) $w]} { ! set tkPriv(buttonWindow) "" # Restore the button's relief. If there is no overrelief, the # button relief goes back to its original value. If there is an # overrelief, the relief goes to the overrelief (since the cursor is --- 269,278 ---- # Arguments: # w - The name of the widget. ! proc ::tk::ButtonUp w { ! variable ::tk::Priv ! if {[string equal $Priv(buttonWindow) $w]} { ! set Priv(buttonWindow) "" # Restore the button's relief. If there is no overrelief, the # button relief goes back to its original value. If there is an # overrelief, the relief goes to the overrelief (since the cursor is *************** *** 280,300 **** set relief [$w cget -overrelief] if { [string equal $relief ""] } { ! set relief $tkPriv(relief) } $w configure -relief $relief # Clean up the after event from the auto-repeater ! after cancel $tkPriv(afterId) ! if {[string equal $tkPriv(window) $w] && [string compare [$w cget -state] "disabled"]} { $w configure -state normal # Only invoke the command if it wasn't already invoked by the # auto-repeater functionality ! if { $tkPriv(repeated) == 0 } { uplevel #0 [list $w invoke] } } --- 280,300 ---- set relief [$w cget -overrelief] if { [string equal $relief ""] } { ! set relief $Priv(relief) } $w configure -relief $relief # Clean up the after event from the auto-repeater ! after cancel $Priv(afterId) ! if {[string equal $Priv(window) $w] && [string compare [$w cget -state] "disabled"]} { $w configure -state normal # Only invoke the command if it wasn't already invoked by the # auto-repeater functionality ! if { $Priv(repeated) == 0 } { uplevel #0 [list $w invoke] } } *************** *** 309,315 **** # Unix implementation ##################### ! # tkButtonEnter -- # The procedure below is invoked when the mouse pointer enters a # button widget. It records the button we're in and changes the # state of the button to active unless the button is disabled. --- 309,315 ---- # Unix implementation ##################### ! # ::tk::ButtonEnter -- # The procedure below is invoked when the mouse pointer enters a # button widget. It records the button we're in and changes the # state of the button to active unless the button is disabled. *************** *** 317,353 **** # Arguments: # w - The name of the widget. ! proc tkButtonEnter {w} { ! global tkPriv if {[string compare [$w cget -state] "disabled"]} { $w configure -state active # If the mouse button is down, set the relief to sunken on entry. # Overwise, if there's an -overrelief value, set the relief to that. ! if {[string equal $tkPriv(buttonWindow) $w]} { $w configure -state active -relief sunken } elseif { [string compare [$w cget -overrelief] ""] } { ! set tkPriv(relief) [$w cget -relief] $w configure -relief [$w cget -overrelief] } } ! set tkPriv(window) $w } ! # tkButtonLeave -- # The procedure below is invoked when the mouse pointer leaves a # button widget. It changes the state of the button back to # inactive. If we're leaving the button window with a mouse button ! # pressed (tkPriv(buttonWindow) == $w), restore the relief of the # button too. # # Arguments: # w - The name of the widget. ! proc tkButtonLeave w { ! global tkPriv if {[string compare [$w cget -state] "disabled"]} { $w configure -state normal } --- 317,353 ---- # Arguments: # w - The name of the widget. ! proc ::tk::ButtonEnter {w} { ! variable ::tk::Priv if {[string compare [$w cget -state] "disabled"]} { $w configure -state active # If the mouse button is down, set the relief to sunken on entry. # Overwise, if there's an -overrelief value, set the relief to that. ! if {[string equal $Priv(buttonWindow) $w]} { $w configure -state active -relief sunken } elseif { [string compare [$w cget -overrelief] ""] } { ! set Priv(relief) [$w cget -relief] $w configure -relief [$w cget -overrelief] } } ! set Priv(window) $w } ! # ::tk::ButtonLeave -- # The procedure below is invoked when the mouse pointer leaves a # button widget. It changes the state of the button back to # inactive. If we're leaving the button window with a mouse button ! # pressed (Priv(buttonWindow) == $w), restore the relief of the # button too. # # Arguments: # w - The name of the widget. ! proc ::tk::ButtonLeave w { ! variable ::tk::Priv if {[string compare [$w cget -state] "disabled"]} { $w configure -state normal } *************** *** 355,369 **** # Restore the original button relief if the mouse button is down # or there is an -overrelief value. ! if {[string equal $tkPriv(buttonWindow) $w] || \ [string compare [$w cget -overrelief] ""] } { ! $w configure -relief $tkPriv(relief) } ! set tkPriv(window) "" } ! # tkButtonDown -- # The procedure below is invoked when the mouse button is pressed in # a button widget. It records the fact that the mouse is in the button, # saves the button's relief so it can be restored later, and changes --- 355,369 ---- # Restore the original button relief if the mouse button is down # or there is an -overrelief value. ! if {[string equal $Priv(buttonWindow) $w] || \ [string compare [$w cget -overrelief] ""] } { ! $w configure -relief $Priv(relief) } ! set Priv(window) "" } ! # ::tk::ButtonDown -- # The procedure below is invoked when the mouse button is pressed in # a button widget. It records the fact that the mouse is in the button, # saves the button's relief so it can be restored later, and changes *************** *** 372,403 **** # Arguments: # w - The name of the widget. ! proc tkButtonDown w { ! global tkPriv # Only save the button's relief if it has no -overrelief value. If there ! # is an overrelief setting, tkPriv(relief) will already have been set, and # the current value of the -relief option will be incorrect. if { [string equal [$w cget -overrelief] ""] } { ! set tkPriv(relief) [$w cget -relief] } if {[string compare [$w cget -state] "disabled"]} { ! set tkPriv(buttonWindow) $w $w configure -relief sunken # If this button has a repeatdelay set up, get it going with an after ! after cancel $tkPriv(afterId) set delay [$w cget -repeatdelay] ! set tkPriv(repeated) 0 if {$delay > 0} { ! set tkPriv(afterId) [after $delay [list tkButtonAutoInvoke $w]] } } } ! # tkButtonUp -- # The procedure below is invoked when the mouse button is released # in a button widget. It restores the button's relief and invokes # the command as long as the mouse hasn't left the button. --- 372,403 ---- # Arguments: # w - The name of the widget. ! proc ::tk::ButtonDown w { ! variable ::tk::Priv # Only save the button's relief if it has no -overrelief value. If there ! # is an overrelief setting, Priv(relief) will already have been set, and # the current value of the -relief option will be incorrect. if { [string equal [$w cget -overrelief] ""] } { ! set Priv(relief) [$w cget -relief] } if {[string compare [$w cget -state] "disabled"]} { ! set Priv(buttonWindow) $w $w configure -relief sunken # If this button has a repeatdelay set up, get it going with an after ! after cancel $Priv(afterId) set delay [$w cget -repeatdelay] ! set Priv(repeated) 0 if {$delay > 0} { ! set Priv(afterId) [after $delay [list tk::ButtonAutoInvoke $w]] } } } ! # ::tk::ButtonUp -- # The procedure below is invoked when the mouse button is released # in a button widget. It restores the button's relief and invokes # the command as long as the mouse hasn't left the button. *************** *** 405,414 **** # Arguments: # w - The name of the widget. ! proc tkButtonUp w { ! global tkPriv ! if {[string equal $w $tkPriv(buttonWindow)]} { ! set tkPriv(buttonWindow) "" # Restore the button's relief. If there is no overrelief, the # button relief goes back to its original value. If there is an --- 405,414 ---- # Arguments: # w - The name of the widget. ! proc ::tk::ButtonUp w { ! variable ::tk::Priv ! if {[string equal $w $Priv(buttonWindow)]} { ! set Priv(buttonWindow) "" # Restore the button's relief. If there is no overrelief, the # button relief goes back to its original value. If there is an *************** *** 417,435 **** set relief [$w cget -overrelief] if { [string equal $relief ""] } { ! set relief $tkPriv(relief) } $w configure -relief $relief # Clean up the after event from the auto-repeater ! after cancel $tkPriv(afterId) ! if {[string equal $w $tkPriv(window)] \ && [string compare [$w cget -state] "disabled"]} { # Only invoke the command if it wasn't already invoked by the # auto-repeater functionality ! if { $tkPriv(repeated) == 0 } { uplevel #0 [list $w invoke] } } --- 417,435 ---- set relief [$w cget -overrelief] if { [string equal $relief ""] } { ! set relief $Priv(relief) } $w configure -relief $relief # Clean up the after event from the auto-repeater ! after cancel $Priv(afterId) ! if {[string equal $w $Priv(window)] \ && [string compare [$w cget -state] "disabled"]} { # Only invoke the command if it wasn't already invoked by the # auto-repeater functionality ! if { $Priv(repeated) == 0 } { uplevel #0 [list $w invoke] } } *************** *** 444,450 **** # Mac implementation #################### ! # tkButtonEnter -- # The procedure below is invoked when the mouse pointer enters a # button widget. It records the button we're in and changes the # state of the button to active unless the button is disabled. --- 444,450 ---- # Mac implementation #################### ! # ::tk::ButtonEnter -- # The procedure below is invoked when the mouse pointer enters a # button widget. It records the button we're in and changes the # state of the button to active unless the button is disabled. *************** *** 452,492 **** # Arguments: # w - The name of the widget. ! proc tkButtonEnter {w} { ! global tkPriv if {[string compare [$w cget -state] "disabled"]} { ! if {[string equal $w $tkPriv(buttonWindow)]} { $w configure -state active } elseif { [string compare [$w cget -overrelief] ""] } { ! set tkPriv(relief) [$w cget -relief] $w configure -relief [$w cget -overrelief] } } ! set tkPriv(window) $w } ! # tkButtonLeave -- # The procedure below is invoked when the mouse pointer leaves a # button widget. It changes the state of the button back to # inactive. If we're leaving the button window with a mouse button ! # pressed (tkPriv(buttonWindow) == $w), restore the relief of the # button too. # # Arguments: # w - The name of the widget. ! proc tkButtonLeave w { ! global tkPriv ! if {[string equal $w $tkPriv(buttonWindow)]} { $w configure -state normal } if { [string compare [$w cget -overrelief] ""] } { ! $w configure -relief $tkPriv(relief) } ! set tkPriv(window) "" } ! # tkButtonDown -- # The procedure below is invoked when the mouse button is pressed in # a button widget. It records the fact that the mouse is in the button, # saves the button's relief so it can be restored later, and changes --- 452,492 ---- # Arguments: # w - The name of the widget. ! proc ::tk::ButtonEnter {w} { ! variable ::tk::Priv if {[string compare [$w cget -state] "disabled"]} { ! if {[string equal $w $Priv(buttonWindow)]} { $w configure -state active } elseif { [string compare [$w cget -overrelief] ""] } { ! set Priv(relief) [$w cget -relief] $w configure -relief [$w cget -overrelief] } } ! set Priv(window) $w } ! # ::tk::ButtonLeave -- # The procedure below is invoked when the mouse pointer leaves a # button widget. It changes the state of the button back to # inactive. If we're leaving the button window with a mouse button ! # pressed (Priv(buttonWindow) == $w), restore the relief of the # button too. # # Arguments: # w - The name of the widget. ! proc ::tk::ButtonLeave w { ! variable ::tk::Priv ! if {[string equal $w $Priv(buttonWindow)]} { $w configure -state normal } if { [string compare [$w cget -overrelief] ""] } { ! $w configure -relief $Priv(relief) } ! set Priv(window) "" } ! # ::tk::ButtonDown -- # The procedure below is invoked when the mouse button is pressed in # a button widget. It records the fact that the mouse is in the button, # saves the button's relief so it can be restored later, and changes *************** *** 495,520 **** # Arguments: # w - The name of the widget. ! proc tkButtonDown w { ! global tkPriv if {[string compare [$w cget -state] "disabled"]} { ! set tkPriv(buttonWindow) $w $w configure -state active # If this button has a repeatdelay set up, get it going with an after ! after cancel $tkPriv(afterId) if { ![catch {$w cget -repeatdelay} delay] } { set delay [$w cget -repeatdelay] ! set tkPriv(repeated) 0 if {$delay > 0} { ! set tkPriv(afterId) [after $delay [list tkButtonAutoInvoke $w]] } } } } ! # tkButtonUp -- # The procedure below is invoked when the mouse button is released # in a button widget. It restores the button's relief and invokes # the command as long as the mouse hasn't left the button. --- 495,520 ---- # Arguments: # w - The name of the widget. ! proc ::tk::ButtonDown w { ! variable ::tk::Priv if {[string compare [$w cget -state] "disabled"]} { ! set Priv(buttonWindow) $w $w configure -state active # If this button has a repeatdelay set up, get it going with an after ! after cancel $Priv(afterId) if { ![catch {$w cget -repeatdelay} delay] } { set delay [$w cget -repeatdelay] ! set Priv(repeated) 0 if {$delay > 0} { ! set Priv(afterId) [after $delay [list tk::ButtonAutoInvoke $w]] } } } } ! # ::tk::ButtonUp -- # The procedure below is invoked when the mouse button is released # in a button widget. It restores the button's relief and invokes # the command as long as the mouse hasn't left the button. *************** *** 522,545 **** # Arguments: # w - The name of the widget. ! proc tkButtonUp w { ! global tkPriv ! if {[string equal $w $tkPriv(buttonWindow)]} { $w configure -state normal ! set tkPriv(buttonWindow) "" if { [string compare [$w cget -overrelief] ""] } { $w configure -relief [$w cget -overrelief] } # Clean up the after event from the auto-repeater ! after cancel $tkPriv(afterId) ! if {[string equal $w $tkPriv(window)] && [string compare [$w cget -state] "disabled"]} { # Only invoke the command if it wasn't already invoked by the # auto-repeater functionality ! if { $tkPriv(repeated) == 0 } { uplevel #0 [list $w invoke] } } --- 522,545 ---- # Arguments: # w - The name of the widget. ! proc ::tk::ButtonUp w { ! variable ::tk::Priv ! if {[string equal $w $Priv(buttonWindow)]} { $w configure -state normal ! set Priv(buttonWindow) "" if { [string compare [$w cget -overrelief] ""] } { $w configure -relief [$w cget -overrelief] } # Clean up the after event from the auto-repeater ! after cancel $Priv(afterId) ! if {[string equal $w $Priv(window)] && [string compare [$w cget -state] "disabled"]} { # Only invoke the command if it wasn't already invoked by the # auto-repeater functionality ! if { $Priv(repeated) == 0 } { uplevel #0 [list $w invoke] } } *************** *** 552,565 **** # Shared routines ################## ! # tkButtonInvoke -- # The procedure below is called when a button is invoked through # the keyboard. It simulate a press of the button via the mouse. # # Arguments: # w - The name of the widget. ! proc tkButtonInvoke w { if {[string compare [$w cget -state] "disabled"]} { set oldRelief [$w cget -relief] set oldState [$w cget -state] --- 552,565 ---- # Shared routines ################## ! # ::tk::ButtonInvoke -- # The procedure below is called when a button is invoked through # the keyboard. It simulate a press of the button via the mouse. # # Arguments: # w - The name of the widget. ! proc ::tk::ButtonInvoke w { if {[string compare [$w cget -state] "disabled"]} { set oldRelief [$w cget -relief] set oldState [$w cget -state] *************** *** 571,577 **** } } ! # tkButtonAutoInvoke -- # # Invoke an auto-repeating button, and set it up to continue to repeat. # --- 571,577 ---- } } ! # ::tk::ButtonAutoInvoke -- # # Invoke an auto-repeating button, and set it up to continue to repeat. # *************** *** 582,603 **** # None. # # Side effects: ! # May create an after event to call tkButtonAutoInvoke. ! proc tkButtonAutoInvoke {w} { ! global tkPriv ! after cancel $tkPriv(afterId) set delay [$w cget -repeatinterval] ! if { [string equal $tkPriv(window) $w] } { ! incr tkPriv(repeated) uplevel #0 [list $w invoke] } if {$delay > 0} { ! set tkPriv(afterId) [after $delay [list tkButtonAutoInvoke $w]] } } ! # tkCheckRadioInvoke -- # The procedure below is invoked when the mouse button is pressed in # a checkbutton or radiobutton widget, or when the widget is invoked # through the keyboard. It invokes the widget if it --- 582,603 ---- # None. # # Side effects: ! # May create an after event to call ::tk::ButtonAutoInvoke. ! proc ::tk::ButtonAutoInvoke {w} { ! variable ::tk::Priv ! after cancel $Priv(afterId) set delay [$w cget -repeatinterval] ! if { [string equal $Priv(window) $w] } { ! incr Priv(repeated) uplevel #0 [list $w invoke] } if {$delay > 0} { ! set Priv(afterId) [after $delay [list tk::ButtonAutoInvoke $w]] } } ! # ::tk::CheckRadioInvoke -- # The procedure below is invoked when the mouse button is pressed in # a checkbutton or radiobutton widget, or when the widget is invoked # through the keyboard. It invokes the widget if it *************** *** 607,613 **** # w - The name of the widget. # cmd - The subcommand to invoke (one of invoke, select, or deselect). ! proc tkCheckRadioInvoke {w {cmd invoke}} { if {[string compare [$w cget -state] "disabled"]} { uplevel #0 [list $w $cmd] } --- 607,613 ---- # w - The name of the widget. # cmd - The subcommand to invoke (one of invoke, select, or deselect). ! proc ::tk::CheckRadioInvoke {w {cmd invoke}} { if {[string compare [$w cget -state] "disabled"]} { uplevel #0 [list $w $cmd] } Index: library/choosedir.tcl =================================================================== RCS file: /cvsroot/tk/library/choosedir.tcl,v retrieving revision 1.9 diff -c -r1.9 choosedir.tcl *** choosedir.tcl 2000/06/30 06:38:38 1.9 --- choosedir.tcl 2000/07/17 06:27:23 *************** *** 23,29 **** # args Options parsed by the procedure. # proc ::tk::dialog::file::chooseDir::tkChooseDirectory {args} { ! global tkPriv set dataName __tk_choosedir upvar ::tk::dialog::file::$dataName data ::tk::dialog::file::chooseDir::Config $dataName $args --- 23,29 ---- # args Options parsed by the procedure. # proc ::tk::dialog::file::chooseDir::tkChooseDirectory {args} { ! variable ::tk::Priv set dataName __tk_choosedir upvar ::tk::dialog::file::$dataName data ::tk::dialog::file::chooseDir::Config $dataName $args *************** *** 81,87 **** # may take the focus away so we can't redirect it. Finally, # restore any grab that was in effect. ! tkwait variable tkPriv(selectFilePath) ::tk::RestoreFocusGrab $w $data(ent) withdraw --- 81,87 ---- # may take the focus away so we can't redirect it. Finally, # restore any grab that was in effect. ! vwait ::tk::Priv(selectFilePath) ::tk::RestoreFocusGrab $w $data(ent) withdraw *************** *** 96,102 **** # Return value to user # ! return $tkPriv(selectFilePath) } # ::tk::dialog::file::chooseDir::Config -- --- 96,102 ---- # Return value to user # ! return $Priv(selectFilePath) } # ::tk::dialog::file::chooseDir::Config -- *************** *** 182,190 **** # 4b. If the value is different from the current directory, change to # that directory. ! set selection [tkIconList_Curselection $data(icons)] if { [llength $selection] != 0 } { ! set iconText [tkIconList_Get $data(icons) [lindex $selection 0]] set iconText [file join $data(selectPath) $iconText] ::tk::dialog::file::chooseDir::Done $w $iconText } else { --- 182,190 ---- # 4b. If the value is different from the current directory, change to # that directory. ! set selection [tk::IconList_Curselection $data(icons)] if { [llength $selection] != 0 } { ! set iconText [tk::IconList_Get $data(icons) [lindex $selection 0]] set iconText [file join $data(selectPath) $iconText] ::tk::dialog::file::chooseDir::Done $w $iconText } else { *************** *** 220,228 **** proc ::tk::dialog::file::chooseDir::DblClick {w} { upvar ::tk::dialog::file::[winfo name $w] data ! set selection [tkIconList_Curselection $data(icons)] if { [llength $selection] != 0 } { ! set text [tkIconList_Get $data(icons) [lindex $selection 0]] set file $data(selectPath) if {[file isdirectory $file]} { ::tk::dialog::file::ListInvoke $w $text --- 220,228 ---- proc ::tk::dialog::file::chooseDir::DblClick {w} { upvar ::tk::dialog::file::[winfo name $w] data ! set selection [tk::IconList_Curselection $data(icons)] if { [llength $selection] != 0 } { ! set text [tk::IconList_Get $data(icons) [lindex $selection 0]] set file $data(selectPath) if {[file isdirectory $file]} { ::tk::dialog::file::ListInvoke $w $text *************** *** 250,262 **** # # Gets called when user has input a valid filename. Pops up a # dialog box to confirm selection when necessary. Sets the ! # tkPriv(selectFilePath) variable, which will break the "tkwait" # loop in tk_chooseDirectory and return the selected filename to the # script that calls tk_getOpenFile or tk_getSaveFile # proc ::tk::dialog::file::chooseDir::Done {w {selectFilePath ""}} { upvar ::tk::dialog::file::[winfo name $w] data ! global tkPriv if {[string equal $selectFilePath ""]} { set selectFilePath $data(selectPath) --- 250,262 ---- # # Gets called when user has input a valid filename. Pops up a # dialog box to confirm selection when necessary. Sets the ! # Priv(selectFilePath) variable, which will break the "vwait" # loop in tk_chooseDirectory and return the selected filename to the # script that calls tk_getOpenFile or tk_getSaveFile # proc ::tk::dialog::file::chooseDir::Done {w {selectFilePath ""}} { upvar ::tk::dialog::file::[winfo name $w] data ! variable ::tk::Priv if {[string equal $selectFilePath ""]} { set selectFilePath $data(selectPath) *************** *** 267,271 **** return } } ! set tkPriv(selectFilePath) $selectFilePath } --- 267,271 ---- return } } ! set Priv(selectFilePath) $selectFilePath } Index: library/clrpick.tcl =================================================================== RCS file: /cvsroot/tk/library/clrpick.tcl,v retrieving revision 1.11 diff -c -r1.11 clrpick.tcl *** clrpick.tcl 2000/06/30 06:38:38 1.11 --- clrpick.tcl 2000/07/17 06:27:26 *************** *** 17,32 **** # (2): Implement HSV color selection. # ! # tkColorDialog -- # # Create a color dialog and let the user choose a color. This function # should not be called directly. It is called by the tk_chooseColor # function when a native color selector widget does not exist # ! proc tkColorDialog {args} { ! global tkPriv ! set w .__tk__color ! upvar #0 $w data # The lines variables track the start and end indices of the line # elements in the colorbar canvases. --- 17,38 ---- # (2): Implement HSV color selection. # ! # Make sure namespaces exist ! namespace eval ::tk {} ! namespace eval ::tk::dialog {} ! namespace eval ::tk::dialog::color {} ! ! # ::tk::dialog::color:: -- # # Create a color dialog and let the user choose a color. This function # should not be called directly. It is called by the tk_chooseColor # function when a native color selector widget does not exist # ! proc ::tk::dialog::color:: {args} { ! variable ::tk::Priv ! set dataName __tk__color ! upvar ::tk::dialog::color::$dataName data ! set w .$dataName # The lines variables track the start and end indices of the line # elements in the colorbar canvases. *************** *** 56,63 **** # selection rectangle at the bottom of the color bar. No restrictions. set data(PLGN_WIDTH) 10 ! tkColorDialog_Config $w $args ! tkColorDialog_InitValues $w set sc [winfo screen $data(-parent)] set winExists [winfo exists $w] --- 62,69 ---- # selection rectangle at the bottom of the color bar. No restrictions. set data(PLGN_WIDTH) 10 ! Config $dataName $args ! InitValues $dataName set sc [winfo screen $data(-parent)] set winExists [winfo exists $w] *************** *** 65,72 **** if {$winExists} { destroy $w } ! toplevel $w -class tkColorDialog -screen $sc ! tkColorDialog_BuildDialog $w } wm transient $w $data(-parent) --- 71,78 ---- if {$winExists} { destroy $w } ! toplevel $w -class TkColorDialog -screen $sc ! BuildDialog $w } wm transient $w $data(-parent) *************** *** 88,106 **** # may take the focus away so we can't redirect it. Finally, # restore any grab that was in effect. ! vwait tkPriv(selectColor) ::tk::RestoreFocusGrab $w $data(okBtn) unset data ! return $tkPriv(selectColor) } ! # tkColorDialog_InitValues -- # # Get called during initialization or when user resets NUM_COLORBARS # ! proc tkColorDialog_InitValues {w} { ! upvar #0 $w data # IntensityIncr is the difference in color intensity between a colorbar # and its neighbors. --- 94,112 ---- # may take the focus away so we can't redirect it. Finally, # restore any grab that was in effect. ! vwait ::tk::Priv(selectColor) ::tk::RestoreFocusGrab $w $data(okBtn) unset data ! return $Priv(selectColor) } ! # ::tk::dialog::color::InitValues -- # # Get called during initialization or when user resets NUM_COLORBARS # ! proc ::tk::dialog::color::InitValues {dataName} { ! upvar ::tk::dialog::color::$dataName data # IntensityIncr is the difference in color intensity between a colorbar # and its neighbors. *************** *** 144,162 **** set data(blue,intensity) [expr {[lindex $rgb 2]/0x100}] } ! # tkColorDialog_Config -- # # Parses the command line arguments to tk_chooseColor # ! proc tkColorDialog_Config {w argList} { ! global tkPriv ! upvar #0 $w data # 1: the configuration specs # ! if {[info exists tkPriv(selectColor)] && \ ! [string compare $tkPriv(selectColor) ""]} { ! set defaultColor $tkPriv(selectColor) } else { set defaultColor [. cget -background] } --- 150,168 ---- set data(blue,intensity) [expr {[lindex $rgb 2]/0x100}] } ! # ::tk::dialog::color::Config -- # # Parses the command line arguments to tk_chooseColor # ! proc ::tk::dialog::color::Config {dataName argList} { ! variable ::tk::Priv ! upvar ::tk::dialog::color::$dataName data # 1: the configuration specs # ! if {[info exists Priv(selectColor)] && \ ! [string compare $Priv(selectColor) ""]} { ! set defaultColor $Priv(selectColor) } else { set defaultColor [. cget -background] } *************** *** 169,175 **** # 2: parse the arguments # ! tclParseConfigSpec $w $specs "" $argList if {[string equal $data(-title) ""]} { set data(-title) " " --- 175,181 ---- # 2: parse the arguments # ! tclParseConfigSpec ::tk::dialog::color::$dataName $specs "" $argList if {[string equal $data(-title) ""]} { set data(-title) " " *************** *** 183,194 **** } } ! # tkColorDialog_BuildDialog -- # # Build the dialog. # ! proc tkColorDialog_BuildDialog {w} { ! upvar #0 $w data # TopFrame contains the color strips and the color selection # --- 189,200 ---- } } ! # ::tk::dialog::color::BuildDialog -- # # Build the dialog. # ! proc ::tk::dialog::color::BuildDialog {w} { ! upvar ::tk::dialog::color::[winfo name $w] data # TopFrame contains the color strips and the color selection # *************** *** 212,219 **** set box [frame $f.box] label $box.label -text $l: -width $maxWidth -under 0 -anchor ne ! entry $box.entry -textvariable [format %s $w]($color,intensity) \ ! -width 4 pack $box.label -side left -fill y -padx 2 -pady 3 pack $box.entry -side left -anchor n -pady 0 pack $box -side left -fill both --- 218,226 ---- set box [frame $f.box] label $box.label -text $l: -width $maxWidth -under 0 -anchor ne ! entry $box.entry -textvariable \ ! ::tk::dialog::color::[winfo name $w]($color,intensity) \ ! -width 4 pack $box.label -side left -fill y -padx 2 -pady 3 pack $box.entry -side left -anchor n -pady 0 pack $box -side left -fill both *************** *** 236,253 **** set data($color,sel) $f.sel bind $data($color,col) \ ! [list tkColorDialog_DrawColorScale $w $color 1] bind $data($color,col) \ ! [list tkColorDialog_EnterColorBar $w $color] bind $data($color,col) \ ! [list tkColorDialog_LeaveColorBar $w $color] bind $data($color,sel) \ ! [list tkColorDialog_EnterColorBar $w $color] bind $data($color,sel) \ ! [list tkColorDialog_LeaveColorBar $w $color] ! bind $box.entry [list tkColorDialog_HandleRGBEntry $w] } pack $stripsFrame -side left -fill both -padx 4 -pady 10 --- 243,260 ---- set data($color,sel) $f.sel bind $data($color,col) \ ! [list tk::dialog::color::DrawColorScale $w $color 1] bind $data($color,col) \ ! [list tk::dialog::color::EnterColorBar $w $color] bind $data($color,col) \ ! [list tk::dialog::color::LeaveColorBar $w $color] bind $data($color,sel) \ ! [list tk::dialog::color::EnterColorBar $w $color] bind $data($color,sel) \ ! [list tk::dialog::color::LeaveColorBar $w $color] ! bind $box.entry [list tk::dialog::color::HandleRGBEntry $w] } pack $stripsFrame -side left -fill both -padx 4 -pady 10 *************** *** 258,264 **** set selFrame [frame $topFrame.sel] set lab [label $selFrame.lab -text [::msgcat::mc "Selection:"] \ -under 0 -anchor sw] ! set ent [entry $selFrame.ent -textvariable [format %s $w](selection) \ -width 16] set f1 [frame $selFrame.f1 -relief sunken -bd 2] set data(finalCanvas) [frame $f1.demo -bd 0 -width 100 -height 70] --- 265,272 ---- set selFrame [frame $topFrame.sel] set lab [label $selFrame.lab -text [::msgcat::mc "Selection:"] \ -under 0 -anchor sw] ! set ent [entry $selFrame.ent \ ! -textvariable ::tk::dialog::color::[winfo name $w](selection) \ -width 16] set f1 [frame $selFrame.f1 -relief sunken -bd 2] set data(finalCanvas) [frame $f1.demo -bd 0 -width 100 -height 70] *************** *** 267,273 **** pack $f1 -expand yes -anchor nw -fill both -padx 6 -pady 10 pack $data(finalCanvas) -expand yes -fill both ! bind $ent [list tkColorDialog_HandleSelEntry $w] pack $selFrame -side left -fill none -anchor nw pack $topFrame -side top -expand yes -fill both -anchor nw --- 275,281 ---- pack $f1 -expand yes -anchor nw -fill both -padx 6 -pady 10 pack $data(finalCanvas) -expand yes -fill both ! bind $ent [list tk::dialog::color::HandleSelEntry $w] pack $selFrame -side left -fill none -anchor nw pack $topFrame -side top -expand yes -fill both -anchor nw *************** *** 279,288 **** set maxWidth [expr $maxWidth<8?8:$maxWidth] button $botFrame.ok -text [::msgcat::mc "OK"] \ -width $maxWidth -under 0 \ ! -command [list tkColorDialog_OkCmd $w] button $botFrame.cancel -text [::msgcat::mc "Cancel"] \ -width $maxWidth -under 0 \ ! -command [list tkColorDialog_CancelCmd $w] set data(okBtn) $botFrame.ok set data(cancelBtn) $botFrame.cancel --- 287,296 ---- set maxWidth [expr $maxWidth<8?8:$maxWidth] button $botFrame.ok -text [::msgcat::mc "OK"] \ -width $maxWidth -under 0 \ ! -command [list tk::dialog::color::OkCmd $w] button $botFrame.cancel -text [::msgcat::mc "Cancel"] \ -width $maxWidth -under 0 \ ! -command [list tk::dialog::color::CancelCmd $w] set data(okBtn) $botFrame.ok set data(cancelBtn) $botFrame.cancel *************** *** 298,359 **** bind $w [list focus $data(green,entry)] bind $w [list focus $data(blue,entry)] bind $w [list focus $ent] ! bind $w [list tkButtonInvoke $data(cancelBtn)] ! bind $w [list tkButtonInvoke $data(cancelBtn)] ! bind $w [list tkButtonInvoke $data(okBtn)] ! wm protocol $w WM_DELETE_WINDOW [list tkColorDialog_CancelCmd $w] } ! # tkColorDialog_SetRGBValue -- # # Sets the current selection of the dialog box # ! proc tkColorDialog_SetRGBValue {w color} { ! upvar #0 $w data set data(red,intensity) [lindex $color 0] set data(green,intensity) [lindex $color 1] set data(blue,intensity) [lindex $color 2] ! tkColorDialog_RedrawColorBars $w all # Now compute the new x value of each colorbars pointer polygon foreach color [list red green blue ] { ! set x [tkColorDialog_RgbToX $w $data($color,intensity)] ! tkColorDialog_MoveSelector $w $data($color,sel) $color $x 0 } } ! # tkColorDialog_XToRgb -- # # Converts a screen coordinate to intensity # ! proc tkColorDialog_XToRgb {w x} { ! upvar #0 $w data return [expr {($x * $data(intensityIncr))/ $data(colorbarWidth)}] } ! # tkColorDialog_RgbToX # # Converts an intensity to screen coordinate. # ! proc tkColorDialog_RgbToX {w color} { ! upvar #0 $w data return [expr {($color * $data(colorbarWidth)/ $data(intensityIncr))}] } ! # tkColorDialog_DrawColorScale -- # # Draw color scale is called whenever the size of one of the color # scale canvases is changed. # ! proc tkColorDialog_DrawColorScale {w c {create 0}} { ! global lines ! upvar #0 $w data # col: color bar canvas # sel: selector canvas --- 306,366 ---- bind $w [list focus $data(green,entry)] bind $w [list focus $data(blue,entry)] bind $w [list focus $ent] ! bind $w [list tk::ButtonInvoke $data(cancelBtn)] ! bind $w [list tk::ButtonInvoke $data(cancelBtn)] ! bind $w [list tk::ButtonInvoke $data(okBtn)] ! wm protocol $w WM_DELETE_WINDOW [list tk::dialog::color::CancelCmd $w] } ! # ::tk::dialog::color::SetRGBValue -- # # Sets the current selection of the dialog box # ! proc ::tk::dialog::color::SetRGBValue {w color} { ! upvar ::tk::dialog::color::[winfo name $w] data set data(red,intensity) [lindex $color 0] set data(green,intensity) [lindex $color 1] set data(blue,intensity) [lindex $color 2] ! RedrawColorBars $w all # Now compute the new x value of each colorbars pointer polygon foreach color [list red green blue ] { ! set x [RgbToX $w $data($color,intensity)] ! MoveSelector $w $data($color,sel) $color $x 0 } } ! # ::tk::dialog::color::XToRgb -- # # Converts a screen coordinate to intensity # ! proc ::tk::dialog::color::XToRgb {w x} { ! upvar ::tk::dialog::color::[winfo name $w] data return [expr {($x * $data(intensityIncr))/ $data(colorbarWidth)}] } ! # ::tk::dialog::color::RgbToX # # Converts an intensity to screen coordinate. # ! proc ::tk::dialog::color::RgbToX {w color} { ! upvar ::tk::dialog::color::[winfo name $w] data return [expr {($color * $data(colorbarWidth)/ $data(intensityIncr))}] } ! # ::tk::dialog::color::DrawColorScale -- # # Draw color scale is called whenever the size of one of the color # scale canvases is changed. # ! proc ::tk::dialog::color::DrawColorScale {w c {create 0}} { ! upvar ::tk::dialog::color::[winfo name $w] data # col: color bar canvas # sel: selector canvas *************** *** 375,387 **** } # Draw the selection polygons ! tkColorDialog_CreateSelector $w $sel $c $sel bind $data($c,index) \ ! [list tkColorDialog_StartMove $w $sel $c %x $data(selPad) 1] $sel bind $data($c,index) \ ! [list tkColorDialog_MoveSelector $w $sel $c %x $data(selPad)] $sel bind $data($c,index) \ ! [list tkColorDialog_ReleaseMouse $w $sel $c %x $data(selPad)] set height [winfo height $col] # Create an invisible region under the colorstrip to catch mouse clicks --- 382,394 ---- } # Draw the selection polygons ! CreateSelector $w $sel $c $sel bind $data($c,index) \ ! [list tk::dialog::color::StartMove $w $sel $c %x $data(selPad) 1] $sel bind $data($c,index) \ ! [list tk::dialog::color::MoveSelector $w $sel $c %x $data(selPad)] $sel bind $data($c,index) \ ! [list tk::dialog::color::ReleaseMouse $w $sel $c %x $data(selPad)] set height [winfo height $col] # Create an invisible region under the colorstrip to catch mouse clicks *************** *** 390,407 **** $data(canvasWidth) $height -fill {} -outline {}] bind $col \ ! [list tkColorDialog_StartMove $w $sel $c %x $data(colorPad)] bind $col \ ! [list tkColorDialog_MoveSelector $w $sel $c %x $data(colorPad)] bind $col \ ! [list tkColorDialog_ReleaseMouse $w $sel $c %x $data(colorPad)] $sel bind $data($c,clickRegion) \ ! [list tkColorDialog_StartMove $w $sel $c %x $data(selPad)] $sel bind $data($c,clickRegion) \ ! [list tkColorDialog_MoveSelector $w $sel $c %x $data(selPad)] $sel bind $data($c,clickRegion) \ ! [list tkColorDialog_ReleaseMouse $w $sel $c %x $data(selPad)] } else { # l is the canvas index of the first colorbar. set l $data(lines,$c,start) --- 397,414 ---- $data(canvasWidth) $height -fill {} -outline {}] bind $col \ ! [list tk::dialog::color::StartMove $w $sel $c %x $data(colorPad)] bind $col \ ! [list tk::dialog::color::MoveSelector $w $sel $c %x $data(colorPad)] bind $col \ ! [list tk::dialog::color::ReleaseMouse $w $sel $c %x $data(colorPad)] $sel bind $data($c,clickRegion) \ ! [list tk::dialog::color::StartMove $w $sel $c %x $data(selPad)] $sel bind $data($c,clickRegion) \ ! [list tk::dialog::color::MoveSelector $w $sel $c %x $data(selPad)] $sel bind $data($c,clickRegion) \ ! [list tk::dialog::color::ReleaseMouse $w $sel $c %x $data(selPad)] } else { # l is the canvas index of the first colorbar. set l $data(lines,$c,start) *************** *** 446,475 **** set data(lines,$c,start) [expr {$index - $data(NUM_COLORBARS) + 1}] } ! tkColorDialog_RedrawFinalColor $w } ! # tkColorDialog_CreateSelector -- # # Creates and draws the selector polygon at the position # $data($c,intensity). # ! proc tkColorDialog_CreateSelector {w sel c } { ! upvar #0 $w data set data($c,index) [$sel create polygon \ 0 $data(PLGN_HEIGHT) \ $data(PLGN_WIDTH) $data(PLGN_HEIGHT) \ $data(indent) 0] ! set data($c,x) [tkColorDialog_RgbToX $w $data($c,intensity)] $sel move $data($c,index) $data($c,x) 0 } ! # tkColorDialog_RedrawFinalColor # # Combines the intensities of the three colors into the final color # ! proc tkColorDialog_RedrawFinalColor {w} { ! upvar #0 $w data set color [format "#%02x%02x%02x" $data(red,intensity) \ $data(green,intensity) $data(blue,intensity)] --- 453,482 ---- set data(lines,$c,start) [expr {$index - $data(NUM_COLORBARS) + 1}] } ! RedrawFinalColor $w } ! # ::tk::dialog::color::CreateSelector -- # # Creates and draws the selector polygon at the position # $data($c,intensity). # ! proc ::tk::dialog::color::CreateSelector {w sel c } { ! upvar ::tk::dialog::color::[winfo name $w] data set data($c,index) [$sel create polygon \ 0 $data(PLGN_HEIGHT) \ $data(PLGN_WIDTH) $data(PLGN_HEIGHT) \ $data(indent) 0] ! set data($c,x) [RgbToX $w $data($c,intensity)] $sel move $data($c,index) $data($c,x) 0 } ! # ::tk::dialog::color::RedrawFinalColor # # Combines the intensities of the three colors into the final color # ! proc ::tk::dialog::color::RedrawFinalColor {w} { ! upvar ::tk::dialog::color::[winfo name $w] data set color [format "#%02x%02x%02x" $data(red,intensity) \ $data(green,intensity) $data(blue,intensity)] *************** *** 483,524 **** $data(blue,intensity)] } ! # tkColorDialog_RedrawColorBars -- # # Only redraws the colors on the color strips that were not manipulated. # Params: color of colorstrip that changed. If color is not [red|green|blue] # Then all colorstrips will be updated # ! proc tkColorDialog_RedrawColorBars {w colorChanged} { ! upvar #0 $w data switch $colorChanged { red { ! tkColorDialog_DrawColorScale $w green ! tkColorDialog_DrawColorScale $w blue } green { ! tkColorDialog_DrawColorScale $w red ! tkColorDialog_DrawColorScale $w blue } blue { ! tkColorDialog_DrawColorScale $w red ! tkColorDialog_DrawColorScale $w green } default { ! tkColorDialog_DrawColorScale $w red ! tkColorDialog_DrawColorScale $w green ! tkColorDialog_DrawColorScale $w blue } } ! tkColorDialog_RedrawFinalColor $w } #---------------------------------------------------------------------- # Event handlers #---------------------------------------------------------------------- ! # tkColorDialog_StartMove -- # # Handles a mousedown button event over the selector polygon. # Adds the bindings for moving the mouse while the button is --- 490,531 ---- $data(blue,intensity)] } ! # ::tk::dialog::color::RedrawColorBars -- # # Only redraws the colors on the color strips that were not manipulated. # Params: color of colorstrip that changed. If color is not [red|green|blue] # Then all colorstrips will be updated # ! proc ::tk::dialog::color::RedrawColorBars {w colorChanged} { ! upvar ::tk::dialog::color::[winfo name $w] data switch $colorChanged { red { ! DrawColorScale $w green ! DrawColorScale $w blue } green { ! DrawColorScale $w red ! DrawColorScale $w blue } blue { ! DrawColorScale $w red ! DrawColorScale $w green } default { ! DrawColorScale $w red ! DrawColorScale $w green ! DrawColorScale $w blue } } ! RedrawFinalColor $w } #---------------------------------------------------------------------- # Event handlers #---------------------------------------------------------------------- ! # ::tk::dialog::color::StartMove -- # # Handles a mousedown button event over the selector polygon. # Adds the bindings for moving the mouse while the button is *************** *** 526,540 **** # # Params: sel is the selector canvas window, color is the color of the strip. # ! proc tkColorDialog_StartMove {w sel color x delta {dontMove 0}} { ! upvar #0 $w data if {!$dontMove} { ! tkColorDialog_MoveSelector $w $sel $color $x $delta } } ! # tkColorDialog_MoveSelector -- # # Moves the polygon selector so that its middle point has the same # x value as the specified x. If x is outside the bounds [0,255], --- 533,547 ---- # # Params: sel is the selector canvas window, color is the color of the strip. # ! proc ::tk::dialog::color::StartMove {w sel color x delta {dontMove 0}} { ! upvar ::tk::dialog::color::[winfo name $w] data if {!$dontMove} { ! MoveSelector $w $sel $color $x $delta } } ! # ::tk::dialog::color::MoveSelector -- # # Moves the polygon selector so that its middle point has the same # x value as the specified x. If x is outside the bounds [0,255], *************** *** 543,550 **** # Params: sel is the selector canvas, c is [red|green|blue] # x is a x-coordinate. # ! proc tkColorDialog_MoveSelector {w sel color x delta} { ! upvar #0 $w data incr x -$delta --- 550,557 ---- # Params: sel is the selector canvas, c is [red|green|blue] # x is a x-coordinate. # ! proc ::tk::dialog::color::MoveSelector {w sel color x delta} { ! upvar ::tk::dialog::color::[winfo name $w] data incr x -$delta *************** *** 561,609 **** return $x } ! # tkColorDialog_ReleaseMouse # # Removes mouse tracking bindings, updates the colorbars. # # Params: sel is the selector canvas, color is the color of the strip, # x is the x-coord of the mouse. # ! proc tkColorDialog_ReleaseMouse {w sel color x delta} { ! upvar #0 $w data ! set x [tkColorDialog_MoveSelector $w $sel $color $x $delta] # Determine exactly what color we are looking at. ! set data($color,intensity) [tkColorDialog_XToRgb $w $x] ! tkColorDialog_RedrawColorBars $w $color } ! # tkColorDialog_ResizeColorbars -- # # Completely redraws the colorbars, including resizing the # colorstrips # ! proc tkColorDialog_ResizeColorBars {w} { ! upvar #0 $w data if { ($data(BARS_WIDTH) < $data(NUM_COLORBARS)) || (($data(BARS_WIDTH) % $data(NUM_COLORBARS)) != 0)} { set data(BARS_WIDTH) $data(NUM_COLORBARS) } ! tkColorDialog_InitValues $w foreach color [list red green blue ] { $data($color,col) configure -width $data(canvasWidth) ! tkColorDialog_DrawColorScale $w $color 1 } } ! # tkColorDialog_HandleSelEntry -- # # Handles the return keypress event in the "Selection:" entry # ! proc tkColorDialog_HandleSelEntry {w} { ! upvar #0 $w data set text [string trim $data(selection)] # Check to make sure that the color is valid --- 568,616 ---- return $x } ! # ::tk::dialog::color::ReleaseMouse # # Removes mouse tracking bindings, updates the colorbars. # # Params: sel is the selector canvas, color is the color of the strip, # x is the x-coord of the mouse. # ! proc ::tk::dialog::color::ReleaseMouse {w sel color x delta} { ! upvar ::tk::dialog::color::[winfo name $w] data ! set x [MoveSelector $w $sel $color $x $delta] # Determine exactly what color we are looking at. ! set data($color,intensity) [XToRgb $w $x] ! RedrawColorBars $w $color } ! # ::tk::dialog::color::ResizeColorbars -- # # Completely redraws the colorbars, including resizing the # colorstrips # ! proc ::tk::dialog::color::ResizeColorBars {w} { ! upvar ::tk::dialog::color::[winfo name $w] data if { ($data(BARS_WIDTH) < $data(NUM_COLORBARS)) || (($data(BARS_WIDTH) % $data(NUM_COLORBARS)) != 0)} { set data(BARS_WIDTH) $data(NUM_COLORBARS) } ! InitValues [winfo name $w] foreach color [list red green blue ] { $data($color,col) configure -width $data(canvasWidth) ! DrawColorScale $w $color 1 } } ! # ::tk::dialog::color::HandleSelEntry -- # # Handles the return keypress event in the "Selection:" entry # ! proc ::tk::dialog::color::HandleSelEntry {w} { ! upvar ::tk::dialog::color::[winfo name $w] data set text [string trim $data(selection)] # Check to make sure that the color is valid *************** *** 616,631 **** set G [expr {[lindex $color 1]/0x100}] set B [expr {[lindex $color 2]/0x100}] ! tkColorDialog_SetRGBValue $w "$R $G $B" set data(selection) $text } ! # tkColorDialog_HandleRGBEntry -- # # Handles the return keypress event in the R, G or B entry # ! proc tkColorDialog_HandleRGBEntry {w} { ! upvar #0 $w data foreach c [list red green blue] { if {[catch { --- 623,638 ---- set G [expr {[lindex $color 1]/0x100}] set B [expr {[lindex $color 2]/0x100}] ! SetRGBValue $w "$R $G $B" set data(selection) $text } ! # ::tk::dialog::color::HandleRGBEntry -- # # Handles the return keypress event in the R, G or B entry # ! proc ::tk::dialog::color::HandleRGBEntry {w} { ! upvar ::tk::dialog::color::[winfo name $w] data foreach c [list red green blue] { if {[catch { *************** *** 642,681 **** } } ! tkColorDialog_SetRGBValue $w "$data(red,intensity) \ $data(green,intensity) $data(blue,intensity)" } # mouse cursor enters a color bar # ! proc tkColorDialog_EnterColorBar {w color} { ! upvar #0 $w data $data($color,sel) itemconfig $data($color,index) -fill red } # mouse leaves enters a color bar # ! proc tkColorDialog_LeaveColorBar {w color} { ! upvar #0 $w data $data($color,sel) itemconfig $data($color,index) -fill black } # user hits OK button # ! proc tkColorDialog_OkCmd {w} { ! global tkPriv ! upvar #0 $w data ! set tkPriv(selectColor) $data(finalColor) } # user hits Cancel button # ! proc tkColorDialog_CancelCmd {w} { ! global tkPriv ! ! set tkPriv(selectColor) "" } --- 649,687 ---- } } ! SetRGBValue $w "$data(red,intensity) \ $data(green,intensity) $data(blue,intensity)" } # mouse cursor enters a color bar # ! proc ::tk::dialog::color::EnterColorBar {w color} { ! upvar ::tk::dialog::color::[winfo name $w] data $data($color,sel) itemconfig $data($color,index) -fill red } # mouse leaves enters a color bar # ! proc ::tk::dialog::color::LeaveColorBar {w color} { ! upvar ::tk::dialog::color::[winfo name $w] data $data($color,sel) itemconfig $data($color,index) -fill black } # user hits OK button # ! proc ::tk::dialog::color::OkCmd {w} { ! variable ::tk::Priv ! upvar ::tk::dialog::color::[winfo name $w] data ! set Priv(selectColor) $data(finalColor) } # user hits Cancel button # ! proc ::tk::dialog::color::CancelCmd {w} { ! variable ::tk::Priv ! set Priv(selectColor) "" } Index: library/comdlg.tcl =================================================================== RCS file: /cvsroot/tk/library/comdlg.tcl,v retrieving revision 1.7 diff -c -r1.7 comdlg.tcl *** comdlg.tcl 2000/04/08 06:59:28 1.7 --- comdlg.tcl 2000/07/17 06:27:28 *************** *** 112,205 **** #---------------------------------------------------------------------- ! # tkFocusGroup_Create -- # # Create a focus group. All the widgets in a focus group must be # within the same focus toplevel. Each toplevel can have only # one focus group, which is identified by the name of the # toplevel widget. # ! proc tkFocusGroup_Create {t} { ! global tkPriv if {[string compare [winfo toplevel $t] $t]} { error "$t is not a toplevel window" } ! if {![info exists tkPriv(fg,$t)]} { ! set tkPriv(fg,$t) 1 ! set tkPriv(focus,$t) "" ! bind $t [list tkFocusGroup_In $t %W %d] ! bind $t [list tkFocusGroup_Out $t %W %d] ! bind $t [list tkFocusGroup_Destroy $t %W] } } ! # tkFocusGroup_BindIn -- # # Add a widget into the "FocusIn" list of the focus group. The $cmd will be # called when the widget is focused on by the user. # ! proc tkFocusGroup_BindIn {t w cmd} { ! global tkFocusIn tkPriv ! if {![info exists tkPriv(fg,$t)]} { error "focus group \"$t\" doesn't exist" } ! set tkFocusIn($t,$w) $cmd } ! # tkFocusGroup_BindOut -- # # Add a widget into the "FocusOut" list of the focus group. The # $cmd will be called when the widget loses the focus (User # types Tab or click on another widget). # ! proc tkFocusGroup_BindOut {t w cmd} { ! global tkFocusOut tkPriv ! if {![info exists tkPriv(fg,$t)]} { error "focus group \"$t\" doesn't exist" } ! set tkFocusOut($t,$w) $cmd } ! # tkFocusGroup_Destroy -- # # Cleans up when members of the focus group is deleted, or when the # toplevel itself gets deleted. # ! proc tkFocusGroup_Destroy {t w} { ! global tkPriv tkFocusIn tkFocusOut if {[string equal $t $w]} { ! unset tkPriv(fg,$t) ! unset tkPriv(focus,$t) ! foreach name [array names tkFocusIn $t,*] { ! unset tkFocusIn($name) } ! foreach name [array names tkFocusOut $t,*] { ! unset tkFocusOut($name) } } else { ! if {[info exists tkPriv(focus,$t)] && \ ! [string equal $tkPriv(focus,$t) $w]} { ! set tkPriv(focus,$t) "" } catch { ! unset tkFocusIn($t,$w) } catch { ! unset tkFocusOut($t,$w) } } } ! # tkFocusGroup_In -- # # Handles the event. Calls the FocusIn command for the newly # focused widget in the focus group. # ! proc tkFocusGroup_In {t w detail} { ! global tkPriv tkFocusIn if {[string compare $detail NotifyNonlinear] && \ [string compare $detail NotifyNonlinearVirtual]} { --- 112,210 ---- #---------------------------------------------------------------------- ! # ::tk::FocusGroup_Create -- # # Create a focus group. All the widgets in a focus group must be # within the same focus toplevel. Each toplevel can have only # one focus group, which is identified by the name of the # toplevel widget. # ! proc ::tk::FocusGroup_Create {t} { ! variable ::tk::Priv if {[string compare [winfo toplevel $t] $t]} { error "$t is not a toplevel window" } ! if {![info exists Priv(fg,$t)]} { ! set Priv(fg,$t) 1 ! set Priv(focus,$t) "" ! bind $t [list tk::FocusGroup_In $t %W %d] ! bind $t [list tk::FocusGroup_Out $t %W %d] ! bind $t [list tk::FocusGroup_Destroy $t %W] } } ! # ::tk::FocusGroup_BindIn -- # # Add a widget into the "FocusIn" list of the focus group. The $cmd will be # called when the widget is focused on by the user. # ! proc ::tk::FocusGroup_BindIn {t w cmd} { ! variable FocusIn ! variable ::tk::Priv ! if {![info exists Priv(fg,$t)]} { error "focus group \"$t\" doesn't exist" } ! set FocusIn($t,$w) $cmd } ! # ::tk::FocusGroup_BindOut -- # # Add a widget into the "FocusOut" list of the focus group. The # $cmd will be called when the widget loses the focus (User # types Tab or click on another widget). # ! proc ::tk::FocusGroup_BindOut {t w cmd} { ! variable FocusOut ! variable ::tk::Priv ! if {![info exists Priv(fg,$t)]} { error "focus group \"$t\" doesn't exist" } ! set FocusOut($t,$w) $cmd } ! # ::tk::FocusGroup_Destroy -- # # Cleans up when members of the focus group is deleted, or when the # toplevel itself gets deleted. # ! proc ::tk::FocusGroup_Destroy {t w} { ! variable FocusIn ! variable FocusOut ! variable ::tk::Priv if {[string equal $t $w]} { ! unset Priv(fg,$t) ! unset Priv(focus,$t) ! foreach name [array names FocusIn $t,*] { ! unset FocusIn($name) } ! foreach name [array names FocusOut $t,*] { ! unset FocusOut($name) } } else { ! if {[info exists Priv(focus,$t)] && \ ! [string equal $Priv(focus,$t) $w]} { ! set Priv(focus,$t) "" } catch { ! unset FocusIn($t,$w) } catch { ! unset FocusOut($t,$w) } } } ! # ::tk::FocusGroup_In -- # # Handles the event. Calls the FocusIn command for the newly # focused widget in the focus group. # ! proc ::tk::FocusGroup_In {t w detail} { ! variable FocusIn ! variable ::tk::Priv if {[string compare $detail NotifyNonlinear] && \ [string compare $detail NotifyNonlinearVirtual]} { *************** *** 207,262 **** # ordinary keypresses some window managers (ie: CDE [Bug: 2960]). return } ! if {![info exists tkFocusIn($t,$w)]} { ! set tkFocusIn($t,$w) "" return } ! if {![info exists tkPriv(focus,$t)]} { return } ! if {[string equal $tkPriv(focus,$t) $w]} { # This is already in focus # return } else { ! set tkPriv(focus,$t) $w ! eval $tkFocusIn($t,$w) } } ! # tkFocusGroup_Out -- # # Handles the event. Checks if this is really a lose # focus event, not one generated by the mouse moving out of the # toplevel window. Calls the FocusOut command for the widget # who loses its focus. # ! proc tkFocusGroup_Out {t w detail} { ! global tkPriv tkFocusOut if {[string compare $detail NotifyNonlinear] && \ [string compare $detail NotifyNonlinearVirtual]} { # This is caused by mouse moving out of the window return } ! if {![info exists tkPriv(focus,$t)]} { return } ! if {![info exists tkFocusOut($t,$w)]} { return } else { ! eval $tkFocusOut($t,$w) ! set tkPriv(focus,$t) "" } } ! # tkFDGetFileTypes -- # # Process the string given by the -filetypes option of the file # dialogs. Similar to the C function TkGetFileFilters() on the Mac # and Windows platform. # ! proc tkFDGetFileTypes {string} { foreach t $string { if {[llength $t] < 2 || [llength $t] > 3} { error "bad file type \"$t\", should be \"typeName {extension ?extensions ...?} ?{macType ?macTypes ...?}?\"" --- 212,268 ---- # ordinary keypresses some window managers (ie: CDE [Bug: 2960]). return } ! if {![info exists FocusIn($t,$w)]} { ! set FocusIn($t,$w) "" return } ! if {![info exists Priv(focus,$t)]} { return } ! if {[string equal $Priv(focus,$t) $w]} { # This is already in focus # return } else { ! set Priv(focus,$t) $w ! eval $FocusIn($t,$w) } } ! # ::tk::FocusGroup_Out -- # # Handles the event. Checks if this is really a lose # focus event, not one generated by the mouse moving out of the # toplevel window. Calls the FocusOut command for the widget # who loses its focus. # ! proc ::tk::FocusGroup_Out {t w detail} { ! variable FocusOut ! variable ::tk::Priv if {[string compare $detail NotifyNonlinear] && \ [string compare $detail NotifyNonlinearVirtual]} { # This is caused by mouse moving out of the window return } ! if {![info exists Priv(focus,$t)]} { return } ! if {![info exists FocusOut($t,$w)]} { return } else { ! eval $FocusOut($t,$w) ! set Priv(focus,$t) "" } } ! # ::tk::FDGetFileTypes -- # # Process the string given by the -filetypes option of the file # dialogs. Similar to the C function TkGetFileFilters() on the Mac # and Windows platform. # ! proc ::tk::FDGetFileTypes {string} { foreach t $string { if {[llength $t] < 2 || [llength $t] > 3} { error "bad file type \"$t\", should be \"typeName {extension ?extensions ...?} ?{macType ?macTypes ...?}?\"" Index: library/console.tcl =================================================================== RCS file: /cvsroot/tk/library/console.tcl,v retrieving revision 1.9 diff -c -r1.9 console.tcl *** console.tcl 2000/06/30 06:38:38 1.9 --- console.tcl 2000/07/17 06:27:30 *************** *** 15,27 **** # TODO: history - remember partially written command ! # tkConsoleInit -- # This procedure constructs and configures the console windows. # # Arguments: # None. ! proc tkConsoleInit {} { global tcl_platform if {![consoleinterp eval {set tcl_interactive}]} { --- 15,27 ---- # TODO: history - remember partially written command ! # ::tk::ConsoleInit -- # This procedure constructs and configures the console windows. # # Arguments: # None. ! proc ::tk::ConsoleInit {} { global tcl_platform if {![consoleinterp eval {set tcl_interactive}]} { *************** *** 40,46 **** menu .menubar.file -tearoff 0 .menubar.file add command -label [::msgcat::mc "Source..."] \ ! -underline 0 -command tkConsoleSource .menubar.file add command -label [::msgcat::mc "Hide Console"] \ -underline 0 -command {wm withdraw .} if {[string compare $tcl_platform(platform) "macintosh"]} { --- 40,46 ---- menu .menubar.file -tearoff 0 .menubar.file add command -label [::msgcat::mc "Source..."] \ ! -underline 0 -command tk::ConsoleSource .menubar.file add command -label [::msgcat::mc "Hide Console"] \ -underline 0 -command {wm withdraw .} if {[string compare $tcl_platform(platform) "macintosh"]} { *************** *** 69,75 **** .menubar add cascade -label Help -menu .menubar.help -underline 0 menu .menubar.help -tearoff 0 .menubar.help add command -label [::msgcat::mc "About..."] \ ! -underline 0 -command tkConsoleAbout } . configure -menu .menubar --- 69,75 ---- .menubar add cascade -label Help -menu .menubar.help -underline 0 menu .menubar.help -tearoff 0 .menubar.help add command -label [::msgcat::mc "About..."] \ ! -underline 0 -command tk::ConsoleAbout } . configure -menu .menubar *************** *** 87,93 **** } } ! tkConsoleBind .console .console tag configure stderr -foreground red .console tag configure stdin -foreground blue --- 87,93 ---- } } ! ConsoleBind .console .console tag configure stderr -foreground red .console tag configure stdin -foreground blue *************** *** 98,116 **** wm title . [::msgcat::mc "Console"] flush stdout .console mark set output [.console index "end - 1 char"] ! tkTextSetCursor .console end .console mark set promptEnd insert .console mark gravity promptEnd left } ! # tkConsoleSource -- # # Prompts the user for a file to source in the main interpreter. # # Arguments: # None. ! proc tkConsoleSource {} { set filename [tk_getOpenFile -defaultextension .tcl -parent . \ -title [::msgcat::mc "Select a file to source"] \ -filetypes [list \ --- 98,116 ---- wm title . [::msgcat::mc "Console"] flush stdout .console mark set output [.console index "end - 1 char"] ! tk::TextSetCursor .console end .console mark set promptEnd insert .console mark gravity promptEnd left } ! # ::tk::ConsoleSource -- # # Prompts the user for a file to source in the main interpreter. # # Arguments: # None. ! proc ::tk::ConsoleSource {} { set filename [tk_getOpenFile -defaultextension .tcl -parent . \ -title [::msgcat::mc "Select a file to source"] \ -filetypes [list \ *************** *** 119,130 **** if {[string compare $filename ""]} { set cmd [list source $filename] if {[catch {consoleinterp eval $cmd} result]} { ! tkConsoleOutput stderr "$result\n" } } } ! # tkConsoleInvoke -- # Processes the command line input. If the command is complete it # is evaled in the main interpreter. Otherwise, the continuation # prompt is added and more input may be added. --- 119,130 ---- if {[string compare $filename ""]} { set cmd [list source $filename] if {[catch {consoleinterp eval $cmd} result]} { ! ConsoleOutput stderr "$result\n" } } } ! # ::tk::ConsoleInvoke -- # Processes the command line input. If the command is complete it # is evaled in the main interpreter. Otherwise, the continuation # prompt is added and more input may be added. *************** *** 132,138 **** # Arguments: # None. ! proc tkConsoleInvoke {args} { set ranges [.console tag ranges input] set cmd "" if {[llength $ranges]} { --- 132,138 ---- # Arguments: # None. ! proc ::tk::ConsoleInvoke {args} { set ranges [.console tag ranges input] set cmd "" if {[llength $ranges]} { *************** *** 145,151 **** } } if {[string equal $cmd ""]} { ! tkConsolePrompt } elseif {[info complete $cmd]} { .console mark set output end .console tag delete input --- 145,151 ---- } } if {[string equal $cmd ""]} { ! ConsolePrompt } elseif {[info complete $cmd]} { .console mark set output end .console tag delete input *************** *** 153,178 **** if {[string compare $result ""]} { puts $result } ! tkConsoleHistory reset ! tkConsolePrompt } else { ! tkConsolePrompt partial } .console yview -pickplace insert } ! # tkConsoleHistory -- # This procedure implements command line history for the # console. In general is evals the history command in the ! # main interpreter to obtain the history. The global variable ! # histNum is used to store the current location in the history. # # Arguments: # cmd - Which action to take: prev, next, reset. ! set histNum 1 ! proc tkConsoleHistory {cmd} { ! global histNum switch $cmd { prev { --- 153,178 ---- if {[string compare $result ""]} { puts $result } ! ConsoleHistory reset ! ConsolePrompt } else { ! ConsolePrompt partial } .console yview -pickplace insert } ! # ::tk::ConsoleHistory -- # This procedure implements command line history for the # console. In general is evals the history command in the ! # main interpreter to obtain the history. The variable ! # ::tk::histNum is used to store the current location in the history. # # Arguments: # cmd - Which action to take: prev, next, reset. ! set ::tk::histNum 1 ! proc ::tk::ConsoleHistory {cmd} { ! variable histNum switch $cmd { prev { *************** *** 211,217 **** } } ! # tkConsolePrompt -- # This procedure draws the prompt. If tcl_prompt1 or tcl_prompt2 # exists in the main interpreter it will be called to generate the # prompt. Otherwise, a hard coded default prompt is printed. --- 211,217 ---- } } ! # ::tk::ConsolePrompt -- # This procedure draws the prompt. If tcl_prompt1 or tcl_prompt2 # exists in the main interpreter it will be called to generate the # prompt. Otherwise, a hard coded default prompt is printed. *************** *** 219,225 **** # Arguments: # partial - Flag to specify which prompt to print. ! proc tkConsolePrompt {{partial normal}} { if {[string equal $partial "normal"]} { set temp [.console index "end - 1 char"] .console mark set output end --- 219,225 ---- # Arguments: # partial - Flag to specify which prompt to print. ! proc ::tk::ConsolePrompt {{partial normal}} { if {[string equal $partial "normal"]} { set temp [.console index "end - 1 char"] .console mark set output end *************** *** 239,250 **** } flush stdout .console mark set output $temp ! tkTextSetCursor .console end .console mark set promptEnd insert .console mark gravity promptEnd left } ! # tkConsoleBind -- # This procedure first ensures that the default bindings for the Text # class have been defined. Then certain bindings are overridden for # the class. --- 239,250 ---- } flush stdout .console mark set output $temp ! ::tk::TextSetCursor .console end .console mark set promptEnd insert .console mark gravity promptEnd left } ! # ::tk::ConsoleBind -- # This procedure first ensures that the default bindings for the Text # class have been defined. Then certain bindings are overridden for # the class. *************** *** 252,258 **** # Arguments: # None. ! proc tkConsoleBind {win} { bindtags $win "$win Text . all" # Ignore all Alt, Meta, and Control keypresses unless explicitly bound. --- 252,258 ---- # Arguments: # None. ! proc ::tk::ConsoleBind {win} { bindtags $win "$win Text . all" # Ignore all Alt, Meta, and Control keypresses unless explicitly bound. *************** *** 267,280 **** bind $win {# nothing} bind $win { ! tkConsoleInsert %W \t focus %W break } bind $win { %W mark set insert {end - 1c} ! tkConsoleInsert %W "\n" ! tkConsoleInvoke break } bind $win { --- 267,280 ---- bind $win {# nothing} bind $win { ! tk::ConsoleInsert %W \t focus %W break } bind $win { %W mark set insert {end - 1c} ! tk::ConsoleInsert %W "\n" ! tk::ConsoleInvoke break } bind $win { *************** *** 294,309 **** foreach left {Control-a Home} { bind $win <$left> { if {[%W compare insert < promptEnd]} { ! tkTextSetCursor %W {insert linestart} } else { ! tkTextSetCursor %W promptEnd } break } } foreach right {Control-e End} { bind $win <$right> { ! tkTextSetCursor %W {insert lineend} break } } --- 294,309 ---- foreach left {Control-a Home} { bind $win <$left> { if {[%W compare insert < promptEnd]} { ! tk::TextSetCursor %W {insert linestart} } else { ! tk::TextSetCursor %W promptEnd } break } } foreach right {Control-e End} { bind $win <$right> { ! tk::TextSetCursor %W {insert lineend} break } } *************** *** 339,360 **** } foreach prev {Control-p Up} { bind $win <$prev> { ! tkConsoleHistory prev break } } foreach prev {Control-n Down} { bind $win <$prev> { ! tkConsoleHistory next break } } bind $win { ! catch {tkConsoleInsert %W [selection get -displayof %W]} break } bind $win { ! tkConsoleInsert %W %A break } foreach left {Control-b Left} { --- 339,360 ---- } foreach prev {Control-p Up} { bind $win <$prev> { ! tk::ConsoleHistory prev break } } foreach prev {Control-n Down} { bind $win <$prev> { ! tk::ConsoleHistory next break } } bind $win { ! catch {tk::ConsoleInsert %W [selection get -displayof %W]} break } bind $win { ! tk::ConsoleInsert %W %A break } foreach left {Control-b Left} { *************** *** 362,374 **** if {[%W compare insert == promptEnd]} { break } ! tkTextSetCursor %W insert-1c break } } foreach right {Control-f Right} { bind $win <$right> { ! tkTextSetCursor %W insert+1c break } } --- 362,374 ---- if {[%W compare insert == promptEnd]} { break } ! tk::TextSetCursor %W insert-1c break } } foreach right {Control-f Right} { bind $win <$right> { ! tk::TextSetCursor %W insert+1c break } } *************** *** 399,417 **** catch { set clip [selection get -displayof %W -selection CLIPBOARD] set list [split $clip \n\r] ! tkConsoleInsert %W [lindex $list 0] foreach x [lrange $list 1 end] { %W mark set insert {end - 1c} ! tkConsoleInsert %W "\n" ! tkConsoleInvoke ! tkConsoleInsert %W $x } } break } } ! # tkConsoleInsert -- # Insert a string into a text at the point of the insertion cursor. # If there is a selection in the text, and it covers the point of the # insertion cursor, then delete the selection before inserting. Insertion --- 399,417 ---- catch { set clip [selection get -displayof %W -selection CLIPBOARD] set list [split $clip \n\r] ! tk::ConsoleInsert %W [lindex $list 0] foreach x [lrange $list 1 end] { %W mark set insert {end - 1c} ! tk::ConsoleInsert %W "\n" ! tk::ConsoleInvoke ! tk::ConsoleInsert %W $x } } break } } ! # ::tk::ConsoleInsert -- # Insert a string into a text at the point of the insertion cursor. # If there is a selection in the text, and it covers the point of the # insertion cursor, then delete the selection before inserting. Insertion *************** *** 421,427 **** # w - The text window in which to insert the string # s - The string to insert (usually just a single character) ! proc tkConsoleInsert {w s} { if {[string equal $s ""]} { return } --- 421,427 ---- # w - The text window in which to insert the string # s - The string to insert (usually just a single character) ! proc ::tk::ConsoleInsert {w s} { if {[string equal $s ""]} { return } *************** *** 439,445 **** $w see insert } ! # tkConsoleOutput -- # # This routine is called directly by ConsolePutsCmd to cause a string # to be displayed in the console. --- 439,445 ---- $w see insert } ! # ::tk::ConsoleOutput -- # # This routine is called directly by ConsolePutsCmd to cause a string # to be displayed in the console. *************** *** 448,459 **** # dest - The output tag to be used: either "stderr" or "stdout". # string - The string to be displayed. ! proc tkConsoleOutput {dest string} { .console insert output $string $dest .console see insert } ! # tkConsoleExit -- # # This routine is called by ConsoleEventProc when the main window of # the application is destroyed. Don't call exit - that probably already --- 448,459 ---- # dest - The output tag to be used: either "stderr" or "stdout". # string - The string to be displayed. ! proc ::tk::ConsoleOutput {dest string} { .console insert output $string $dest .console see insert } ! # ::tk::ConsoleExit -- # # This routine is called by ConsoleEventProc when the main window of # the application is destroyed. Don't call exit - that probably already *************** *** 462,479 **** # Arguments: # None. ! proc tkConsoleExit {} { destroy . } ! # tkConsoleAbout -- # # This routine displays an About box to show Tcl/Tk version info. # # Arguments: # None. ! proc tkConsoleAbout {} { global tk_patchLevel tk_messageBox -type ok -message "[::msgcat::mc {Tcl for Windows}] Copyright \251 2000 Scriptics Corporation --- 462,479 ---- # Arguments: # None. ! proc ::tk::ConsoleExit {} { destroy . } ! # ::tk::ConsoleAbout -- # # This routine displays an About box to show Tcl/Tk version info. # # Arguments: # None. ! proc ::tk::ConsoleAbout {} { global tk_patchLevel tk_messageBox -type ok -message "[::msgcat::mc {Tcl for Windows}] Copyright \251 2000 Scriptics Corporation *************** *** 484,487 **** # now initialize the console ! tkConsoleInit --- 484,487 ---- # now initialize the console ! ::tk::ConsoleInit Index: library/dialog.tcl =================================================================== RCS file: /cvsroot/tk/library/dialog.tcl,v retrieving revision 1.8 diff -c -r1.8 dialog.tcl *** dialog.tcl 2000/04/18 02:18:33 1.8 --- dialog.tcl 2000/07/17 06:27:32 *************** *** 13,19 **** # # ! # tk_dialog: # # This procedure displays a dialog box, waits for a button in the dialog # to be invoked, then returns the index of the selected button. If the --- 13,19 ---- # # ! # ::tk_dialog: # # This procedure displays a dialog box, waits for a button in the dialog # to be invoked, then returns the index of the selected button. If the *************** *** 29,36 **** # args - One or more strings to display in buttons across the # bottom of the dialog box. ! proc tk_dialog {w title text bitmap default args} { ! global tkPriv tcl_platform # Check that $default was properly given if {[string is int $default]} { --- 29,37 ---- # args - One or more strings to display in buttons across the # bottom of the dialog box. ! proc ::tk_dialog {w title text bitmap default args} { ! global tcl_platform ! variable ::tk::Priv # Check that $default was properly given if {[string is int $default]} { *************** *** 103,109 **** set i 0 foreach but $args { ! button $w.button$i -text $but -command [list set tkPriv(button) $i] if {$i == $default} { $w.button$i configure -default active } else { --- 104,110 ---- set i 0 foreach but $args { ! button $w.button$i -text $but -command [list set Priv(button) $i] if {$i == $default} { $w.button$i configure -default active } else { *************** *** 129,135 **** [list $w.button$default] configure -state active -relief sunken update idletasks after 100 ! set tkPriv(button) $default " } --- 130,136 ---- [list $w.button$default] configure -state active -relief sunken update idletasks after 100 ! set Priv(button) $default " } *************** *** 137,143 **** # button variable to -1; this is needed in case something happens # that destroys the window, such as its parent window being destroyed. ! bind $w {set tkPriv(button) -1} # 6. Withdraw the window, then update all the geometry information # so we know how big it wants to be, then center the window in the --- 138,144 ---- # button variable to -1; this is needed in case something happens # that destroys the window, such as its parent window being destroyed. ! bind $w {set Priv(button) -1} # 6. Withdraw the window, then update all the geometry information # so we know how big it wants to be, then center the window in the *************** *** 172,183 **** # may take the focus away so we can't redirect it. Finally, # restore any grab that was in effect. ! tkwait variable tkPriv(button) catch {focus $oldFocus} catch { # It's possible that the window has already been destroyed, # hence this "catch". Delete the Destroy handler so that ! # tkPriv(button) doesn't get reset by it. bind $w {} destroy $w --- 173,184 ---- # may take the focus away so we can't redirect it. Finally, # restore any grab that was in effect. ! vwait ::tk::Priv(button) catch {focus $oldFocus} catch { # It's possible that the window has already been destroyed, # hence this "catch". Delete the Destroy handler so that ! # tk::Priv(button) doesn't get reset by it. bind $w {} destroy $w *************** *** 189,193 **** grab -global $oldGrab } } ! return $tkPriv(button) } --- 190,194 ---- grab -global $oldGrab } } ! return $Priv(button) } Index: library/entry.tcl =================================================================== RCS file: /cvsroot/tk/library/entry.tcl,v retrieving revision 1.13 diff -c -r1.13 entry.tcl *** entry.tcl 2000/05/29 01:43:14 1.13 --- entry.tcl 2000/07/17 06:27:35 *************** *** 13,19 **** # #------------------------------------------------------------------------- ! # Elements of tkPriv that are used in this file: # # afterId - If non-null, it means that auto-scanning is underway # and it gives the "after" id for the next auto-scan --- 13,19 ---- # #------------------------------------------------------------------------- ! # Elements of tk::Priv that are used in this file: # # afterId - If non-null, it means that auto-scanning is underway # and it gives the "after" id for the next auto-scan *************** *** 33,50 **** # The code below creates the default class bindings for entries. #------------------------------------------------------------------------- bind Entry <> { ! if {![catch {tkEntryGetSelection %W} tkPriv(data)]} { clipboard clear -displayof %W ! clipboard append -displayof %W $tkPriv(data) %W delete sel.first sel.last ! unset tkPriv(data) } } bind Entry <> { ! if {![catch {tkEntryGetSelection %W} tkPriv(data)]} { clipboard clear -displayof %W ! clipboard append -displayof %W $tkPriv(data) ! unset tkPriv(data) } } bind Entry <> { --- 33,50 ---- # The code below creates the default class bindings for entries. #------------------------------------------------------------------------- bind Entry <> { ! if {![catch {tk::EntryGetSelection %W} tk::Priv(data)]} { clipboard clear -displayof %W ! clipboard append -displayof %W $tk::Priv(data) %W delete sel.first sel.last ! unset tk::Priv(data) } } bind Entry <> { ! if {![catch {tk::EntryGetSelection %W} tk::Priv(data)]} { clipboard clear -displayof %W ! clipboard append -displayof %W $tk::Priv(data) ! unset tk::Priv(data) } } bind Entry <> { *************** *** 56,160 **** } } %W insert insert [selection get -displayof %W -selection CLIPBOARD] ! tkEntrySeeInsert %W } } bind Entry <> { %W delete sel.first sel.last } bind Entry <> { ! if {!$tkPriv(mouseMoved) || $tk_strictMotif} { ! tkEntryPaste %W %x } } # Standard Motif bindings: bind Entry <1> { ! tkEntryButton1 %W %x %W selection clear } bind Entry { ! set tkPriv(x) %x ! tkEntryMouseSelect %W %x } bind Entry { ! set tkPriv(selectMode) word ! tkEntryMouseSelect %W %x catch {%W icursor sel.first} } bind Entry { ! set tkPriv(selectMode) line ! tkEntryMouseSelect %W %x %W icursor 0 } bind Entry { ! set tkPriv(selectMode) char %W selection adjust @%x } bind Entry { ! set tkPriv(selectMode) word ! tkEntryMouseSelect %W %x } bind Entry { ! set tkPriv(selectMode) line ! tkEntryMouseSelect %W %x } bind Entry { ! set tkPriv(x) %x ! tkEntryAutoScan %W } bind Entry { ! tkCancelRepeat } bind Entry { ! tkCancelRepeat } bind Entry { %W icursor @%x } bind Entry { ! tkEntrySetCursor %W [expr {[%W index insert] - 1}] } bind Entry { ! tkEntrySetCursor %W [expr {[%W index insert] + 1}] } bind Entry { ! tkEntryKeySelect %W [expr {[%W index insert] - 1}] ! tkEntrySeeInsert %W } bind Entry { ! tkEntryKeySelect %W [expr {[%W index insert] + 1}] ! tkEntrySeeInsert %W } bind Entry { ! tkEntrySetCursor %W [tkEntryPreviousWord %W insert] } bind Entry { ! tkEntrySetCursor %W [tkEntryNextWord %W insert] } bind Entry { ! tkEntryKeySelect %W [tkEntryPreviousWord %W insert] ! tkEntrySeeInsert %W } bind Entry { ! tkEntryKeySelect %W [tkEntryNextWord %W insert] ! tkEntrySeeInsert %W } bind Entry { ! tkEntrySetCursor %W 0 } bind Entry { ! tkEntryKeySelect %W 0 ! tkEntrySeeInsert %W } bind Entry { ! tkEntrySetCursor %W end } bind Entry { ! tkEntryKeySelect %W end ! tkEntrySeeInsert %W } bind Entry { --- 56,160 ---- } } %W insert insert [selection get -displayof %W -selection CLIPBOARD] ! tk::EntrySeeInsert %W } } bind Entry <> { %W delete sel.first sel.last } bind Entry <> { ! if {!$tk::Priv(mouseMoved) || $tk_strictMotif} { ! tk::EntryPaste %W %x } } # Standard Motif bindings: bind Entry <1> { ! tk::EntryButton1 %W %x %W selection clear } bind Entry { ! set tk::Priv(x) %x ! tk::EntryMouseSelect %W %x } bind Entry { ! set tk::Priv(selectMode) word ! tk::EntryMouseSelect %W %x catch {%W icursor sel.first} } bind Entry { ! set tk::Priv(selectMode) line ! tk::EntryMouseSelect %W %x %W icursor 0 } bind Entry { ! set tk::Priv(selectMode) char %W selection adjust @%x } bind Entry { ! set tk::Priv(selectMode) word ! tk::EntryMouseSelect %W %x } bind Entry { ! set tk::Priv(selectMode) line ! tk::EntryMouseSelect %W %x } bind Entry { ! set tk::Priv(x) %x ! tk::EntryAutoScan %W } bind Entry { ! tk::CancelRepeat } bind Entry { ! tk::CancelRepeat } bind Entry { %W icursor @%x } bind Entry { ! tk::EntrySetCursor %W [expr {[%W index insert] - 1}] } bind Entry { ! tk::EntrySetCursor %W [expr {[%W index insert] + 1}] } bind Entry { ! tk::EntryKeySelect %W [expr {[%W index insert] - 1}] ! tk::EntrySeeInsert %W } bind Entry { ! tk::EntryKeySelect %W [expr {[%W index insert] + 1}] ! tk::EntrySeeInsert %W } bind Entry { ! tk::EntrySetCursor %W [tk::EntryPreviousWord %W insert] } bind Entry { ! tk::EntrySetCursor %W [tk::EntryNextWord %W insert] } bind Entry { ! tk::EntryKeySelect %W [tk::EntryPreviousWord %W insert] ! tk::EntrySeeInsert %W } bind Entry { ! tk::EntryKeySelect %W [tk::EntryNextWord %W insert] ! tk::EntrySeeInsert %W } bind Entry { ! tk::EntrySetCursor %W 0 } bind Entry { ! tk::EntryKeySelect %W 0 ! tk::EntrySeeInsert %W } bind Entry { ! tk::EntrySetCursor %W end } bind Entry { ! tk::EntryKeySelect %W end ! tk::EntrySeeInsert %W } bind Entry { *************** *** 165,171 **** } } bind Entry { ! tkEntryBackspace %W } bind Entry { --- 165,171 ---- } } bind Entry { ! tk::EntryBackspace %W } bind Entry { *************** *** 187,193 **** %W selection clear } bind Entry { ! tkEntryInsert %W %A } # Ignore all Alt, Meta, and Control keypresses unless explicitly bound. --- 187,193 ---- %W selection clear } bind Entry { ! tk::EntryInsert %W %A } # Ignore all Alt, Meta, and Control keypresses unless explicitly bound. *************** *** 210,216 **** # generates the <> event, so we don't need to do anything here. if {[string compare $tcl_platform(platform) "windows"]} { bind Entry { ! catch {tkEntryInsert %W [selection get -displayof %W]} } } --- 210,216 ---- # generates the <> event, so we don't need to do anything here. if {[string compare $tcl_platform(platform) "windows"]} { bind Entry { ! catch {tk::EntryInsert %W [selection get -displayof %W]} } } *************** *** 218,229 **** bind Entry { if {!$tk_strictMotif} { ! tkEntrySetCursor %W 0 } } bind Entry { if {!$tk_strictMotif} { ! tkEntrySetCursor %W [expr {[%W index insert] - 1}] } } bind Entry { --- 218,229 ---- bind Entry { if {!$tk_strictMotif} { ! tk::EntrySetCursor %W 0 } } bind Entry { if {!$tk_strictMotif} { ! tk::EntrySetCursor %W [expr {[%W index insert] - 1}] } } bind Entry { *************** *** 233,249 **** } bind Entry { if {!$tk_strictMotif} { ! tkEntrySetCursor %W end } } bind Entry { if {!$tk_strictMotif} { ! tkEntrySetCursor %W [expr {[%W index insert] + 1}] } } bind Entry { if {!$tk_strictMotif} { ! tkEntryBackspace %W } } bind Entry { --- 233,249 ---- } bind Entry { if {!$tk_strictMotif} { ! tk::EntrySetCursor %W end } } bind Entry { if {!$tk_strictMotif} { ! tk::EntrySetCursor %W [expr {[%W index insert] + 1}] } } bind Entry { if {!$tk_strictMotif} { ! tk::EntryBackspace %W } } bind Entry { *************** *** 253,284 **** } bind Entry { if {!$tk_strictMotif} { ! tkEntryTranspose %W } } bind Entry { if {!$tk_strictMotif} { ! tkEntrySetCursor %W [tkEntryPreviousWord %W insert] } } bind Entry { if {!$tk_strictMotif} { ! %W delete insert [tkEntryNextWord %W insert] } } bind Entry { if {!$tk_strictMotif} { ! tkEntrySetCursor %W [tkEntryNextWord %W insert] } } bind Entry { if {!$tk_strictMotif} { ! %W delete [tkEntryPreviousWord %W insert] insert } } bind Entry { if {!$tk_strictMotif} { ! %W delete [tkEntryPreviousWord %W insert] insert } } --- 253,284 ---- } bind Entry { if {!$tk_strictMotif} { ! tk::EntryTranspose %W } } bind Entry { if {!$tk_strictMotif} { ! tk::EntrySetCursor %W [tk::EntryPreviousWord %W insert] } } bind Entry { if {!$tk_strictMotif} { ! %W delete insert [tk::EntryNextWord %W insert] } } bind Entry { if {!$tk_strictMotif} { ! tk::EntrySetCursor %W [tk::EntryNextWord %W insert] } } bind Entry { if {!$tk_strictMotif} { ! %W delete [tk::EntryPreviousWord %W insert] insert } } bind Entry { if {!$tk_strictMotif} { ! %W delete [tk::EntryPreviousWord %W insert] insert } } *************** *** 287,307 **** bind Entry <2> { if {!$tk_strictMotif} { %W scan mark %x ! set tkPriv(x) %x ! set tkPriv(y) %y ! set tkPriv(mouseMoved) 0 } } bind Entry { if {!$tk_strictMotif} { ! if {abs(%x-$tkPriv(x)) > 2} { ! set tkPriv(mouseMoved) 1 } %W scan dragto %x } } ! # tkEntryClosestGap -- # Given x and y coordinates, this procedure finds the closest boundary # between characters to the given coordinates and returns the index # of the character just after the boundary. --- 287,307 ---- bind Entry <2> { if {!$tk_strictMotif} { %W scan mark %x ! set tk::Priv(x) %x ! set tk::Priv(y) %y ! set tk::Priv(mouseMoved) 0 } } bind Entry { if {!$tk_strictMotif} { ! if {abs(%x-$tk::Priv(x)) > 2} { ! set tk::Priv(mouseMoved) 1 } %W scan dragto %x } } ! # ::tk::EntryClosestGap -- # Given x and y coordinates, this procedure finds the closest boundary # between characters to the given coordinates and returns the index # of the character just after the boundary. *************** *** 310,316 **** # w - The entry window. # x - X-coordinate within the window. ! proc tkEntryClosestGap {w x} { set pos [$w index @$x] set bbox [$w bbox $pos] if {($x - [lindex $bbox 0]) < ([lindex $bbox 2]/2)} { --- 310,316 ---- # w - The entry window. # x - X-coordinate within the window. ! proc ::tk::EntryClosestGap {w x} { set pos [$w index @$x] set bbox [$w bbox $pos] if {($x - [lindex $bbox 0]) < ([lindex $bbox 2]/2)} { *************** *** 319,325 **** incr pos } ! # tkEntryButton1 -- # This procedure is invoked to handle button-1 presses in entry # widgets. It moves the insertion cursor, sets the selection anchor, # and claims the input focus. --- 319,325 ---- incr pos } ! # ::tk::EntryButton1 -- # This procedure is invoked to handle button-1 presses in entry # widgets. It moves the insertion cursor, sets the selection anchor, # and claims the input focus. *************** *** 328,345 **** # w - The entry window in which the button was pressed. # x - The x-coordinate of the button press. ! proc tkEntryButton1 {w x} { ! global tkPriv ! set tkPriv(selectMode) char ! set tkPriv(mouseMoved) 0 ! set tkPriv(pressX) $x ! $w icursor [tkEntryClosestGap $w $x] $w selection from insert if {[string compare "disabled" [$w cget -state]]} {focus $w} } ! # tkEntryMouseSelect -- # This procedure is invoked when dragging out a selection with # the mouse. Depending on the selection mode (character, word, # line) it selects in different-sized units. This procedure --- 328,345 ---- # w - The entry window in which the button was pressed. # x - The x-coordinate of the button press. ! proc ::tk::EntryButton1 {w x} { ! variable ::tk::Priv ! set Priv(selectMode) char ! set Priv(mouseMoved) 0 ! set Priv(pressX) $x ! $w icursor [EntryClosestGap $w $x] $w selection from insert if {[string compare "disabled" [$w cget -state]]} {focus $w} } ! # ::tk::EntryMouseSelect -- # This procedure is invoked when dragging out a selection with # the mouse. Depending on the selection mode (character, word, # line) it selects in different-sized units. This procedure *************** *** 350,366 **** # w - The entry window in which the button was pressed. # x - The x-coordinate of the mouse. ! proc tkEntryMouseSelect {w x} { ! global tkPriv ! set cur [tkEntryClosestGap $w $x] set anchor [$w index anchor] ! if {($cur != $anchor) || (abs($tkPriv(pressX) - $x) >= 3)} { ! set tkPriv(mouseMoved) 1 } ! switch $tkPriv(selectMode) { char { ! if {$tkPriv(mouseMoved)} { if {$cur < $anchor} { $w selection range $cur $anchor } elseif {$cur > $anchor} { --- 350,366 ---- # w - The entry window in which the button was pressed. # x - The x-coordinate of the mouse. ! proc ::tk::EntryMouseSelect {w x} { ! variable ::tk::Priv ! set cur [EntryClosestGap $w $x] set anchor [$w index anchor] ! if {($cur != $anchor) || (abs($Priv(pressX) - $x) >= 3)} { ! set Priv(mouseMoved) 1 } ! switch $Priv(selectMode) { char { ! if {$Priv(mouseMoved)} { if {$cur < $anchor} { $w selection range $cur $anchor } elseif {$cur > $anchor} { *************** *** 393,399 **** update idletasks } ! # tkEntryPaste -- # This procedure sets the insertion cursor to the current mouse position, # pastes the selection there, and sets the focus to the window. # --- 393,399 ---- update idletasks } ! # ::tk::EntryPaste -- # This procedure sets the insertion cursor to the current mouse position, # pastes the selection there, and sets the focus to the window. # *************** *** 401,415 **** # w - The entry window. # x - X position of the mouse. ! proc tkEntryPaste {w x} { ! global tkPriv ! ! $w icursor [tkEntryClosestGap $w $x] catch {$w insert insert [selection get -displayof $w]} if {[string compare "disabled" [$w cget -state]]} {focus $w} } ! # tkEntryAutoScan -- # This procedure is invoked when the mouse leaves an entry window # with button 1 down. It scrolls the window left or right, # depending on where the mouse is, and reschedules itself as an --- 401,413 ---- # w - The entry window. # x - X position of the mouse. ! proc ::tk::EntryPaste {w x} { ! $w icursor [EntryClosestGap $w $x] catch {$w insert insert [selection get -displayof $w]} if {[string compare "disabled" [$w cget -state]]} {focus $w} } ! # ::tk::EntryAutoScan -- # This procedure is invoked when the mouse leaves an entry window # with button 1 down. It scrolls the window left or right, # depending on where the mouse is, and reschedules itself as an *************** *** 419,439 **** # Arguments: # w - The entry window. ! proc tkEntryAutoScan {w} { ! global tkPriv ! set x $tkPriv(x) if {![winfo exists $w]} return if {$x >= [winfo width $w]} { $w xview scroll 2 units ! tkEntryMouseSelect $w $x } elseif {$x < 0} { $w xview scroll -2 units ! tkEntryMouseSelect $w $x } ! set tkPriv(afterId) [after 50 [list tkEntryAutoScan $w]] } ! # tkEntryKeySelect -- # This procedure is invoked when stroking out selections using the # keyboard. It moves the cursor to a new position, then extends # the selection to that position. --- 417,437 ---- # Arguments: # w - The entry window. ! proc ::tk::EntryAutoScan {w} { ! variable ::tk::Priv ! set x $Priv(x) if {![winfo exists $w]} return if {$x >= [winfo width $w]} { $w xview scroll 2 units ! EntryMouseSelect $w $x } elseif {$x < 0} { $w xview scroll -2 units ! EntryMouseSelect $w $x } ! set Priv(afterId) [after 50 [list tk::EntryAutoScan $w]] } ! # ::tk::EntryKeySelect -- # This procedure is invoked when stroking out selections using the # keyboard. It moves the cursor to a new position, then extends # the selection to that position. *************** *** 443,449 **** # new - A new position for the insertion cursor (the cursor hasn't # actually been moved to this position yet). ! proc tkEntryKeySelect {w new} { if {![$w selection present]} { $w selection from insert $w selection to $new --- 441,447 ---- # new - A new position for the insertion cursor (the cursor hasn't # actually been moved to this position yet). ! proc ::tk::EntryKeySelect {w new} { if {![$w selection present]} { $w selection from insert $w selection to $new *************** *** 453,459 **** $w icursor $new } ! # tkEntryInsert -- # Insert a string into an entry at the point of the insertion cursor. # If there is a selection in the entry, and it covers the point of the # insertion cursor, then delete the selection before inserting. --- 451,457 ---- $w icursor $new } ! # ::tk::EntryInsert -- # Insert a string into an entry at the point of the insertion cursor. # If there is a selection in the entry, and it covers the point of the # insertion cursor, then delete the selection before inserting. *************** *** 462,468 **** # w - The entry window in which to insert the string # s - The string to insert (usually just a single character) ! proc tkEntryInsert {w s} { if {[string equal $s ""]} { return } --- 460,466 ---- # w - The entry window in which to insert the string # s - The string to insert (usually just a single character) ! proc ::tk::EntryInsert {w s} { if {[string equal $s ""]} { return } *************** *** 474,483 **** } } $w insert insert $s ! tkEntrySeeInsert $w } ! # tkEntryBackspace -- # Backspace over the character just before the insertion cursor. # If backspacing would move the cursor off the left edge of the # window, reposition the cursor at about the middle of the window. --- 472,481 ---- } } $w insert insert $s ! EntrySeeInsert $w } ! # ::tk::EntryBackspace -- # Backspace over the character just before the insertion cursor. # If backspacing would move the cursor off the left edge of the # window, reposition the cursor at about the middle of the window. *************** *** 485,491 **** # Arguments: # w - The entry window in which to backspace. ! proc tkEntryBackspace w { if {[$w selection present]} { $w delete sel.first sel.last } else { --- 483,489 ---- # Arguments: # w - The entry window in which to backspace. ! proc ::tk::EntryBackspace w { if {[$w selection present]} { $w delete sel.first sel.last } else { *************** *** 500,520 **** } } ! # tkEntrySeeInsert -- # Make sure that the insertion cursor is visible in the entry window. # If not, adjust the view so that it is. # # Arguments: # w - The entry window. ! proc tkEntrySeeInsert w { set c [$w index insert] if {($c < [$w index @0]) || ($c > [$w index @[winfo width $w]])} { $w xview $c } } ! # tkEntrySetCursor - # Move the insertion cursor to a given position in an entry. Also # clears the selection, if there is one in the entry, and makes sure # that the insertion cursor is visible. --- 498,518 ---- } } ! # ::tk::EntrySeeInsert -- # Make sure that the insertion cursor is visible in the entry window. # If not, adjust the view so that it is. # # Arguments: # w - The entry window. ! proc ::tk::EntrySeeInsert w { set c [$w index insert] if {($c < [$w index @0]) || ($c > [$w index @[winfo width $w]])} { $w xview $c } } ! # ::tk::EntrySetCursor - # Move the insertion cursor to a given position in an entry. Also # clears the selection, if there is one in the entry, and makes sure # that the insertion cursor is visible. *************** *** 523,535 **** # w - The entry window. # pos - The desired new position for the cursor in the window. ! proc tkEntrySetCursor {w pos} { $w icursor $pos $w selection clear ! tkEntrySeeInsert $w } ! # tkEntryTranspose - # This procedure implements the "transpose" function for entry widgets. # It tranposes the characters on either side of the insertion cursor, # unless the cursor is at the end of the line. In this case it --- 521,533 ---- # w - The entry window. # pos - The desired new position for the cursor in the window. ! proc ::tk::EntrySetCursor {w pos} { $w icursor $pos $w selection clear ! EntrySeeInsert $w } ! # ::tk::EntryTranspose - # This procedure implements the "transpose" function for entry widgets. # It tranposes the characters on either side of the insertion cursor, # unless the cursor is at the end of the line. In this case it *************** *** 539,545 **** # Arguments: # w - The entry window. ! proc tkEntryTranspose w { set i [$w index insert] if {$i < [$w index end]} { incr i --- 537,543 ---- # Arguments: # w - The entry window. ! proc ::tk::EntryTranspose w { set i [$w index insert] if {$i < [$w index end]} { incr i *************** *** 551,560 **** set new [string index [$w get] [expr {$i-1}]][string index [$w get] $first] $w delete $first $i $w insert insert $new ! tkEntrySeeInsert $w } ! # tkEntryNextWord -- # Returns the index of the next word position after a given position in the # entry. The next word is platform dependent and may be either the next # end-of-word position or the next start-of-word position after the next --- 549,558 ---- set new [string index [$w get] [expr {$i-1}]][string index [$w get] $first] $w delete $first $i $w insert insert $new ! EntrySeeInsert $w } ! # ::tk::EntryNextWord -- # Returns the index of the next word position after a given position in the # entry. The next word is platform dependent and may be either the next # end-of-word position or the next start-of-word position after the next *************** *** 565,571 **** # start - Position at which to start search. if {[string equal $tcl_platform(platform) "windows"]} { ! proc tkEntryNextWord {w start} { set pos [tcl_endOfWord [$w get] [$w index $start]] if {$pos >= 0} { set pos [tcl_startOfNextWord [$w get] $pos] --- 563,569 ---- # start - Position at which to start search. if {[string equal $tcl_platform(platform) "windows"]} { ! proc ::tk::EntryNextWord {w start} { set pos [tcl_endOfWord [$w get] [$w index $start]] if {$pos >= 0} { set pos [tcl_startOfNextWord [$w get] $pos] *************** *** 576,582 **** return $pos } } else { ! proc tkEntryNextWord {w start} { set pos [tcl_endOfWord [$w get] [$w index $start]] if {$pos < 0} { return end --- 574,580 ---- return $pos } } else { ! proc ::tk::EntryNextWord {w start} { set pos [tcl_endOfWord [$w get] [$w index $start]] if {$pos < 0} { return end *************** *** 585,591 **** } } ! # tkEntryPreviousWord -- # # Returns the index of the previous word position before a given # position in the entry. --- 583,589 ---- } } ! # ::tk::EntryPreviousWord -- # # Returns the index of the previous word position before a given # position in the entry. *************** *** 594,614 **** # w - The entry window in which the cursor is to move. # start - Position at which to start search. ! proc tkEntryPreviousWord {w start} { set pos [tcl_startOfPreviousWord [$w get] [$w index $start]] if {$pos < 0} { return 0 } return $pos } ! # tkEntryGetSelection -- # # Returns the selected text of the entry with respect to the -show option. # # Arguments: # w - The entry window from which the text to get ! proc tkEntryGetSelection {w} { set entryString [string range [$w get] [$w index sel.first] \ [expr {[$w index sel.last] - 1}]] if {[string compare [$w cget -show] ""]} { --- 592,612 ---- # w - The entry window in which the cursor is to move. # start - Position at which to start search. ! proc ::tk::EntryPreviousWord {w start} { set pos [tcl_startOfPreviousWord [$w get] [$w index $start]] if {$pos < 0} { return 0 } return $pos } ! # ::tk::EntryGetSelection -- # # Returns the selected text of the entry with respect to the -show option. # # Arguments: # w - The entry window from which the text to get ! proc ::tk::EntryGetSelection {w} { set entryString [string range [$w get] [$w index sel.first] \ [expr {[$w index sel.last] - 1}]] if {[string compare [$w cget -show] ""]} { Index: library/focus.tcl =================================================================== RCS file: /cvsroot/tk/library/focus.tcl,v retrieving revision 1.8 diff -c -r1.8 focus.tcl *** focus.tcl 2000/05/09 17:28:31 1.8 --- focus.tcl 2000/07/17 06:27:35 *************** *** 11,17 **** # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # ! # tk_focusNext -- # This procedure returns the name of the next window after "w" in # "focus order" (the window that should receive the focus next if # Tab is typed in w). "Next" is defined by a pre-order search --- 11,17 ---- # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # ! # ::tk_focusNext -- # This procedure returns the name of the next window after "w" in # "focus order" (the window that should receive the focus next if # Tab is typed in w). "Next" is defined by a pre-order search *************** *** 22,28 **** # Arguments: # w - Name of a window. ! proc tk_focusNext w { set cur $w while {1} { --- 22,28 ---- # Arguments: # w - Name of a window. ! proc ::tk_focusNext w { set cur $w while {1} { *************** *** 57,69 **** set children [winfo children $parent] set i [lsearch -exact $children $cur] } ! if {[string equal $w $cur] || [tkFocusOK $cur]} { return $cur } } } ! # tk_focusPrev -- # This procedure returns the name of the previous window before "w" in # "focus order" (the window that should receive the focus next if # Shift-Tab is typed in w). "Next" is defined by a pre-order search --- 57,69 ---- set children [winfo children $parent] set i [lsearch -exact $children $cur] } ! if {[string equal $w $cur] || [tk::FocusOK $cur]} { return $cur } } } ! # ::tk_focusPrev -- # This procedure returns the name of the previous window before "w" in # "focus order" (the window that should receive the focus next if # Shift-Tab is typed in w). "Next" is defined by a pre-order search *************** *** 74,80 **** # Arguments: # w - Name of a window. ! proc tk_focusPrev w { set cur $w while {1} { --- 74,80 ---- # Arguments: # w - Name of a window. ! proc ::tk_focusPrev w { set cur $w while {1} { *************** *** 108,120 **** set i [llength $children] } set cur $parent ! if {[string equal $w $cur] || [tkFocusOK $cur]} { return $cur } } } ! # tkFocusOK -- # # This procedure is invoked to decide whether or not to focus on # a given window. It returns 1 if it's OK to focus on the window, --- 108,120 ---- set i [llength $children] } set cur $parent ! if {[string equal $w $cur] || [tk::FocusOK $cur]} { return $cur } } } ! # ::tk::FocusOK -- # # This procedure is invoked to decide whether or not to focus on # a given window. It returns 1 if it's OK to focus on the window, *************** *** 128,134 **** # Arguments: # w - Name of a window. ! proc tkFocusOK w { set code [catch {$w cget -takefocus} value] if {($code == 0) && ($value != "")} { if {$value == 0} { --- 128,134 ---- # Arguments: # w - Name of a window. ! proc ::tk::FocusOK w { set code [catch {$w cget -takefocus} value] if {($code == 0) && ($value != "")} { if {$value == 0} { *************** *** 152,158 **** regexp Key|Focus "[bind $w] [bind [winfo class $w]]" } ! # tk_focusFollowsMouse -- # # If this procedure is invoked, Tk will enter "focus-follows-mouse" # mode, where the focus is always on whatever window contains the --- 152,158 ---- regexp Key|Focus "[bind $w] [bind [winfo class $w]]" } ! # ::tk_focusFollowsMouse -- # # If this procedure is invoked, Tk will enter "focus-follows-mouse" # mode, where the focus is always on whatever window contains the *************** *** 162,174 **** # Arguments: # None. ! proc tk_focusFollowsMouse {} { set old [bind all ] set script { if {[string equal "%d" "NotifyAncestor"] \ || [string equal "%d" "NotifyNonlinear"] \ || [string equal "%d" "NotifyInferior"]} { ! if {[tkFocusOK %W]} { focus %W } } --- 162,174 ---- # Arguments: # None. ! proc ::tk_focusFollowsMouse {} { set old [bind all ] set script { if {[string equal "%d" "NotifyAncestor"] \ || [string equal "%d" "NotifyNonlinear"] \ || [string equal "%d" "NotifyInferior"]} { ! if {[tk::FocusOK %W]} { focus %W } } Index: library/listbox.tcl =================================================================== RCS file: /cvsroot/tk/library/listbox.tcl,v retrieving revision 1.11 diff -c -r1.11 listbox.tcl *** listbox.tcl 2000/03/24 19:38:57 1.11 --- listbox.tcl 2000/07/17 06:27:38 *************** *** 13,19 **** # of this file, and for a DISCLAIMER OF ALL WARRANTIES. #-------------------------------------------------------------------------- ! # tkPriv elements used in this file: # # afterId - Token returned by "after" for autoscanning. # listboxPrev - The last element to be selected or deselected --- 13,19 ---- # of this file, and for a DISCLAIMER OF ALL WARRANTIES. #-------------------------------------------------------------------------- ! # tk::Priv elements used in this file: # # afterId - Token returned by "after" for autoscanning. # listboxPrev - The last element to be selected or deselected *************** *** 35,41 **** bind Listbox <1> { if {[winfo exists %W]} { ! tkListboxBeginSelect %W [%W index @%x,%y] } } --- 35,41 ---- bind Listbox <1> { if {[winfo exists %W]} { ! tk::ListboxBeginSelect %W [%W index @%x,%y] } } *************** *** 48,87 **** } bind Listbox { ! set tkPriv(x) %x ! set tkPriv(y) %y ! tkListboxMotion %W [%W index @%x,%y] } bind Listbox { ! tkCancelRepeat %W activate @%x,%y } bind Listbox { ! tkListboxBeginExtend %W [%W index @%x,%y] } bind Listbox { ! tkListboxBeginToggle %W [%W index @%x,%y] } bind Listbox { ! set tkPriv(x) %x ! set tkPriv(y) %y ! tkListboxAutoScan %W } bind Listbox { ! tkCancelRepeat } bind Listbox { ! tkListboxUpDown %W -1 } bind Listbox { ! tkListboxExtendUpDown %W -1 } bind Listbox { ! tkListboxUpDown %W 1 } bind Listbox { ! tkListboxExtendUpDown %W 1 } bind Listbox { %W xview scroll -1 units --- 48,87 ---- } bind Listbox { ! set tk::Priv(x) %x ! set tk::Priv(y) %y ! tk::ListboxMotion %W [%W index @%x,%y] } bind Listbox { ! tk::CancelRepeat %W activate @%x,%y } bind Listbox { ! tk::ListboxBeginExtend %W [%W index @%x,%y] } bind Listbox { ! tk::ListboxBeginToggle %W [%W index @%x,%y] } bind Listbox { ! set tk::Priv(x) %x ! set tk::Priv(y) %y ! tk::ListboxAutoScan %W } bind Listbox { ! tk::CancelRepeat } bind Listbox { ! tk::ListboxUpDown %W -1 } bind Listbox { ! tk::ListboxExtendUpDown %W -1 } bind Listbox { ! tk::ListboxUpDown %W 1 } bind Listbox { ! tk::ListboxExtendUpDown %W 1 } bind Listbox { %W xview scroll -1 units *************** *** 123,129 **** event generate %W <> } bind Listbox { ! tkListboxDataExtend %W 0 } bind Listbox { %W activate end --- 123,129 ---- event generate %W <> } bind Listbox { ! tk::ListboxDataExtend %W 0 } bind Listbox { %W activate end *************** *** 133,139 **** event generate %W <> } bind Listbox { ! tkListboxDataExtend %W [%W index end] } bind Listbox <> { if {[string equal [selection own -displayof %W] "%W"]} { --- 133,139 ---- event generate %W <> } bind Listbox { ! tk::ListboxDataExtend %W [%W index end] } bind Listbox <> { if {[string equal [selection own -displayof %W] "%W"]} { *************** *** 142,163 **** } } bind Listbox { ! tkListboxBeginSelect %W [%W index active] } bind Listbox { ! tk::ListboxBeginSelect %W [%W index active] } bind Listbox { ! tk::ListboxBeginExtend %W [%W index active] } bind Listbox { ! tk::ListboxBeginExtend %W [%W index active] } bind Listbox { ! tk::ListboxCancel %W } bind Listbox { ! tk::ListboxSelectAll %W } bind Listbox { if {[string compare [%W cget -selectmode] "browse"]} { *************** *** 200,206 **** } } ! # tkListboxBeginSelect -- # # This procedure is typically invoked on button-1 presses. It begins # the process of making a selection in the listbox. Its exact behavior --- 200,206 ---- } } ! # ::tk::ListboxBeginSelect -- # # This procedure is typically invoked on button-1 presses. It begins # the process of making a selection in the listbox. Its exact behavior *************** *** 212,219 **** # el - The element for the selection operation (typically the # one under the pointer). Must be in numerical form. ! proc tkListboxBeginSelect {w el} { ! global tkPriv if {[string equal [$w cget -selectmode] "multiple"]} { if {[$w selection includes $el]} { $w selection clear $el --- 212,219 ---- # el - The element for the selection operation (typically the # one under the pointer). Must be in numerical form. ! proc ::tk::ListboxBeginSelect {w el} { ! variable ::tk::Priv if {[string equal [$w cget -selectmode] "multiple"]} { if {[$w selection includes $el]} { $w selection clear $el *************** *** 224,236 **** $w selection clear 0 end $w selection set $el $w selection anchor $el ! set tkPriv(listboxSelection) {} ! set tkPriv(listboxPrev) $el } event generate $w <> } ! # tkListboxMotion -- # # This procedure is called to process mouse motion events while # button 1 is down. It may move or extend the selection, depending --- 224,236 ---- $w selection clear 0 end $w selection set $el $w selection anchor $el ! set Priv(listboxSelection) {} ! set Priv(listboxPrev) $el } event generate $w <> } ! # ::tk::ListboxMotion -- # # This procedure is called to process mouse motion events while # button 1 is down. It may move or extend the selection, depending *************** *** 240,248 **** # w - The listbox widget. # el - The element under the pointer (must be a number). ! proc tkListboxMotion {w el} { ! global tkPriv ! if {$el == $tkPriv(listboxPrev)} { return } set anchor [$w index anchor] --- 240,248 ---- # w - The listbox widget. # el - The element under the pointer (must be a number). ! proc ::tk::ListboxMotion {w el} { ! variable ::tk::Priv ! if {$el == $Priv(listboxPrev)} { return } set anchor [$w index anchor] *************** *** 250,260 **** browse { $w selection clear 0 end $w selection set $el ! set tkPriv(listboxPrev) $el event generate $w <> } extended { ! set i $tkPriv(listboxPrev) if {[string equal {} $i]} { set i $el $w selection set $el --- 250,260 ---- browse { $w selection clear 0 end $w selection set $el ! set Priv(listboxPrev) $el event generate $w <> } extended { ! set i $Priv(listboxPrev) if {[string equal {} $i]} { set i $el $w selection set $el *************** *** 266,293 **** $w selection clear $i $el $w selection clear anchor $el } ! if {![info exists tkPriv(listboxSelection)]} { ! set tkPriv(listboxSelection) [$w curselection] } while {($i < $el) && ($i < $anchor)} { ! if {[lsearch $tkPriv(listboxSelection) $i] >= 0} { $w selection set $i } incr i } while {($i > $el) && ($i > $anchor)} { ! if {[lsearch $tkPriv(listboxSelection) $i] >= 0} { $w selection set $i } incr i -1 } ! set tkPriv(listboxPrev) $el event generate $w <> } } } ! # tkListboxBeginExtend -- # # This procedure is typically invoked on shift-button-1 presses. It # begins the process of extending a selection in the listbox. Its --- 266,293 ---- $w selection clear $i $el $w selection clear anchor $el } ! if {![info exists Priv(listboxSelection)]} { ! set Priv(listboxSelection) [$w curselection] } while {($i < $el) && ($i < $anchor)} { ! if {[lsearch $Priv(listboxSelection) $i] >= 0} { $w selection set $i } incr i } while {($i > $el) && ($i > $anchor)} { ! if {[lsearch $Priv(listboxSelection) $i] >= 0} { $w selection set $i } incr i -1 } ! set Priv(listboxPrev) $el event generate $w <> } } } ! # ::tk::ListboxBeginExtend -- # # This procedure is typically invoked on shift-button-1 presses. It # begins the process of extending a selection in the listbox. Its *************** *** 299,316 **** # el - The element for the selection operation (typically the # one under the pointer). Must be in numerical form. ! proc tkListboxBeginExtend {w el} { if {[string equal [$w cget -selectmode] "extended"]} { if {[$w selection includes anchor]} { ! tkListboxMotion $w $el } else { # No selection yet; simulate the begin-select operation. ! tkListboxBeginSelect $w $el } } } ! # tkListboxBeginToggle -- # # This procedure is typically invoked on control-button-1 presses. It # begins the process of toggling a selection in the listbox. Its --- 299,316 ---- # el - The element for the selection operation (typically the # one under the pointer). Must be in numerical form. ! proc ::tk::ListboxBeginExtend {w el} { if {[string equal [$w cget -selectmode] "extended"]} { if {[$w selection includes anchor]} { ! ListboxMotion $w $el } else { # No selection yet; simulate the begin-select operation. ! ListboxBeginSelect $w $el } } } ! # ::tk::ListboxBeginToggle -- # # This procedure is typically invoked on control-button-1 presses. It # begins the process of toggling a selection in the listbox. Its *************** *** 322,332 **** # el - The element for the selection operation (typically the # one under the pointer). Must be in numerical form. ! proc tkListboxBeginToggle {w el} { ! global tkPriv if {[string equal [$w cget -selectmode] "extended"]} { ! set tkPriv(listboxSelection) [$w curselection] ! set tkPriv(listboxPrev) $el $w selection anchor $el if {[$w selection includes $el]} { $w selection clear $el --- 322,332 ---- # el - The element for the selection operation (typically the # one under the pointer). Must be in numerical form. ! proc ::tk::ListboxBeginToggle {w el} { ! variable ::tk::Priv if {[string equal [$w cget -selectmode] "extended"]} { ! set Priv(listboxSelection) [$w curselection] ! set Priv(listboxPrev) $el $w selection anchor $el if {[$w selection includes $el]} { $w selection clear $el *************** *** 337,343 **** } } ! # tkListboxAutoScan -- # This procedure is invoked when the mouse leaves an entry window # with button 1 down. It scrolls the window up, down, left, or # right, depending on where the mouse left the window, and reschedules --- 337,343 ---- } } ! # ::tk::ListboxAutoScan -- # This procedure is invoked when the mouse leaves an entry window # with button 1 down. It scrolls the window up, down, left, or # right, depending on where the mouse left the window, and reschedules *************** *** 347,357 **** # Arguments: # w - The entry window. ! proc tkListboxAutoScan {w} { ! global tkPriv if {![winfo exists $w]} return ! set x $tkPriv(x) ! set y $tkPriv(y) if {$y >= [winfo height $w]} { $w yview scroll 1 units } elseif {$y < 0} { --- 347,357 ---- # Arguments: # w - The entry window. ! proc ::tk::ListboxAutoScan {w} { ! variable ::tk::Priv if {![winfo exists $w]} return ! set x $Priv(x) ! set y $Priv(y) if {$y >= [winfo height $w]} { $w yview scroll 1 units } elseif {$y < 0} { *************** *** 363,373 **** } else { return } ! tkListboxMotion $w [$w index @$x,$y] ! set tkPriv(afterId) [after 50 [list tkListboxAutoScan $w]] } ! # tkListboxUpDown -- # # Moves the location cursor (active element) up or down by one element, # and changes the selection if we're in browse or extended selection --- 363,373 ---- } else { return } ! ListboxMotion $w [$w index @$x,$y] ! set Priv(afterId) [after 50 [list ListboxAutoScan $w]] } ! # ::tk::ListboxUpDown -- # # Moves the location cursor (active element) up or down by one element, # and changes the selection if we're in browse or extended selection *************** *** 377,384 **** # w - The listbox widget. # amount - +1 to move down one item, -1 to move back one item. ! proc tkListboxUpDown {w amount} { ! global tkPriv $w activate [expr {[$w index active] + $amount}] $w see active switch [$w cget -selectmode] { --- 377,384 ---- # w - The listbox widget. # amount - +1 to move down one item, -1 to move back one item. ! proc ::tk::ListboxUpDown {w amount} { ! variable ::tk::Priv $w activate [expr {[$w index active] + $amount}] $w see active switch [$w cget -selectmode] { *************** *** 391,404 **** $w selection clear 0 end $w selection set active $w selection anchor active ! set tkPriv(listboxPrev) [$w index active] ! set tkPriv(listboxSelection) {} event generate $w <> } } } ! # tkListboxExtendUpDown -- # # Does nothing unless we're in extended selection mode; in this # case it moves the location cursor (active element) up or down by --- 391,404 ---- $w selection clear 0 end $w selection set active $w selection anchor active ! set Priv(listboxPrev) [$w index active] ! set Priv(listboxSelection) {} event generate $w <> } } } ! # ::tk::ListboxExtendUpDown -- # # Does nothing unless we're in extended selection mode; in this # case it moves the location cursor (active element) up or down by *************** *** 408,429 **** # w - The listbox widget. # amount - +1 to move down one item, -1 to move back one item. ! proc tkListboxExtendUpDown {w amount} { if {[string compare [$w cget -selectmode] "extended"]} { return } set active [$w index active] ! if {![info exists tkPriv(listboxSelection)]} { ! global tkPriv $w selection set $active ! set tkPriv(listboxSelection) [$w curselection] } $w activate [expr {$active + $amount}] $w see active ! tkListboxMotion $w [$w index active] } ! # tkListboxDataExtend # # This procedure is called for key-presses such as Shift-KEndData. # If the selection mode isn't multiple or extend then it does nothing. --- 408,429 ---- # w - The listbox widget. # amount - +1 to move down one item, -1 to move back one item. ! proc ::tk::ListboxExtendUpDown {w amount} { ! variable ::tk::Priv if {[string compare [$w cget -selectmode] "extended"]} { return } set active [$w index active] ! if {![info exists Priv(listboxSelection)]} { $w selection set $active ! set Priv(listboxSelection) [$w curselection] } $w activate [expr {$active + $amount}] $w see active ! ListboxMotion $w [$w index active] } ! # ::tk::ListboxDataExtend # # This procedure is called for key-presses such as Shift-KEndData. # If the selection mode isn't multiple or extend then it does nothing. *************** *** 434,446 **** # w - The listbox widget. # el - An integer element number. ! proc tkListboxDataExtend {w el} { set mode [$w cget -selectmode] if {[string equal $mode "extended"]} { $w activate $el $w see $el if {[$w selection includes anchor]} { ! tkListboxMotion $w $el } } elseif {[string equal $mode "multiple"]} { $w activate $el --- 434,446 ---- # w - The listbox widget. # el - An integer element number. ! proc ::tk::ListboxDataExtend {w el} { set mode [$w cget -selectmode] if {[string equal $mode "extended"]} { $w activate $el $w see $el if {[$w selection includes anchor]} { ! ListboxMotion $w $el } } elseif {[string equal $mode "multiple"]} { $w activate $el *************** *** 448,454 **** } } ! # tkListboxCancel # # This procedure is invoked to cancel an extended selection in # progress. If there is an extended selection in progress, it --- 448,454 ---- } } ! # ::tk::ListboxCancel # # This procedure is invoked to cancel an extended selection in # progress. If there is an extended selection in progress, it *************** *** 458,470 **** # Arguments: # w - The listbox widget. ! proc tkListboxCancel w { ! global tkPriv if {[string compare [$w cget -selectmode] "extended"]} { return } set first [$w index anchor] ! set last $tkPriv(listboxPrev) if { [string equal $last ""] } { # Not actually doing any selection right now return --- 458,470 ---- # Arguments: # w - The listbox widget. ! proc ::tk::ListboxCancel w { ! variable ::tk::Priv if {[string compare [$w cget -selectmode] "extended"]} { return } set first [$w index anchor] ! set last $Priv(listboxPrev) if { [string equal $last ""] } { # Not actually doing any selection right now return *************** *** 476,482 **** } $w selection clear $first $last while {$first <= $last} { ! if {[lsearch $tkPriv(listboxSelection) $first] >= 0} { $w selection set $first } incr first --- 476,482 ---- } $w selection clear $first $last while {$first <= $last} { ! if {[lsearch $Priv(listboxSelection) $first] >= 0} { $w selection set $first } incr first *************** *** 484,490 **** event generate $w <> } ! # tkListboxSelectAll # # This procedure is invoked to handle the "select all" operation. # For single and browse mode, it just selects the active element. --- 484,490 ---- event generate $w <> } ! # ::tk::ListboxSelectAll # # This procedure is invoked to handle the "select all" operation. # For single and browse mode, it just selects the active element. *************** *** 493,499 **** # Arguments: # w - The listbox widget. ! proc tkListboxSelectAll w { set mode [$w cget -selectmode] if {[string equal $mode "single"] || [string equal $mode "browse"]} { $w selection clear 0 end --- 493,499 ---- # Arguments: # w - The listbox widget. ! proc ::tk::ListboxSelectAll w { set mode [$w cget -selectmode] if {[string equal $mode "single"] || [string equal $mode "browse"]} { $w selection clear 0 end Index: library/menu.tcl =================================================================== RCS file: /cvsroot/tk/library/menu.tcl,v retrieving revision 1.12 diff -c -r1.12 menu.tcl *** menu.tcl 2000/04/17 19:32:00 1.12 --- menu.tcl 2000/07/17 06:27:45 *************** *** 15,27 **** # #------------------------------------------------------------------------- ! # Elements of tkPriv that are used in this file: # # cursor - Saves the -cursor option for the posted menubutton. # focus - Saves the focus during a menu selection operation. # Focus gets restored here when the menu is unposted. ! # grabGlobal - Used in conjunction with tkPriv(oldGrab): if ! # tkPriv(oldGrab) is non-empty, then tkPriv(grabGlobal) # contains either an empty string or "-global" to # indicate whether the old grab was a local one or # a global one. --- 15,27 ---- # #------------------------------------------------------------------------- ! # Elements of tk::Priv that are used in this file: # # cursor - Saves the -cursor option for the posted menubutton. # focus - Saves the focus during a menu selection operation. # Focus gets restored here when the menu is unposted. ! # grabGlobal - Used in conjunction with tk::Priv(oldGrab): if ! # tk::Priv(oldGrab) is non-empty, then tk::Priv(grabGlobal) # contains either an empty string or "-global" to # indicate whether the old grab was a local one or # a global one. *************** *** 62,75 **** # can be used: # # 1. As a pulldown from a menubutton. In this style, the variable ! # tkPriv(postedMb) identifies the posted menubutton. # 2. As a torn-off menu copied from some other menu. In this style ! # tkPriv(postedMb) is empty, and menu's type is "tearoff". # 3. As an option menu, triggered from an option menubutton. In this ! # style tkPriv(postedMb) identifies the posted menubutton. ! # 4. As a popup menu. In this style tkPriv(postedMb) is empty and # the top-level menu's type is "normal". ! # 5. As a pulldown from a menubar. The variable tkPriv(menubar) has # the owning menubar, and the menu itself is of type "normal". # # The various binding procedures use the state described above to --- 62,75 ---- # can be used: # # 1. As a pulldown from a menubutton. In this style, the variable ! # tk::Priv(postedMb) identifies the posted menubutton. # 2. As a torn-off menu copied from some other menu. In this style ! # tk::Priv(postedMb) is empty, and menu's type is "tearoff". # 3. As an option menu, triggered from an option menubutton. In this ! # style tk::Priv(postedMb) identifies the posted menubutton. ! # 4. As a popup menu. In this style tk::Priv(postedMb) is empty and # the top-level menu's type is "normal". ! # 5. As a pulldown from a menubar. The variable tk::Priv(menubar) has # the owning menubar, and the menu itself is of type "normal". # # The various binding procedures use the state described above to *************** *** 84,111 **** bind Menubutton {} bind Menubutton { ! tkMbEnter %W } bind Menubutton { ! tkMbLeave %W } bind Menubutton <1> { ! if {[string compare $tkPriv(inMenubutton) ""]} { ! tkMbPost $tkPriv(inMenubutton) %X %Y } } bind Menubutton { ! tkMbMotion %W up %X %Y } bind Menubutton { ! tkMbMotion %W down %X %Y } bind Menubutton { ! tkMbButtonUp %W } bind Menubutton { ! tkMbPost %W ! tkMenuFirstEntry [%W cget -menu] } # Must set focus when mouse enters a menu, in order to allow --- 84,111 ---- bind Menubutton {} bind Menubutton { ! tk::MbEnter %W } bind Menubutton { ! tk::MbLeave %W } bind Menubutton <1> { ! if {[string compare $tk::Priv(inMenubutton) ""]} { ! tk::MbPost $tk::Priv(inMenubutton) %X %Y } } bind Menubutton { ! tk::MbMotion %W up %X %Y } bind Menubutton { ! tk::MbMotion %W down %X %Y } bind Menubutton { ! tk::MbButtonUp %W } bind Menubutton { ! tk::MbPost %W ! tk::MenuFirstEntry [%W cget -menu] } # Must set focus when mouse enters a menu, in order to allow *************** *** 118,124 **** bind Menu {} bind Menu { ! set tkPriv(window) %W if {[string equal [%W cget -type] "tearoff"]} { if {[string compare "%m" "NotifyUngrab"]} { if {[string equal $tcl_platform(platform) "unix"]} { --- 118,124 ---- bind Menu {} bind Menu { ! set tk::Priv(window) %W if {[string equal [%W cget -type] "tearoff"]} { if {[string compare "%m" "NotifyUngrab"]} { if {[string equal $tcl_platform(platform) "unix"]} { *************** *** 126,169 **** } } } ! tkMenuMotion %W %x %y %s } bind Menu { ! tkMenuLeave %W %X %Y %s } bind Menu { ! tkMenuMotion %W %x %y %s } bind Menu { ! tkMenuButtonDown %W } bind Menu { ! tkMenuInvoke %W 1 } bind Menu { ! tkMenuInvoke %W 0 } bind Menu { ! tkMenuInvoke %W 0 } bind Menu { ! tkMenuEscape %W } bind Menu { ! tkMenuLeftArrow %W } bind Menu { ! tkMenuRightArrow %W } bind Menu { ! tkMenuUpArrow %W } bind Menu { ! tkMenuDownArrow %W } bind Menu { ! tkTraverseWithinMenu %W %A } # The following bindings apply to all windows, and are used to --- 126,169 ---- } } } ! tk::MenuMotion %W %x %y %s } bind Menu { ! tk::MenuLeave %W %X %Y %s } bind Menu { ! tk::MenuMotion %W %x %y %s } bind Menu { ! tk::MenuButtonDown %W } bind Menu { ! tk::MenuInvoke %W 1 } bind Menu { ! tk::MenuInvoke %W 0 } bind Menu { ! tk::MenuInvoke %W 0 } bind Menu { ! tk::MenuEscape %W } bind Menu { ! tk::MenuLeftArrow %W } bind Menu { ! tk::MenuRightArrow %W } bind Menu { ! tk::MenuUpArrow %W } bind Menu { ! tk::MenuDownArrow %W } bind Menu { ! tk::TraverseWithinMenu %W %A } # The following bindings apply to all windows, and are used to *************** *** 171,224 **** if {[string equal $tcl_platform(platform) "unix"]} { bind all { ! tkTraverseToMenu %W %A } bind all { ! tkFirstMenu %W } } else { bind Menubutton { ! tkTraverseToMenu %W %A } bind Menubutton { ! tkFirstMenu %W } } ! # tkMbEnter -- # This procedure is invoked when the mouse enters a menubutton # widget. It activates the widget unless it is disabled. Note: # this procedure is only invoked when mouse button 1 is *not* down. ! # The procedure tkMbB1Enter is invoked if the button is down. # # Arguments: # w - The name of the widget. ! proc tkMbEnter w { ! global tkPriv ! if {[string compare $tkPriv(inMenubutton) ""]} { ! tkMbLeave $tkPriv(inMenubutton) } ! set tkPriv(inMenubutton) $w if {[string compare [$w cget -state] "disabled"]} { $w configure -state active } } ! # tkMbLeave -- # This procedure is invoked when the mouse leaves a menubutton widget. # It de-activates the widget, if the widget still exists. # # Arguments: # w - The name of the widget. ! proc tkMbLeave w { ! global tkPriv ! set tkPriv(inMenubutton) {} if {![winfo exists $w]} { return } --- 171,224 ---- if {[string equal $tcl_platform(platform) "unix"]} { bind all { ! tk::TraverseToMenu %W %A } bind all { ! tk::FirstMenu %W } } else { bind Menubutton { ! tk::TraverseToMenu %W %A } bind Menubutton { ! tk::FirstMenu %W } } ! # ::tk::MbEnter -- # This procedure is invoked when the mouse enters a menubutton # widget. It activates the widget unless it is disabled. Note: # this procedure is only invoked when mouse button 1 is *not* down. ! # The procedure ::tk::MbB1Enter is invoked if the button is down. # # Arguments: # w - The name of the widget. ! proc ::tk::MbEnter w { ! variable ::tk::Priv ! if {[string compare $Priv(inMenubutton) ""]} { ! MbLeave $Priv(inMenubutton) } ! set Priv(inMenubutton) $w if {[string compare [$w cget -state] "disabled"]} { $w configure -state active } } ! # ::tk::MbLeave -- # This procedure is invoked when the mouse leaves a menubutton widget. # It de-activates the widget, if the widget still exists. # # Arguments: # w - The name of the widget. ! proc ::tk::MbLeave w { ! variable ::tk::Priv ! set Priv(inMenubutton) {} if {![winfo exists $w]} { return } *************** *** 227,233 **** } } ! # tkMbPost -- # Given a menubutton, this procedure does all the work of posting # its associated menu and unposting any other menu that is currently # posted. --- 227,233 ---- } } ! # ::tk::MbPost -- # Given a menubutton, this procedure does all the work of posting # its associated menu and unposting any other menu that is currently # posted. *************** *** 239,250 **** # option menus. If not specified, then the center # of the menubutton is used for an option menu. ! proc tkMbPost {w {x {}} {y {}}} { ! global tkPriv errorInfo global tcl_platform if {[string equal [$w cget -state] "disabled"] || \ ! [string equal $w $tkPriv(postedMb)]} { return } set menu [$w cget -menu] --- 239,251 ---- # option menus. If not specified, then the center # of the menubutton is used for an option menu. ! proc ::tk::MbPost {w {x {}} {y {}}} { ! global errorInfo ! variable ::tk::Priv global tcl_platform if {[string equal [$w cget -state] "disabled"] || \ ! [string equal $w $Priv(postedMb)]} { return } set menu [$w cget -menu] *************** *** 256,274 **** if {[string first $w $menu] != 0} { error "can't post $menu: it isn't a descendant of $w (this is a new requirement in Tk versions 3.0 and later)" } ! set cur $tkPriv(postedMb) if {[string compare $cur ""]} { ! tkMenuUnpost {} } ! set tkPriv(cursor) [$w cget -cursor] ! set tkPriv(relief) [$w cget -relief] $w configure -cursor arrow $w configure -relief raised ! set tkPriv(postedMb) $w ! set tkPriv(focus) [focus] $menu activate none ! tkGenerateMenuSelect $menu # If this looks like an option menubutton then post the menu so # that the current entry is on top of the mouse. Otherwise post --- 257,275 ---- if {[string first $w $menu] != 0} { error "can't post $menu: it isn't a descendant of $w (this is a new requirement in Tk versions 3.0 and later)" } ! set cur $Priv(postedMb) if {[string compare $cur ""]} { ! MenuUnpost {} } ! set Priv(cursor) [$w cget -cursor] ! set Priv(relief) [$w cget -relief] $w configure -cursor arrow $w configure -relief raised ! set Priv(postedMb) $w ! set Priv(focus) [focus] $menu activate none ! GenerateMenuSelect $menu # If this looks like an option menubutton then post the menu so # that the current entry is on top of the mouse. Otherwise post *************** *** 290,296 **** left { set x [expr {[winfo rootx $w] - [winfo reqwidth $menu]}] set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}] ! set entry [tkMenuFindName $menu [$w cget -text]] if {[$w cget -indicatoron]} { if {$entry == [$menu index last]} { incr y [expr {-([$menu yposition $entry] \ --- 291,297 ---- left { set x [expr {[winfo rootx $w] - [winfo reqwidth $menu]}] set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}] ! set entry [MenuFindName $menu [$w cget -text]] if {[$w cget -indicatoron]} { if {$entry == [$menu index last]} { incr y [expr {-([$menu yposition $entry] \ *************** *** 303,315 **** $menu post $x $y if {[string compare $entry {}] && [string compare [$menu entrycget $entry -state] "disabled"]} { $menu activate $entry ! tkGenerateMenuSelect $menu } } right { set x [expr {[winfo rootx $w] + [winfo width $w]}] set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}] ! set entry [tkMenuFindName $menu [$w cget -text]] if {[$w cget -indicatoron]} { if {$entry == [$menu index last]} { incr y [expr {-([$menu yposition $entry] \ --- 304,316 ---- $menu post $x $y if {[string compare $entry {}] && [string compare [$menu entrycget $entry -state] "disabled"]} { $menu activate $entry ! GenerateMenuSelect $menu } } right { set x [expr {[winfo rootx $w] + [winfo width $w]}] set y [expr {(2 * [winfo rooty $w] + [winfo height $w]) / 2}] ! set entry [MenuFindName $menu [$w cget -text]] if {[$w cget -indicatoron]} { if {$entry == [$menu index last]} { incr y [expr {-([$menu yposition $entry] \ *************** *** 322,328 **** $menu post $x $y if {[string compare $entry {}] && [string compare [$menu entrycget $entry -state] "disabled"]} { $menu activate $entry ! tkGenerateMenuSelect $menu } } default { --- 323,329 ---- $menu post $x $y if {[string compare $entry {}] && [string compare [$menu entrycget $entry -state] "disabled"]} { $menu activate $entry ! GenerateMenuSelect $menu } } default { *************** *** 331,337 **** set x [expr {[winfo rootx $w] + [winfo width $w]/2}] set y [expr {[winfo rooty $w] + [winfo height $w]/2}] } ! tkPostOverPoint $menu $x $y [tkMenuFindName $menu [$w cget -text]] } else { $menu post [winfo rootx $w] [expr {[winfo rooty $w]+[winfo height $w]}] } --- 332,338 ---- set x [expr {[winfo rootx $w] + [winfo width $w]/2}] set y [expr {[winfo rooty $w] + [winfo height $w]/2}] } ! PostOverPoint $menu $x $y [MenuFindName $menu [$w cget -text]] } else { $menu post [winfo rootx $w] [expr {[winfo rooty $w]+[winfo height $w]}] } *************** *** 342,363 **** # reflect the error. set savedInfo $errorInfo ! tkMenuUnpost {} error $msg $savedInfo } ! set tkPriv(tearoff) $tearoff if {$tearoff != 0} { focus $menu if {[winfo viewable $w]} { ! tkSaveGrabInfo $w grab -global $w } } } ! # tkMenuUnpost -- # This procedure unposts a given menu, plus all of its ancestors up # to (and including) a menubutton, if any. It also restores various # values to what they were before the menu was posted, and releases --- 343,364 ---- # reflect the error. set savedInfo $errorInfo ! MenuUnpost {} error $msg $savedInfo } ! set Priv(tearoff) $tearoff if {$tearoff != 0} { focus $menu if {[winfo viewable $w]} { ! SaveGrabInfo $w grab -global $w } } } ! # ::tk::MenuUnpost -- # This procedure unposts a given menu, plus all of its ancestors up # to (and including) a menubutton, if any. It also restores various # values to what they were before the menu was posted, and releases *************** *** 373,389 **** # menu - Name of a menu to unpost. Ignored if there # is a posted menubutton. ! proc tkMenuUnpost menu { global tcl_platform ! global tkPriv ! set mb $tkPriv(postedMb) # Restore focus right away (otherwise X will take focus away when # the menu is unmapped and under some window managers (e.g. olvwm) # we'll lose the focus completely). ! catch {focus $tkPriv(focus)} ! set tkPriv(focus) "" # Unpost menu(s) and restore some stuff that's dependent on # what was posted. --- 374,390 ---- # menu - Name of a menu to unpost. Ignored if there # is a posted menubutton. ! proc ::tk::MenuUnpost menu { global tcl_platform ! variable ::tk::Priv ! set mb $Priv(postedMb) # Restore focus right away (otherwise X will take focus away when # the menu is unmapped and under some window managers (e.g. olvwm) # we'll lose the focus completely). ! catch {focus $Priv(focus)} ! set Priv(focus) "" # Unpost menu(s) and restore some stuff that's dependent on # what was posted. *************** *** 392,403 **** if {[string compare $mb ""]} { set menu [$mb cget -menu] $menu unpost ! set tkPriv(postedMb) {} ! $mb configure -cursor $tkPriv(cursor) ! $mb configure -relief $tkPriv(relief) ! } elseif {[string compare $tkPriv(popup) ""]} { ! $tkPriv(popup) unpost ! set tkPriv(popup) {} } elseif {[string compare [$menu cget -type] "menubar"] \ && [string compare [$menu cget -type] "tearoff"]} { # We're in a cascaded sub-menu from a torn-off menu or popup. --- 393,404 ---- if {[string compare $mb ""]} { set menu [$mb cget -menu] $menu unpost ! set Priv(postedMb) {} ! $mb configure -cursor $Priv(cursor) ! $mb configure -relief $Priv(relief) ! } elseif {[string compare $Priv(popup) ""]} { ! $Priv(popup) unpost ! set Priv(popup) {} } elseif {[string compare [$menu cget -type] "menubar"] \ && [string compare [$menu cget -type] "tearoff"]} { # We're in a cascaded sub-menu from a torn-off menu or popup. *************** *** 413,419 **** } $parent activate none $parent postcascade none ! tkGenerateMenuSelect $parent set type [$parent cget -type] if {[string equal $type "menubar"] || \ [string equal $type "tearoff"]} { --- 414,420 ---- } $parent activate none $parent postcascade none ! GenerateMenuSelect $parent set type [$parent cget -type] if {[string equal $type "menubar"] || \ [string equal $type "tearoff"]} { *************** *** 427,433 **** } } ! if {($tkPriv(tearoff) != 0) || [string compare $tkPriv(menuBar) ""]} { # Release grab, if any, and restore the previous grab, if there # was one. if {[string compare $menu ""]} { --- 428,434 ---- } } ! if {($Priv(tearoff) != 0) || [string compare $Priv(menuBar) ""]} { # Release grab, if any, and restore the previous grab, if there # was one. if {[string compare $menu ""]} { *************** *** 436,453 **** grab release $grab } } ! tkRestoreOldGrab ! if {[string compare $tkPriv(menuBar) ""]} { ! $tkPriv(menuBar) configure -cursor $tkPriv(cursor) ! set tkPriv(menuBar) {} } if {[string compare $tcl_platform(platform) "unix"]} { ! set tkPriv(tearoff) 0 } } } ! # tkMbMotion -- # This procedure handles mouse motion events inside menubuttons, and # also outside menubuttons when a menubutton has a grab (e.g. when a # menu selection operation is in progress). --- 437,454 ---- grab release $grab } } ! RestoreOldGrab ! if {[string compare $Priv(menuBar) ""]} { ! $Priv(menuBar) configure -cursor $Priv(cursor) ! set Priv(menuBar) {} } if {[string compare $tcl_platform(platform) "unix"]} { ! set Priv(tearoff) 0 } } } ! # ::tk::MbMotion -- # This procedure handles mouse motion events inside menubuttons, and # also outside menubuttons when a menubutton has a grab (e.g. when a # menu selection operation is in progress). *************** *** 458,490 **** # it isn't. # rootx, rooty - Coordinates of mouse, in (virtual?) root window. ! proc tkMbMotion {w upDown rootx rooty} { ! global tkPriv ! if {[string equal $tkPriv(inMenubutton) $w]} { return } set new [winfo containing $rootx $rooty] ! if {[string compare $new $tkPriv(inMenubutton)] \ && ([string equal $new ""] \ || [string equal [winfo toplevel $new] [winfo toplevel $w]])} { ! if {[string compare $tkPriv(inMenubutton) ""]} { ! tkMbLeave $tkPriv(inMenubutton) } if {[string compare $new ""] \ && [string equal [winfo class $new] "Menubutton"] \ && ([$new cget -indicatoron] == 0) \ && ([$w cget -indicatoron] == 0)} { if {[string equal $upDown "down"]} { ! tkMbPost $new $rootx $rooty } else { ! tkMbEnter $new } } } } ! # tkMbButtonUp -- # This procedure is invoked to handle button 1 releases for menubuttons. # If the release happens inside the menubutton then leave its menu # posted with element 0 activated. Otherwise, unpost the menu. --- 459,491 ---- # it isn't. # rootx, rooty - Coordinates of mouse, in (virtual?) root window. ! proc ::tk::MbMotion {w upDown rootx rooty} { ! variable ::tk::Priv ! if {[string equal $Priv(inMenubutton) $w]} { return } set new [winfo containing $rootx $rooty] ! if {[string compare $new $Priv(inMenubutton)] \ && ([string equal $new ""] \ || [string equal [winfo toplevel $new] [winfo toplevel $w]])} { ! if {[string compare $Priv(inMenubutton) ""]} { ! MbLeave $Priv(inMenubutton) } if {[string compare $new ""] \ && [string equal [winfo class $new] "Menubutton"] \ && ([$new cget -indicatoron] == 0) \ && ([$w cget -indicatoron] == 0)} { if {[string equal $upDown "down"]} { ! MbPost $new $rootx $rooty } else { ! MbEnter $new } } } } ! # ::tk::MbButtonUp -- # This procedure is invoked to handle button 1 releases for menubuttons. # If the release happens inside the menubutton then leave its menu # posted with element 0 activated. Otherwise, unpost the menu. *************** *** 492,514 **** # Arguments: # w - The name of the menubutton widget. ! proc tkMbButtonUp w { ! global tkPriv global tcl_platform set menu [$w cget -menu] set tearoff [expr {[string equal $tcl_platform(platform) "unix"] || \ ([string compare $menu {}] && \ [string equal [$menu cget -type] "tearoff"])}] ! if {($tearoff != 0) && [string equal $tkPriv(postedMb) $w] \ ! && [string equal $tkPriv(inMenubutton) $w]} { ! tkMenuFirstEntry [$tkPriv(postedMb) cget -menu] } else { ! tkMenuUnpost {} } } ! # tkMenuMotion -- # This procedure is called to handle mouse motion events for menus. # It does two things. First, it resets the active element in the # menu, if the mouse is over the menu. Second, if a mouse button --- 493,515 ---- # Arguments: # w - The name of the menubutton widget. ! proc ::tk::MbButtonUp w { ! variable ::tk::Priv global tcl_platform set menu [$w cget -menu] set tearoff [expr {[string equal $tcl_platform(platform) "unix"] || \ ([string compare $menu {}] && \ [string equal [$menu cget -type] "tearoff"])}] ! if {($tearoff != 0) && [string equal $Priv(postedMb) $w] \ ! && [string equal $Priv(inMenubutton) $w]} { ! MenuFirstEntry [$Priv(postedMb) cget -menu] } else { ! MenuUnpost {} } } ! # ::tk::MenuMotion -- # This procedure is called to handle mouse motion events for menus. # It does two things. First, it resets the active element in the # menu, if the mouse is over the menu. Second, if a mouse button *************** *** 521,538 **** # y - The y position of the mouse. # state - Modifier state (tells whether buttons are down). ! proc tkMenuMotion {menu x y state} { ! global tkPriv ! if {[string equal $menu $tkPriv(window)]} { if {[string equal [$menu cget -type] "menubar"]} { ! if {[info exists tkPriv(focus)] && \ ! [string compare $menu $tkPriv(focus)]} { $menu activate @$x,$y ! tkGenerateMenuSelect $menu } } else { $menu activate @$x,$y ! tkGenerateMenuSelect $menu } } if {($state & 0x1f00) != 0} { --- 522,539 ---- # y - The y position of the mouse. # state - Modifier state (tells whether buttons are down). ! proc ::tk::MenuMotion {menu x y state} { ! variable ::tk::Priv ! if {[string equal $menu $Priv(window)]} { if {[string equal [$menu cget -type] "menubar"]} { ! if {[info exists Priv(focus)] && \ ! [string compare $menu $Priv(focus)]} { $menu activate @$x,$y ! GenerateMenuSelect $menu } } else { $menu activate @$x,$y ! GenerateMenuSelect $menu } } if {($state & 0x1f00) != 0} { *************** *** 540,546 **** } } ! # tkMenuButtonDown -- # Handles button presses in menus. There are a couple of tricky things # here: # 1. Change the posted cascade entry (if any) to match the mouse position. --- 541,547 ---- } } ! # ::tk::MenuButtonDown -- # Handles button presses in menus. There are a couple of tricky things # here: # 1. Change the posted cascade entry (if any) to match the mouse position. *************** *** 555,571 **** # Arguments: # menu - The menu window. ! proc tkMenuButtonDown menu { ! global tkPriv global tcl_platform if {![winfo viewable $menu]} { return } $menu postcascade active ! if {[string compare $tkPriv(postedMb) ""] && \ ! [winfo viewable $tkPriv(postedMb)]} { ! grab -global $tkPriv(postedMb) } else { while {[string equal [$menu cget -type] "normal"] \ && [string equal [winfo class [winfo parent $menu]] "Menu"] \ --- 556,572 ---- # Arguments: # menu - The menu window. ! proc ::tk::MenuButtonDown menu { ! variable ::tk::Priv global tcl_platform if {![winfo viewable $menu]} { return } $menu postcascade active ! if {[string compare $Priv(postedMb) ""] && \ ! [winfo viewable $Priv(postedMb)]} { ! grab -global $Priv(postedMb) } else { while {[string equal [$menu cget -type] "normal"] \ && [string equal [winfo class [winfo parent $menu]] "Menu"] \ *************** *** 573,581 **** set menu [winfo parent $menu] } ! if {[string equal $tkPriv(menuBar) {}]} { ! set tkPriv(menuBar) $menu ! set tkPriv(cursor) [$menu cget -cursor] $menu configure -cursor arrow } --- 574,582 ---- set menu [winfo parent $menu] } ! if {[string equal $Priv(menuBar) {}]} { ! set Priv(menuBar) $menu ! set Priv(cursor) [$menu cget -cursor] $menu configure -cursor arrow } *************** *** 585,591 **** # anymore. if {[string compare $menu [grab current $menu]]} { ! tkSaveGrabInfo $menu } # Must re-grab even if the grab window hasn't changed, in order --- 586,592 ---- # anymore. if {[string compare $menu [grab current $menu]]} { ! SaveGrabInfo $menu } # Must re-grab even if the grab window hasn't changed, in order *************** *** 597,603 **** } } ! # tkMenuLeave -- # This procedure is invoked to handle Leave events for a menu. It # deactivates everything unless the active element is a cascade element # and the mouse is now over the submenu. --- 598,604 ---- } } ! # ::tk::MenuLeave -- # This procedure is invoked to handle Leave events for a menu. It # deactivates everything unless the active element is a cascade element # and the mouse is now over the submenu. *************** *** 607,615 **** # rootx, rooty - Root coordinates of mouse. # state - Modifier state. ! proc tkMenuLeave {menu rootx rooty state} { ! global tkPriv ! set tkPriv(window) {} if {[string equal [$menu index active] "none"]} { return } --- 608,616 ---- # rootx, rooty - Root coordinates of mouse. # state - Modifier state. ! proc ::tk::MenuLeave {menu rootx rooty state} { ! variable ::tk::Priv ! set Priv(window) {} if {[string equal [$menu index active] "none"]} { return } *************** *** 619,628 **** return } $menu activate none ! tkGenerateMenuSelect $menu } ! # tkMenuInvoke -- # This procedure is invoked when button 1 is released over a menu. # It invokes the appropriate menu action and unposts the menu if # it came from a menubutton. --- 620,629 ---- return } $menu activate none ! GenerateMenuSelect $menu } ! # ::tk::MenuInvoke -- # This procedure is invoked when button 1 is released over a menu. # It invokes the appropriate menu action and unposts the menu if # it came from a menubutton. *************** *** 632,641 **** # buttonRelease - 1 means this procedure is called because of # a button release; 0 means because of keystroke. ! proc tkMenuInvoke {w buttonRelease} { ! global tkPriv ! if {$buttonRelease && [string equal $tkPriv(window) {}]} { # Mouse was pressed over a menu without a menu button, then # dragged off the menu (possibly with a cascade posted) and # released. Unpost everything and quit. --- 633,642 ---- # buttonRelease - 1 means this procedure is called because of # a button release; 0 means because of keystroke. ! proc ::tk::MenuInvoke {w buttonRelease} { ! variable ::tk::Priv ! if {$buttonRelease && [string equal $Priv(window) {}]} { # Mouse was pressed over a menu without a menu button, then # dragged off the menu (possibly with a cascade posted) and # released. Unpost everything and quit. *************** *** 643,658 **** $w postcascade none $w activate none event generate $w <> ! tkMenuUnpost $w return } if {[string equal [$w type active] "cascade"]} { $w postcascade active set menu [$w entrycget active -menu] ! tkMenuFirstEntry $menu } elseif {[string equal [$w type active] "tearoff"]} { ! tkTearOffMenu $w ! tkMenuUnpost $w } elseif {[string equal [$w cget -type] "menubar"]} { $w postcascade none set active [$w index active] --- 644,659 ---- $w postcascade none $w activate none event generate $w <> ! MenuUnpost $w return } if {[string equal [$w type active] "cascade"]} { $w postcascade active set menu [$w entrycget active -menu] ! MenuFirstEntry $menu } elseif {[string equal [$w type active] "tearoff"]} { ! ::tk::TearOffMenu $w ! MenuUnpost $w } elseif {[string equal [$w cget -type] "menubar"]} { $w postcascade none set active [$w index active] *************** *** 667,673 **** event generate $w <> } ! tkMenuUnpost $w # If the active item is not a cascade, invoke it. This enables # the use of checkbuttons/commands/etc. on menubars (which is legal, --- 668,674 ---- event generate $w <> } ! MenuUnpost $w # If the active item is not a cascade, invoke it. This enables # the use of checkbuttons/commands/etc. on menubars (which is legal, *************** *** 677,688 **** uplevel #0 [list $w invoke $active] } } else { ! tkMenuUnpost $w uplevel #0 [list $w invoke active] } } ! # tkMenuEscape -- # This procedure is invoked for the Cancel (or Escape) key. It unposts # the given menu and, if it is the top-level menu for a menu button, # unposts the menu button as well. --- 678,689 ---- uplevel #0 [list $w invoke $active] } } else { ! MenuUnpost $w uplevel #0 [list $w invoke active] } } ! # ::tk::MenuEscape -- # This procedure is invoked for the Cancel (or Escape) key. It unposts # the given menu and, if it is the top-level menu for a menu button, # unposts the menu button as well. *************** *** 690,743 **** # Arguments: # menu - Name of the menu window. ! proc tkMenuEscape menu { set parent [winfo parent $menu] if {[string compare [winfo class $parent] "Menu"]} { ! tkMenuUnpost $menu } elseif {[string equal [$parent cget -type] "menubar"]} { ! tkMenuUnpost $menu ! tkRestoreOldGrab } else { ! tkMenuNextMenu $menu left } } # The following routines handle arrow keys. Arrow keys behave # differently depending on whether the menu is a menu bar or not. ! proc tkMenuUpArrow {menu} { if {[string equal [$menu cget -type] "menubar"]} { ! tkMenuNextMenu $menu left } else { ! tkMenuNextEntry $menu -1 } } ! proc tkMenuDownArrow {menu} { if {[string equal [$menu cget -type] "menubar"]} { ! tkMenuNextMenu $menu right } else { ! tkMenuNextEntry $menu 1 } } ! proc tkMenuLeftArrow {menu} { if {[string equal [$menu cget -type] "menubar"]} { ! tkMenuNextEntry $menu -1 } else { ! tkMenuNextMenu $menu left } } ! proc tkMenuRightArrow {menu} { if {[string equal [$menu cget -type] "menubar"]} { ! tkMenuNextEntry $menu 1 } else { ! tkMenuNextMenu $menu right } } ! # tkMenuNextMenu -- # This procedure is invoked to handle "left" and "right" traversal # motions in menus. It traverses to the next menu in a menu bar, # or into or out of a cascaded menu. --- 691,744 ---- # Arguments: # menu - Name of the menu window. ! proc ::tk::MenuEscape menu { set parent [winfo parent $menu] if {[string compare [winfo class $parent] "Menu"]} { ! MenuUnpost $menu } elseif {[string equal [$parent cget -type] "menubar"]} { ! MenuUnpost $menu ! RestoreOldGrab } else { ! MenuNextMenu $menu left } } # The following routines handle arrow keys. Arrow keys behave # differently depending on whether the menu is a menu bar or not. ! proc ::tk::MenuUpArrow {menu} { if {[string equal [$menu cget -type] "menubar"]} { ! MenuNextMenu $menu left } else { ! MenuNextEntry $menu -1 } } ! proc ::tk::MenuDownArrow {menu} { if {[string equal [$menu cget -type] "menubar"]} { ! MenuNextMenu $menu right } else { ! MenuNextEntry $menu 1 } } ! proc ::tk::MenuLeftArrow {menu} { if {[string equal [$menu cget -type] "menubar"]} { ! MenuNextEntry $menu -1 } else { ! MenuNextMenu $menu left } } ! proc ::tk::MenuRightArrow {menu} { if {[string equal [$menu cget -type] "menubar"]} { ! MenuNextEntry $menu 1 } else { ! MenuNextMenu $menu right } } ! # ::tk::MenuNextMenu -- # This procedure is invoked to handle "left" and "right" traversal # motions in menus. It traverses to the next menu in a menu bar, # or into or out of a cascaded menu. *************** *** 747,754 **** # event. # direction - Direction in which to move: "left" or "right" ! proc tkMenuNextMenu {menu direction} { ! global tkPriv # First handle traversals into and out of cascaded menus. --- 748,755 ---- # event. # direction - Direction in which to move: "left" or "right" ! proc ::tk::MenuNextMenu {menu direction} { ! variable ::tk::Priv # First handle traversals into and out of cascaded menus. *************** *** 760,766 **** $menu postcascade active set m2 [$menu entrycget active -menu] if {[string compare $m2 ""]} { ! tkMenuFirstEntry $m2 } return } else { --- 761,767 ---- $menu postcascade active set m2 [$menu entrycget active -menu] if {[string compare $m2 ""]} { ! MenuFirstEntry $m2 } return } else { *************** *** 769,775 **** if {[string equal [winfo class $parent] "Menu"] \ && [string equal [$parent cget -type] "menubar"]} { tk_menuSetFocus $parent ! tkMenuNextEntry $parent 1 return } set parent [winfo parent $parent] --- 770,776 ---- if {[string equal [winfo class $parent] "Menu"] \ && [string equal [$parent cget -type] "menubar"]} { tk_menuSetFocus $parent ! MenuNextEntry $parent 1 return } set parent [winfo parent $parent] *************** *** 781,787 **** if {[string equal [winfo class $m2] "Menu"]} { if {[string compare [$m2 cget -type] "menubar"]} { $menu activate none ! tkGenerateMenuSelect $menu tk_menuSetFocus $m2 # This code unposts any posted submenu in the parent. --- 782,788 ---- if {[string equal [winfo class $m2] "Menu"]} { if {[string compare [$m2 cget -type] "menubar"]} { $menu activate none ! GenerateMenuSelect $menu tk_menuSetFocus $m2 # This code unposts any posted submenu in the parent. *************** *** 801,812 **** if {[string equal [winfo class $m2] "Menu"]} { if {[string equal [$m2 cget -type] "menubar"]} { tk_menuSetFocus $m2 ! tkMenuNextEntry $m2 -1 return } } ! set w $tkPriv(postedMb) if {[string equal $w ""]} { return } --- 802,813 ---- if {[string equal [winfo class $m2] "Menu"]} { if {[string equal [$m2 cget -type] "menubar"]} { tk_menuSetFocus $m2 ! MenuNextEntry $m2 -1 return } } ! set w $Priv(postedMb) if {[string equal $w ""]} { return } *************** *** 832,842 **** } incr i $count } ! tkMbPost $mb ! tkMenuFirstEntry [$mb cget -menu] } ! # tkMenuNextEntry -- # Activate the next higher or lower entry in the posted menu, # wrapping around at the ends. Disabled entries are skipped. # --- 833,843 ---- } incr i $count } ! MbPost $mb ! MenuFirstEntry [$mb cget -menu] } ! # ::tk::MenuNextEntry -- # Activate the next higher or lower entry in the posted menu, # wrapping around at the ends. Disabled entries are skipped. # *************** *** 845,852 **** # count - 1 means go to the next lower entry, # -1 means go to the next higher entry. ! proc tkMenuNextEntry {menu count} { ! global tkPriv if {[string equal [$menu index last] "none"]} { return --- 846,852 ---- # count - 1 means go to the next lower entry, # -1 means go to the next higher entry. ! proc ::tk::MenuNextEntry {menu count} { if {[string equal [$menu index last] "none"]} { return *************** *** 884,890 **** incr quitAfter -1 } $menu activate $i ! tkGenerateMenuSelect $menu if {[string equal [$menu type $i] "cascade"]} { set cascade [$menu entrycget $i -menu] if {[string compare $cascade ""]} { --- 884,890 ---- incr quitAfter -1 } $menu activate $i ! GenerateMenuSelect $menu if {[string equal [$menu type $i] "cascade"]} { set cascade [$menu entrycget $i -menu] if {[string compare $cascade ""]} { *************** *** 892,903 **** # we traverse left/right in the menubar, but undesirable when # we traverse up/down in a menu. $menu postcascade $i ! tkMenuFirstEntry $cascade } } } ! # tkMenuFind -- # This procedure searches the entire window hierarchy under w for # a menubutton that isn't disabled and whose underlined character # is "char" or an entry in a menubar that isn't disabled and whose --- 892,903 ---- # we traverse left/right in the menubar, but undesirable when # we traverse up/down in a menu. $menu postcascade $i ! MenuFirstEntry $cascade } } } ! # ::tk::MenuFind -- # This procedure searches the entire window hierarchy under w for # a menubutton that isn't disabled and whose underlined character # is "char" or an entry in a menubar that isn't disabled and whose *************** *** 913,920 **** # may be either upper or lower case, and # will match either upper or lower case. ! proc tkMenuFind {w char} { ! global tkPriv set char [string tolower $char] set windowlist [winfo child $w] --- 913,919 ---- # may be either upper or lower case, and # will match either upper or lower case. ! proc ::tk::MenuFind {w char} { set char [string tolower $char] set windowlist [winfo child $w] *************** *** 965,971 **** } default { ! set match [tkMenuFind $child $char] if {[string compare $match ""]} { return $match } --- 964,970 ---- } default { ! set match [MenuFind $child $char] if {[string compare $match ""]} { return $match } *************** *** 975,981 **** return {} } ! # tkTraverseToMenu -- # This procedure implements keyboard traversal of menus. Given an # ASCII character "char", it looks for a menubutton with that character # underlined. If one is found, it posts the menubutton's menu --- 974,980 ---- return {} } ! # ::tk::TraverseToMenu -- # This procedure implements keyboard traversal of menus. Given an # ASCII character "char", it looks for a menubutton with that character # underlined. If one is found, it posts the menubutton's menu *************** *** 987,1000 **** # is ignored. If an empty string, nothing # happens. ! proc tkTraverseToMenu {w char} { ! global tkPriv if {[string equal $char ""]} { return } while {[string equal [winfo class $w] "Menu"]} { if {[string compare [$w cget -type] "menubar"] \ ! && [string equal $tkPriv(postedMb) ""]} { return } if {[string equal [$w cget -type] "menubar"]} { --- 986,999 ---- # is ignored. If an empty string, nothing # happens. ! proc ::tk::TraverseToMenu {w char} { ! variable ::tk::Priv if {[string equal $char ""]} { return } while {[string equal [winfo class $w] "Menu"]} { if {[string compare [$w cget -type] "menubar"] \ ! && [string equal $Priv(postedMb) ""]} { return } if {[string equal [$w cget -type] "menubar"]} { *************** *** 1002,1023 **** } set w [winfo parent $w] } ! set w [tkMenuFind [winfo toplevel $w] $char] if {[string compare $w ""]} { if {[string equal [winfo class $w] "Menu"]} { tk_menuSetFocus $w ! set tkPriv(window) $w ! tkSaveGrabInfo $w grab -global $w ! tkTraverseWithinMenu $w $char } else { ! tkMbPost $w ! tkMenuFirstEntry [$w cget -menu] } } } ! # tkFirstMenu -- # This procedure traverses to the first menubutton in the toplevel # for a given window, and posts that menubutton's menu. # --- 1001,1022 ---- } set w [winfo parent $w] } ! set w [MenuFind [winfo toplevel $w] $char] if {[string compare $w ""]} { if {[string equal [winfo class $w] "Menu"]} { tk_menuSetFocus $w ! set Priv(window) $w ! SaveGrabInfo $w grab -global $w ! TraverseWithinMenu $w $char } else { ! MbPost $w ! MenuFirstEntry [$w cget -menu] } } } ! # ::tk::FirstMenu -- # This procedure traverses to the first menubutton in the toplevel # for a given window, and posts that menubutton's menu. # *************** *** 1025,1047 **** # w - Name of a window. Selects which toplevel # to search for menubuttons. ! proc tkFirstMenu w { ! set w [tkMenuFind [winfo toplevel $w] ""] if {[string compare $w ""]} { if {[string equal [winfo class $w] "Menu"]} { tk_menuSetFocus $w ! set tkPriv(window) $w ! tkSaveGrabInfo $w grab -global $w ! tkMenuFirstEntry $w } else { ! tkMbPost $w ! tkMenuFirstEntry [$w cget -menu] } } } ! # tkTraverseWithinMenu # This procedure implements keyboard traversal within a menu. It # searches for an entry in the menu that has "char" underlined. If # such an entry is found, it is invoked and the menu is unposted. --- 1024,1047 ---- # w - Name of a window. Selects which toplevel # to search for menubuttons. ! proc ::tk::FirstMenu w { ! variable ::tk::Priv ! set w [MenuFind [winfo toplevel $w] ""] if {[string compare $w ""]} { if {[string equal [winfo class $w] "Menu"]} { tk_menuSetFocus $w ! set Priv(window) $w ! SaveGrabInfo $w grab -global $w ! MenuFirstEntry $w } else { ! MbPost $w ! MenuFirstEntry [$w cget -menu] } } } ! # ::tk::TraverseWithinMenu # This procedure implements keyboard traversal within a menu. It # searches for an entry in the menu that has "char" underlined. If # such an entry is found, it is invoked and the menu is unposted. *************** *** 1052,1058 **** # ignored. If the string is empty then # nothing happens. ! proc tkTraverseWithinMenu {w char} { if {[string equal $char ""]} { return } --- 1052,1058 ---- # ignored. If the string is empty then # nothing happens. ! proc ::tk::TraverseWithinMenu {w char} { if {[string equal $char ""]} { return } *************** *** 1073,1082 **** event generate $w <> set m2 [$w entrycget $i -menu] if {[string compare $m2 ""]} { ! tkMenuFirstEntry $m2 } } else { ! tkMenuUnpost $w uplevel #0 [list $w invoke $i] } return --- 1073,1082 ---- event generate $w <> set m2 [$w entrycget $i -menu] if {[string compare $m2 ""]} { ! MenuFirstEntry $m2 } } else { ! MenuUnpost $w uplevel #0 [list $w invoke $i] } return *************** *** 1084,1101 **** } } ! # tkMenuFirstEntry -- # Given a menu, this procedure finds the first entry that isn't # disabled or a tear-off or separator, and activates that entry. # However, if there is already an active entry in the menu (e.g., ! # because of a previous call to tkPostOverPoint) then the active # entry isn't changed. This procedure also sets the input focus # to the menu. # # Arguments: # menu - Name of the menu window (possibly empty). ! proc tkMenuFirstEntry menu { if {[string equal $menu ""]} { return } --- 1084,1101 ---- } } ! # ::tk::MenuFirstEntry -- # Given a menu, this procedure finds the first entry that isn't # disabled or a tear-off or separator, and activates that entry. # However, if there is already an active entry in the menu (e.g., ! # because of a previous call to tk::PostOverPoint) then the active # entry isn't changed. This procedure also sets the input focus # to the menu. # # Arguments: # menu - Name of the menu window (possibly empty). ! proc ::tk::MenuFirstEntry menu { if {[string equal $menu ""]} { return } *************** *** 1112,1118 **** && [string compare $state "disabled"] \ && [string compare [$menu type $i] "tearoff"]} { $menu activate $i ! tkGenerateMenuSelect $menu # Only post the cascade if the current menu is a menubar; # otherwise, if the first entry of the cascade is a cascade, # we can get an annoying cascading effect resulting in a bunch of --- 1112,1118 ---- && [string compare $state "disabled"] \ && [string compare [$menu type $i] "tearoff"]} { $menu activate $i ! GenerateMenuSelect $menu # Only post the cascade if the current menu is a menubar; # otherwise, if the first entry of the cascade is a cascade, # we can get an annoying cascading effect resulting in a bunch of *************** *** 1122,1128 **** set cascade [$menu entrycget $i -menu] if {[string compare $cascade ""]} { $menu postcascade $i ! tkMenuFirstEntry $cascade } } return --- 1122,1128 ---- set cascade [$menu entrycget $i -menu] if {[string compare $cascade ""]} { $menu postcascade $i ! MenuFirstEntry $cascade } } return *************** *** 1130,1136 **** } } ! # tkMenuFindName -- # Given a menu and a text string, return the index of the menu entry # that displays the string as its label. If there is no such entry, # return an empty string. This procedure is tricky because some names --- 1130,1136 ---- } } ! # ::tk::MenuFindName -- # Given a menu and a text string, return the index of the menu entry # that displays the string as its label. If there is no such entry, # return an empty string. This procedure is tricky because some names *************** *** 1141,1147 **** # menu - Name of the menu widget. # s - String to look for. ! proc tkMenuFindName {menu s} { set i "" if {![regexp {^active$|^last$|^none$|^[0-9]|^@} $s]} { catch {set i [$menu index $s]} --- 1141,1147 ---- # menu - Name of the menu widget. # s - String to look for. ! proc ::tk::MenuFindName {menu s} { set i "" if {![regexp {^active$|^last$|^none$|^[0-9]|^@} $s]} { catch {set i [$menu index $s]} *************** *** 1161,1167 **** return "" } ! # tkPostOverPoint -- # This procedure posts a given menu such that a given entry in the # menu is centered over a given point in the root window. It also # activates the given entry. --- 1161,1167 ---- return "" } ! # ::tk::PostOverPoint -- # This procedure posts a given menu such that a given entry in the # menu is centered over a given point in the root window. It also # activates the given entry. *************** *** 1173,1179 **** # If omitted or specified as {}, then the menu's # upper-left corner goes at (x,y). ! proc tkPostOverPoint {menu x y {entry {}}} { global tcl_platform if {[string compare $entry {}]} { --- 1173,1179 ---- # If omitted or specified as {}, then the menu's # upper-left corner goes at (x,y). ! proc ::tk::PostOverPoint {menu x y {entry {}}} { global tcl_platform if {[string compare $entry {}]} { *************** *** 1190,1260 **** if {[string compare $entry {}] \ && [string compare [$menu entrycget $entry -state] "disabled"]} { $menu activate $entry ! tkGenerateMenuSelect $menu } } ! # tkSaveGrabInfo -- ! # Sets the variables tkPriv(oldGrab) and tkPriv(grabStatus) to record # the state of any existing grab on the w's display. # # Arguments: # w - Name of a window; used to select the display # whose grab information is to be recorded. ! proc tkSaveGrabInfo w { ! global tkPriv ! set tkPriv(oldGrab) [grab current $w] ! if {[string compare $tkPriv(oldGrab) ""]} { ! set tkPriv(grabStatus) [grab status $tkPriv(oldGrab)] } } ! # tkRestoreOldGrab -- # Restores the grab to what it was before TkSaveGrabInfo was called. # ! proc tkRestoreOldGrab {} { ! global tkPriv ! if {[string compare $tkPriv(oldGrab) ""]} { # Be careful restoring the old grab, since it's window may not # be visible anymore. catch { ! if {[string equal $tkPriv(grabStatus) "global"]} { ! grab set -global $tkPriv(oldGrab) } else { ! grab set $tkPriv(oldGrab) } } ! set tkPriv(oldGrab) "" } } ! proc tk_menuSetFocus {menu} { ! global tkPriv ! if {![info exists tkPriv(focus)] || [string equal $tkPriv(focus) {}]} { ! set tkPriv(focus) [focus] } focus $menu } ! proc tkGenerateMenuSelect {menu} { ! global tkPriv ! if {[string equal $tkPriv(activeMenu) $menu] \ ! && [string equal $tkPriv(activeItem) [$menu index active]]} { return } ! set tkPriv(activeMenu) $menu ! set tkPriv(activeItem) [$menu index active] event generate $menu <> } ! # tk_popup -- # This procedure pops up a menu and sets things up for traversing # the menu and its submenus. # --- 1190,1260 ---- if {[string compare $entry {}] \ && [string compare [$menu entrycget $entry -state] "disabled"]} { $menu activate $entry ! GenerateMenuSelect $menu } } ! # ::tk::SaveGrabInfo -- ! # Sets the variables tk::Priv(oldGrab) and tk::Priv(grabStatus) to record # the state of any existing grab on the w's display. # # Arguments: # w - Name of a window; used to select the display # whose grab information is to be recorded. ! proc tk::SaveGrabInfo w { ! variable ::tk::Priv ! set Priv(oldGrab) [grab current $w] ! if {[string compare $Priv(oldGrab) ""]} { ! set Priv(grabStatus) [grab status $Priv(oldGrab)] } } ! # ::tk::RestoreOldGrab -- # Restores the grab to what it was before TkSaveGrabInfo was called. # ! proc ::tk::RestoreOldGrab {} { ! variable ::tk::Priv ! if {[string compare $Priv(oldGrab) ""]} { # Be careful restoring the old grab, since it's window may not # be visible anymore. catch { ! if {[string equal $Priv(grabStatus) "global"]} { ! grab set -global $Priv(oldGrab) } else { ! grab set $Priv(oldGrab) } } ! set Priv(oldGrab) "" } } ! proc ::tk_menuSetFocus {menu} { ! variable ::tk::Priv ! if {![info exists Priv(focus)] || [string equal $Priv(focus) {}]} { ! set Priv(focus) [focus] } focus $menu } ! proc ::tk::GenerateMenuSelect {menu} { ! variable ::tk::Priv ! if {[string equal $Priv(activeMenu) $menu] \ ! && [string equal $Priv(activeItem) [$menu index active]]} { return } ! set Priv(activeMenu) $menu ! set Priv(activeItem) [$menu index active] event generate $menu <> } ! # ::tk_popup -- # This procedure pops up a menu and sets things up for traversing # the menu and its submenus. # *************** *** 1266,1284 **** # If omitted or specified as {}, then menu's # upper-left corner goes at (x,y). ! proc tk_popup {menu x y {entry {}}} { ! global tkPriv global tcl_platform ! if {[string compare $tkPriv(popup) ""] \ ! || [string compare $tkPriv(postedMb) ""]} { ! tkMenuUnpost {} } ! tkPostOverPoint $menu $x $y $entry if {[string equal $tcl_platform(platform) "unix"] \ && [winfo viewable $menu]} { ! tkSaveGrabInfo $menu grab -global $menu ! set tkPriv(popup) $menu tk_menuSetFocus $menu } } --- 1266,1284 ---- # If omitted or specified as {}, then menu's # upper-left corner goes at (x,y). ! proc ::tk_popup {menu x y {entry {}}} { ! variable ::tk::Priv global tcl_platform ! if {[string compare $Priv(popup) ""] \ ! || [string compare $Priv(postedMb) ""]} { ! tk::MenuUnpost {} } ! tk::PostOverPoint $menu $x $y $entry if {[string equal $tcl_platform(platform) "unix"] \ && [winfo viewable $menu]} { ! tk::SaveGrabInfo $menu grab -global $menu ! set Priv(popup) $menu tk_menuSetFocus $menu } } Index: library/msgbox.tcl =================================================================== RCS file: /cvsroot/tk/library/msgbox.tcl,v retrieving revision 1.12 diff -c -r1.12 msgbox.tcl *** msgbox.tcl 2000/06/30 06:38:38 1.12 --- msgbox.tcl 2000/07/17 06:27:48 *************** *** 114,120 **** 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};" ! # tkMessageBox -- # # Pops up a messagebox with an application-supplied message with # an icon and a list of buttons. This procedure will be called --- 114,120 ---- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};" ! # ::tk::MessageBox -- # # Pops up a messagebox with an application-supplied message with # an icon and a list of buttons. This procedure will be called *************** *** 130,140 **** # # See the user documentation for details on what tk_messageBox does. # ! proc tkMessageBox {args} { ! global tkPriv tcl_platform tk_strictMotif ! set w tkPrivMsgBox ! upvar #0 $w data # # The default value of the title is space (" ") not the empty string --- 130,141 ---- # # See the user documentation for details on what tk_messageBox does. # ! proc ::tk::MessageBox {args} { ! global tcl_platform tk_strictMotif ! variable ::tk::Priv ! set w ::tk::PrivMsgBox ! upvar $w data # # The default value of the title is space (" ") not the empty string *************** *** 364,370 **** set opts [list -text $capName] } ! eval button [list $w.$name] $opts [list -command [list set tkPriv(button) $name]] if {[string equal $name $data(-default)]} { $w.$name configure -default active --- 365,371 ---- set opts [list -text $capName] } ! eval button [list $w.$name] $opts [list -command [list set tk::Priv(button) $name]] if {[string equal $name $data(-default)]} { $w.$name configure -default active *************** *** 399,405 **** bind $w { if {[string equal Button [winfo class %W]]} { ! tkButtonInvoke %W } } --- 400,406 ---- bind $w { if {[string equal Button [winfo class %W]]} { ! tk::ButtonInvoke %W } } *************** *** 424,432 **** # may take the focus away so we can't redirect it. Finally, # restore any grab that was in effect. ! tkwait variable tkPriv(button) ::tk::RestoreFocusGrab $w $focus ! return $tkPriv(button) } --- 425,433 ---- # may take the focus away so we can't redirect it. Finally, # restore any grab that was in effect. ! vwait ::tk::Priv(button) ::tk::RestoreFocusGrab $w $focus ! return $Priv(button) } Index: library/optMenu.tcl =================================================================== RCS file: /cvsroot/tk/library/optMenu.tcl,v retrieving revision 1.3 diff -c -r1.3 optMenu.tcl *** optMenu.tcl 1998/09/14 18:23:24 1.3 --- optMenu.tcl 2000/07/17 06:27:48 *************** *** 12,18 **** # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # ! # tk_optionMenu -- # This procedure creates an option button named $w and an associated # menu. Together they provide the functionality of Motif option menus: # they can be used to select one of many values, and the current value --- 12,18 ---- # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # ! # ::tk_optionMenu -- # This procedure creates an option button named $w and an associated # menu. Together they provide the functionality of Motif option menus: # they can be used to select one of many values, and the current value *************** *** 27,33 **** # firstValue - First of legal values for option (must be >= 1). # args - Any number of additional values. ! proc tk_optionMenu {w varName firstValue args} { upvar #0 $varName var if {![info exists var]} { --- 27,33 ---- # firstValue - First of legal values for option (must be >= 1). # args - Any number of additional values. ! proc ::tk_optionMenu {w varName firstValue args} { upvar #0 $varName var if {![info exists var]} { Index: library/palette.tcl =================================================================== RCS file: /cvsroot/tk/library/palette.tcl,v retrieving revision 1.5 diff -c -r1.5 palette.tcl *** palette.tcl 1999/09/02 17:02:53 1.5 --- palette.tcl 2000/07/17 06:27:50 *************** *** 11,17 **** # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # ! # tk_setPalette -- # Changes the default color scheme for a Tk application by setting # default colors in the option database and by modifying all of the # color options for existing widgets that have the default value. --- 11,17 ---- # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # ! # ::tk_setPalette -- # Changes the default color scheme for a Tk application by setting # default colors in the option database and by modifying all of the # color options for existing widgets that have the default value. *************** *** 23,36 **** # option names and values. The name for an option is the one used # for the option database, such as activeForeground, not -activeforeground. ! proc tk_setPalette {args} { if {[winfo depth .] == 1} { # Just return on monochrome displays, otherwise errors will occur return } - global tkPalette - # Create an array that has the complete new palette. If some colors # aren't specified, compute them from other colors that are specified. --- 23,34 ---- # option names and values. The name for an option is the one used # for the option database, such as activeForeground, not -activeforeground. ! proc ::tk_setPalette {args} { if {[winfo depth .] == 1} { # Just return on monochrome displays, otherwise errors will occur return } # Create an array that has the complete new palette. If some colors # aren't specified, compute them from other colors that are specified. *************** *** 108,114 **** # Walk the widget hierarchy, recoloring all existing windows. # The option database must be set according to what we do here, # but it breaks things if we set things in the database while ! # we are changing colors...so, tkRecolorTree now returns the # option database changes that need to be made, and they # need to be evalled here to take effect. # We have to walk the whole widget tree instead of just --- 106,112 ---- # Walk the widget hierarchy, recoloring all existing windows. # The option database must be set according to what we do here, # but it breaks things if we set things in the database while ! # we are changing colors...so, ::tk::RecolorTree now returns the # option database changes that need to be made, and they # need to be evalled here to take effect. # We have to walk the whole widget tree instead of just *************** *** 117,123 **** # of widgets that we don't currently know about, so we'll # walk the whole hierarchy just in case. ! eval [tkRecolorTree . new] catch {destroy .___tk_set_palette} --- 115,121 ---- # of widgets that we don't currently know about, so we'll # walk the whole hierarchy just in case. ! eval [tk::RecolorTree . new] catch {destroy .___tk_set_palette} *************** *** 128,140 **** option add *$option $new($option) widgetDefault } ! # Save the options in the global variable tkPalette, for use the # next time we change the options. ! array set tkPalette [array get new] } ! # tkRecolorTree -- # This procedure changes the colors in a window and all of its # descendants, according to information provided by the colors # argument. This looks at the defaults provided by the option --- 126,138 ---- option add *$option $new($option) widgetDefault } ! # Save the options in the variable ::tk::Palette, for use the # next time we change the options. ! array set ::tk::Palette [array get new] } ! # ::tk::RecolorTree -- # This procedure changes the colors in a window and all of its # descendants, according to information provided by the colors # argument. This looks at the defaults provided by the option *************** *** 149,156 **** # is named after a widget configuration option, and # each value is the value for that option. ! proc tkRecolorTree {w colors} { ! global tkPalette upvar $colors c set result {} foreach dbOption [array names c] { --- 147,153 ---- # is named after a widget configuration option, and # each value is the value for that option. ! proc ::tk::RecolorTree {w colors} { upvar $colors c set result {} foreach dbOption [array names c] { *************** *** 176,187 **** } } foreach child [winfo children $w] { ! append result ";\n[tkRecolorTree $child c]" } return $result } ! # tkDarken -- # Given a color name, computes a new color value that darkens (or # brightens) the given color by a given percent. # --- 173,184 ---- } } foreach child [winfo children $w] { ! append result ";\n[::tk::RecolorTree $child c]" } return $result } ! # ::tk::Darken -- # Given a color name, computes a new color value that darkens (or # brightens) the given color by a given percent. # *************** *** 191,197 **** # percent: 50 means darken by 50%, 110 means brighten # by 10%. ! proc tkDarken {color percent} { foreach {red green blue} [winfo rgb . $color] { set red [expr {($red/256)*$percent/100}] set green [expr {($green/256)*$percent/100}] --- 188,194 ---- # percent: 50 means darken by 50%, 110 means brighten # by 10%. ! proc ::tk::Darken {color percent} { foreach {red green blue} [winfo rgb . $color] { set red [expr {($red/256)*$percent/100}] set green [expr {($green/256)*$percent/100}] *************** *** 210,222 **** return [format "#%02x%02x%02x" $red $green $blue] } ! # tk_bisque -- # Reset the Tk color palette to the old "bisque" colors. # # Arguments: # None. ! proc tk_bisque {} { tk_setPalette activeBackground #e6ceb1 activeForeground black \ background #ffe4c4 disabledForeground #b0b0b0 foreground black \ highlightBackground #ffe4c4 highlightColor black \ --- 207,219 ---- return [format "#%02x%02x%02x" $red $green $blue] } ! # ::tk_bisque -- # Reset the Tk color palette to the old "bisque" colors. # # Arguments: # None. ! proc ::tk_bisque {} { tk_setPalette activeBackground #e6ceb1 activeForeground black \ background #ffe4c4 disabledForeground #b0b0b0 foreground black \ highlightBackground #ffe4c4 highlightColor black \ Index: library/scale.tcl =================================================================== RCS file: /cvsroot/tk/library/scale.tcl,v retrieving revision 1.7 diff -c -r1.7 scale.tcl *** scale.tcl 2000/04/14 08:33:31 1.7 --- scale.tcl 2000/07/17 06:27:51 *************** *** 20,93 **** bind Scale { if {$tk_strictMotif} { ! set tkPriv(activeBg) [%W cget -activebackground] %W config -activebackground [%W cget -background] } ! tkScaleActivate %W %x %y } bind Scale { ! tkScaleActivate %W %x %y } bind Scale { if {$tk_strictMotif} { ! %W config -activebackground $tkPriv(activeBg) } if {[string equal [%W cget -state] "active"]} { %W configure -state normal } } bind Scale <1> { ! tkScaleButtonDown %W %x %y } bind Scale { ! tkScaleDrag %W %x %y } bind Scale { } bind Scale { } bind Scale { ! tkCancelRepeat ! tkScaleEndDrag %W ! tkScaleActivate %W %x %y } bind Scale <2> { ! tkScaleButton2Down %W %x %y } bind Scale { ! tkScaleDrag %W %x %y } bind Scale { } bind Scale { } bind Scale { ! tkCancelRepeat ! tkScaleEndDrag %W ! tkScaleActivate %W %x %y } bind Scale { ! tkScaleControlPress %W %x %y } bind Scale { ! tkScaleIncrement %W up little noRepeat } bind Scale { ! tkScaleIncrement %W down little noRepeat } bind Scale { ! tkScaleIncrement %W up little noRepeat } bind Scale { ! tkScaleIncrement %W down little noRepeat } bind Scale { ! tkScaleIncrement %W up big noRepeat } bind Scale { ! tkScaleIncrement %W down big noRepeat } bind Scale { ! tkScaleIncrement %W up big noRepeat } bind Scale { ! tkScaleIncrement %W down big noRepeat } bind Scale { %W set [%W cget -from] --- 20,93 ---- bind Scale { if {$tk_strictMotif} { ! set tk::Priv(activeBg) [%W cget -activebackground] %W config -activebackground [%W cget -background] } ! tk::ScaleActivate %W %x %y } bind Scale { ! tk::ScaleActivate %W %x %y } bind Scale { if {$tk_strictMotif} { ! %W config -activebackground $tk::Priv(activeBg) } if {[string equal [%W cget -state] "active"]} { %W configure -state normal } } bind Scale <1> { ! tk::ScaleButtonDown %W %x %y } bind Scale { ! tk::ScaleDrag %W %x %y } bind Scale { } bind Scale { } bind Scale { ! tk::CancelRepeat ! tk::ScaleEndDrag %W ! tk::ScaleActivate %W %x %y } bind Scale <2> { ! tk::ScaleButton2Down %W %x %y } bind Scale { ! tk::ScaleDrag %W %x %y } bind Scale { } bind Scale { } bind Scale { ! tk::CancelRepeat ! tk::ScaleEndDrag %W ! tk::ScaleActivate %W %x %y } bind Scale { ! tk::ScaleControlPress %W %x %y } bind Scale { ! tk::ScaleIncrement %W up little noRepeat } bind Scale { ! tk::ScaleIncrement %W down little noRepeat } bind Scale { ! tk::ScaleIncrement %W up little noRepeat } bind Scale { ! tk::ScaleIncrement %W down little noRepeat } bind Scale { ! tk::ScaleIncrement %W up big noRepeat } bind Scale { ! tk::ScaleIncrement %W down big noRepeat } bind Scale { ! tk::ScaleIncrement %W up big noRepeat } bind Scale { ! tk::ScaleIncrement %W down big noRepeat } bind Scale { %W set [%W cget -from] *************** *** 96,102 **** %W set [%W cget -to] } ! # tkScaleActivate -- # This procedure is invoked to check a given x-y position in the # scale and activate the slider if the x-y position falls within # the slider. --- 96,102 ---- %W set [%W cget -to] } ! # ::tk::ScaleActivate -- # This procedure is invoked to check a given x-y position in the # scale and activate the slider if the x-y position falls within # the slider. *************** *** 105,111 **** # w - The scale widget. # x, y - Mouse coordinates. ! proc tkScaleActivate {w x y} { if {[string equal [$w cget -state] "disabled"]} { return } --- 105,111 ---- # w - The scale widget. # x, y - Mouse coordinates. ! proc ::tk::ScaleActivate {w x y} { if {[string equal [$w cget -state] "disabled"]} { return } *************** *** 119,125 **** } } ! # tkScaleButtonDown -- # This procedure is invoked when a button is pressed in a scale. It # takes different actions depending on where the button was pressed. # --- 119,125 ---- } } ! # ::tk::ScaleButtonDown -- # This procedure is invoked when a button is pressed in a scale. It # takes different actions depending on where the button was pressed. # *************** *** 127,151 **** # w - The scale widget. # x, y - Mouse coordinates of button press. ! proc tkScaleButtonDown {w x y} { ! global tkPriv ! set tkPriv(dragging) 0 set el [$w identify $x $y] if {[string equal $el "trough1"]} { ! tkScaleIncrement $w up little initial } elseif {[string equal $el "trough2"]} { ! tkScaleIncrement $w down little initial } elseif {[string equal $el "slider"]} { ! set tkPriv(dragging) 1 ! set tkPriv(initValue) [$w get] set coords [$w coords] ! set tkPriv(deltaX) [expr {$x - [lindex $coords 0]}] ! set tkPriv(deltaY) [expr {$y - [lindex $coords 1]}] $w configure -sliderrelief sunken } } ! # tkScaleDrag -- # This procedure is called when the mouse is dragged with # mouse button 1 down. If the drag started inside the slider # (i.e. the scale is active) then the scale's value is adjusted --- 127,151 ---- # w - The scale widget. # x, y - Mouse coordinates of button press. ! proc ::tk::ScaleButtonDown {w x y} { ! variable ::tk::Priv ! set Priv(dragging) 0 set el [$w identify $x $y] if {[string equal $el "trough1"]} { ! ScaleIncrement $w up little initial } elseif {[string equal $el "trough2"]} { ! ScaleIncrement $w down little initial } elseif {[string equal $el "slider"]} { ! set Priv(dragging) 1 ! set Priv(initValue) [$w get] set coords [$w coords] ! set Priv(deltaX) [expr {$x - [lindex $coords 0]}] ! set Priv(deltaY) [expr {$y - [lindex $coords 1]}] $w configure -sliderrelief sunken } } ! # ::tk::ScaleDrag -- # This procedure is called when the mouse is dragged with # mouse button 1 down. If the drag started inside the slider # (i.e. the scale is active) then the scale's value is adjusted *************** *** 155,182 **** # w - The scale widget. # x, y - Mouse coordinates. ! proc tkScaleDrag {w x y} { ! global tkPriv ! if {!$tkPriv(dragging)} { return } ! $w set [$w get [expr {$x-$tkPriv(deltaX)}] [expr {$y-$tkPriv(deltaY)}]] } ! # tkScaleEndDrag -- # This procedure is called to end an interactive drag of the # slider. It just marks the drag as over. # # Arguments: # w - The scale widget. ! proc tkScaleEndDrag {w} { ! global tkPriv ! set tkPriv(dragging) 0 $w configure -sliderrelief raised } ! # tkScaleIncrement -- # This procedure is invoked to increment the value of a scale and # to set up auto-repeating of the action if that is desired. The # way the value is incremented depends on the "dir" and "big" --- 155,182 ---- # w - The scale widget. # x, y - Mouse coordinates. ! proc ::tk::ScaleDrag {w x y} { ! variable ::tk::Priv ! if {!$Priv(dragging)} { return } ! $w set [$w get [expr {$x-$Priv(deltaX)}] [expr {$y-$Priv(deltaY)}]] } ! # ::tk::ScaleEndDrag -- # This procedure is called to end an interactive drag of the # slider. It just marks the drag as over. # # Arguments: # w - The scale widget. ! proc ::tk::ScaleEndDrag {w} { ! variable ::tk::Priv ! set Priv(dragging) 0 $w configure -sliderrelief raised } ! # ::tk::ScaleIncrement -- # This procedure is invoked to increment the value of a scale and # to set up auto-repeating of the action if that is desired. The # way the value is incremented depends on the "dir" and "big" *************** *** 192,199 **** # first action in an auto-repeat sequence, and "again" # means this is the second repetition or later. ! proc tkScaleIncrement {w dir big repeat} { ! global tkPriv if {![winfo exists $w]} return if {[string equal $big "big"]} { set inc [$w cget -bigincrement] --- 192,199 ---- # first action in an auto-repeat sequence, and "again" # means this is the second repetition or later. ! proc ::tk::ScaleIncrement {w dir big repeat} { ! variable ::tk::Priv if {![winfo exists $w]} return if {[string equal $big "big"]} { set inc [$w cget -bigincrement] *************** *** 212,229 **** $w set [expr {[$w get] + $inc}] if {[string equal $repeat "again"]} { ! set tkPriv(afterId) [after [$w cget -repeatinterval] \ ! [list tkScaleIncrement $w $dir $big again]] } elseif {[string equal $repeat "initial"]} { set delay [$w cget -repeatdelay] if {$delay > 0} { ! set tkPriv(afterId) [after $delay \ ! [list tkScaleIncrement $w $dir $big again]] } } } ! # tkScaleControlPress -- # This procedure handles button presses that are made with the Control # key down. Depending on the mouse position, it adjusts the scale # value to one end of the range or the other. --- 212,229 ---- $w set [expr {[$w get] + $inc}] if {[string equal $repeat "again"]} { ! set Priv(afterId) [after [$w cget -repeatinterval] \ ! [list tk::ScaleIncrement $w $dir $big again]] } elseif {[string equal $repeat "initial"]} { set delay [$w cget -repeatdelay] if {$delay > 0} { ! set Priv(afterId) [after $delay \ ! [list tk::ScaleIncrement $w $dir $big again]] } } } ! # ::tk::ScaleControlPress -- # This procedure handles button presses that are made with the Control # key down. Depending on the mouse position, it adjusts the scale # value to one end of the range or the other. *************** *** 232,238 **** # w - The scale widget. # x, y - Mouse coordinates where the button was pressed. ! proc tkScaleControlPress {w x y} { set el [$w identify $x $y] if {[string equal $el "trough1"]} { $w set [$w cget -from] --- 232,238 ---- # w - The scale widget. # x, y - Mouse coordinates where the button was pressed. ! proc ::tk::ScaleControlPress {w x y} { set el [$w identify $x $y] if {[string equal $el "trough1"]} { $w set [$w cget -from] *************** *** 241,247 **** } } ! # tkScaleButton2Down # This procedure is invoked when button 2 is pressed over a scale. # It sets the value to correspond to the mouse position and starts # a slider drag. --- 241,247 ---- } } ! # ::tk::ScaleButton2Down # This procedure is invoked when button 2 is pressed over a scale. # It sets the value to correspond to the mouse position and starts # a slider drag. *************** *** 250,266 **** # w - The scrollbar widget. # x, y - Mouse coordinates within the widget. ! proc tkScaleButton2Down {w x y} { ! global tkPriv if {[string equal [$w cget -state] "disabled"]} { return } $w configure -state active $w set [$w get $x $y] ! set tkPriv(dragging) 1 ! set tkPriv(initValue) [$w get] set coords "$x $y" ! set tkPriv(deltaX) 0 ! set tkPriv(deltaY) 0 } --- 250,266 ---- # w - The scrollbar widget. # x, y - Mouse coordinates within the widget. ! proc ::tk::ScaleButton2Down {w x y} { ! variable ::tk::Priv if {[string equal [$w cget -state] "disabled"]} { return } $w configure -state active $w set [$w get $x $y] ! set Priv(dragging) 1 ! set Priv(initValue) [$w get] set coords "$x $y" ! set Priv(deltaX) 0 ! set Priv(deltaY) 0 } Index: library/scrlbar.tcl =================================================================== RCS file: /cvsroot/tk/library/scrlbar.tcl,v retrieving revision 1.8 diff -c -r1.8 scrlbar.tcl *** scrlbar.tcl 2000/01/06 02:22:24 1.8 --- scrlbar.tcl 2000/07/17 06:27:53 *************** *** 22,28 **** bind Scrollbar { if {$tk_strictMotif} { ! set tkPriv(activeBg) [%W cget -activebackground] %W config -activebackground [%W cget -background] } %W activate [%W identify %x %y] --- 22,28 ---- bind Scrollbar { if {$tk_strictMotif} { ! set tk::Priv(activeBg) [%W cget -activebackground] %W config -activebackground [%W cget -background] } %W activate [%W identify %x %y] *************** *** 37,58 **** # unknown reasons. bind Scrollbar { ! if {$tk_strictMotif && [info exists tkPriv(activeBg)]} { ! %W config -activebackground $tkPriv(activeBg) } %W activate {} } bind Scrollbar <1> { ! tkScrollButtonDown %W %x %y } bind Scrollbar { ! tkScrollDrag %W %x %y } bind Scrollbar { ! tkScrollDrag %W %x %y } bind Scrollbar { ! tkScrollButtonUp %W %x %y } bind Scrollbar { # Prevents binding from being invoked. --- 37,58 ---- # unknown reasons. bind Scrollbar { ! if {$tk_strictMotif && [info exists tk::Priv(activeBg)]} { ! %W config -activebackground $tk::Priv(activeBg) } %W activate {} } bind Scrollbar <1> { ! tk::ScrollButtonDown %W %x %y } bind Scrollbar { ! tk::ScrollDrag %W %x %y } bind Scrollbar { ! tk::ScrollDrag %W %x %y } bind Scrollbar { ! tk::ScrollButtonUp %W %x %y } bind Scrollbar { # Prevents binding from being invoked. *************** *** 61,67 **** # Prevents binding from being invoked. } bind Scrollbar <2> { ! tkScrollButton2Down %W %x %y } bind Scrollbar { # Do nothing, since button 1 is already down. --- 61,67 ---- # Prevents binding from being invoked. } bind Scrollbar <2> { ! tk::ScrollButton2Down %W %x %y } bind Scrollbar { # Do nothing, since button 1 is already down. *************** *** 70,79 **** # Do nothing, since button 2 is already down. } bind Scrollbar { ! tkScrollDrag %W %x %y } bind Scrollbar { ! tkScrollButtonUp %W %x %y } bind Scrollbar { # Do nothing: B1 release will handle it. --- 70,79 ---- # Do nothing, since button 2 is already down. } bind Scrollbar { ! tk::ScrollDrag %W %x %y } bind Scrollbar { ! tk::ScrollButtonUp %W %x %y } bind Scrollbar { # Do nothing: B1 release will handle it. *************** *** 88,137 **** # Prevents binding from being invoked. } bind Scrollbar { ! tkScrollTopBottom %W %x %y } bind Scrollbar { ! tkScrollTopBottom %W %x %y } bind Scrollbar { ! tkScrollByUnits %W v -1 } bind Scrollbar { ! tkScrollByUnits %W v 1 } bind Scrollbar { ! tkScrollByPages %W v -1 } bind Scrollbar { ! tkScrollByPages %W v 1 } bind Scrollbar { ! tkScrollByUnits %W h -1 } bind Scrollbar { ! tkScrollByUnits %W h 1 } bind Scrollbar { ! tkScrollByPages %W h -1 } bind Scrollbar { ! tkScrollByPages %W h 1 } bind Scrollbar { ! tkScrollByPages %W hv -1 } bind Scrollbar { ! tkScrollByPages %W hv 1 } bind Scrollbar { ! tkScrollToPos %W 0 } bind Scrollbar { ! tkScrollToPos %W 1 } } ! # tkScrollButtonDown -- # This procedure is invoked when a button is pressed in a scrollbar. # It changes the way the scrollbar is displayed and takes actions # depending on where the mouse is. --- 88,137 ---- # Prevents binding from being invoked. } bind Scrollbar { ! tk::ScrollTopBottom %W %x %y } bind Scrollbar { ! tk::ScrollTopBottom %W %x %y } bind Scrollbar { ! tk::ScrollByUnits %W v -1 } bind Scrollbar { ! tk::ScrollByUnits %W v 1 } bind Scrollbar { ! tk::ScrollByPages %W v -1 } bind Scrollbar { ! tk::ScrollByPages %W v 1 } bind Scrollbar { ! tk::ScrollByUnits %W h -1 } bind Scrollbar { ! tk::ScrollByUnits %W h 1 } bind Scrollbar { ! tk::ScrollByPages %W h -1 } bind Scrollbar { ! tk::ScrollByPages %W h 1 } bind Scrollbar { ! tk::ScrollByPages %W hv -1 } bind Scrollbar { ! tk::ScrollByPages %W hv 1 } bind Scrollbar { ! tk::ScrollToPos %W 0 } bind Scrollbar { ! tk::ScrollToPos %W 1 } } ! # tk::ScrollButtonDown -- # This procedure is invoked when a button is pressed in a scrollbar. # It changes the way the scrollbar is displayed and takes actions # depending on where the mouse is. *************** *** 140,158 **** # w - The scrollbar widget. # x, y - Mouse coordinates. ! proc tkScrollButtonDown {w x y} { ! global tkPriv ! set tkPriv(relief) [$w cget -activerelief] $w configure -activerelief sunken set element [$w identify $x $y] if {[string equal $element "slider"]} { ! tkScrollStartDrag $w $x $y } else { ! tkScrollSelect $w $element initial } } ! # tkScrollButtonUp -- # This procedure is invoked when a button is released in a scrollbar. # It cancels scans and auto-repeats that were in progress, and restores # the way the active element is displayed. --- 140,158 ---- # w - The scrollbar widget. # x, y - Mouse coordinates. ! proc tk::ScrollButtonDown {w x y} { ! variable ::tk::Priv ! set Priv(relief) [$w cget -activerelief] $w configure -activerelief sunken set element [$w identify $x $y] if {[string equal $element "slider"]} { ! ScrollStartDrag $w $x $y } else { ! ScrollSelect $w $element initial } } ! # ::tk::ScrollButtonUp -- # This procedure is invoked when a button is released in a scrollbar. # It cancels scans and auto-repeats that were in progress, and restores # the way the active element is displayed. *************** *** 161,178 **** # w - The scrollbar widget. # x, y - Mouse coordinates. ! proc tkScrollButtonUp {w x y} { ! global tkPriv ! tkCancelRepeat ! if {[info exists tkPriv(relief)]} { # Avoid error due to spurious release events ! $w configure -activerelief $tkPriv(relief) ! tkScrollEndDrag $w $x $y $w activate [$w identify $x $y] } } ! # tkScrollSelect -- # This procedure is invoked when a button is pressed over the scrollbar. # It invokes one of several scrolling actions depending on where in # the scrollbar the button was pressed. --- 161,178 ---- # w - The scrollbar widget. # x, y - Mouse coordinates. ! proc ::tk::ScrollButtonUp {w x y} { ! variable ::tk::Priv ! tk::CancelRepeat ! if {[info exists Priv(relief)]} { # Avoid error due to spurious release events ! $w configure -activerelief $Priv(relief) ! ScrollEndDrag $w $x $y $w activate [$w identify $x $y] } } ! # ::tk::ScrollSelect -- # This procedure is invoked when a button is pressed over the scrollbar. # It invokes one of several scrolling actions depending on where in # the scrollbar the button was pressed. *************** *** 186,214 **** # first action in an auto-repeat sequence, and "again" # means this is the second repetition or later. ! proc tkScrollSelect {w element repeat} { ! global tkPriv if {![winfo exists $w]} return switch -- $element { ! "arrow1" {tkScrollByUnits $w hv -1} ! "trough1" {tkScrollByPages $w hv -1} ! "trough2" {tkScrollByPages $w hv 1} ! "arrow2" {tkScrollByUnits $w hv 1} default {return} } if {[string equal $repeat "again"]} { ! set tkPriv(afterId) [after [$w cget -repeatinterval] \ ! [list tkScrollSelect $w $element again]] } elseif {[string equal $repeat "initial"]} { set delay [$w cget -repeatdelay] if {$delay > 0} { ! set tkPriv(afterId) [after $delay \ ! [list tkScrollSelect $w $element again]] } } } ! # tkScrollStartDrag -- # This procedure is called to initiate a drag of the slider. It just # remembers the starting position of the mouse and slider. # --- 186,214 ---- # first action in an auto-repeat sequence, and "again" # means this is the second repetition or later. ! proc ::tk::ScrollSelect {w element repeat} { ! variable ::tk::Priv if {![winfo exists $w]} return switch -- $element { ! "arrow1" {ScrollByUnits $w hv -1} ! "trough1" {ScrollByPages $w hv -1} ! "trough2" {ScrollByPages $w hv 1} ! "arrow2" {ScrollByUnits $w hv 1} default {return} } if {[string equal $repeat "again"]} { ! set Priv(afterId) [after [$w cget -repeatinterval] \ ! [list tk::ScrollSelect $w $element again]] } elseif {[string equal $repeat "initial"]} { set delay [$w cget -repeatdelay] if {$delay > 0} { ! set Priv(afterId) [after $delay \ ! [list tk::ScrollSelect $w $element again]] } } } ! # ::tk::ScrollStartDrag -- # This procedure is called to initiate a drag of the slider. It just # remembers the starting position of the mouse and slider. # *************** *** 216,242 **** # w - The scrollbar widget. # x, y - The mouse position at the start of the drag operation. ! proc tkScrollStartDrag {w x y} { ! global tkPriv if {[string equal [$w cget -command] ""]} { return } ! set tkPriv(pressX) $x ! set tkPriv(pressY) $y ! set tkPriv(initValues) [$w get] ! set iv0 [lindex $tkPriv(initValues) 0] ! if {[llength $tkPriv(initValues)] == 2} { ! set tkPriv(initPos) $iv0 } elseif {$iv0 == 0} { ! set tkPriv(initPos) 0.0 } else { ! set tkPriv(initPos) [expr {(double([lindex $tkPriv(initValues) 2])) \ ! / [lindex $tkPriv(initValues) 0]}] } } ! # tkScrollDrag -- # This procedure is called for each mouse motion even when the slider # is being dragged. It notifies the associated widget if we're not # jump scrolling, and it just updates the scrollbar if we are jump --- 216,242 ---- # w - The scrollbar widget. # x, y - The mouse position at the start of the drag operation. ! proc ::tk::ScrollStartDrag {w x y} { ! variable ::tk::Priv if {[string equal [$w cget -command] ""]} { return } ! set Priv(pressX) $x ! set Priv(pressY) $y ! set Priv(initValues) [$w get] ! set iv0 [lindex $Priv(initValues) 0] ! if {[llength $Priv(initValues)] == 2} { ! set Priv(initPos) $iv0 } elseif {$iv0 == 0} { ! set Priv(initPos) 0.0 } else { ! set Priv(initPos) [expr {(double([lindex $Priv(initValues) 2])) \ ! / [lindex $Priv(initValues) 0]}] } } ! # ::tk::ScrollDrag -- # This procedure is called for each mouse motion even when the slider # is being dragged. It notifies the associated widget if we're not # jump scrolling, and it just updates the scrollbar if we are jump *************** *** 246,274 **** # w - The scrollbar widget. # x, y - The current mouse position. ! proc tkScrollDrag {w x y} { ! global tkPriv ! if {[string equal $tkPriv(initPos) ""]} { return } ! set delta [$w delta [expr {$x - $tkPriv(pressX)}] [expr {$y - $tkPriv(pressY)}]] if {[$w cget -jump]} { ! if {[llength $tkPriv(initValues)] == 2} { ! $w set [expr {[lindex $tkPriv(initValues) 0] + $delta}] \ ! [expr {[lindex $tkPriv(initValues) 1] + $delta}] } else { ! set delta [expr {round($delta * [lindex $tkPriv(initValues) 0])}] ! eval [list $w] set [lreplace $tkPriv(initValues) 2 3 \ ! [expr {[lindex $tkPriv(initValues) 2] + $delta}] \ ! [expr {[lindex $tkPriv(initValues) 3] + $delta}]] } } else { ! tkScrollToPos $w [expr {$tkPriv(initPos) + $delta}] } } ! # tkScrollEndDrag -- # This procedure is called to end an interactive drag of the slider. # It scrolls the window if we're in jump mode, otherwise it does nothing. # --- 246,274 ---- # w - The scrollbar widget. # x, y - The current mouse position. ! proc ::tk::ScrollDrag {w x y} { ! variable ::tk::Priv ! if {[string equal $Priv(initPos) ""]} { return } ! set delta [$w delta [expr {$x - $Priv(pressX)}] [expr {$y - $Priv(pressY)}]] if {[$w cget -jump]} { ! if {[llength $Priv(initValues)] == 2} { ! $w set [expr {[lindex $Priv(initValues) 0] + $delta}] \ ! [expr {[lindex $Priv(initValues) 1] + $delta}] } else { ! set delta [expr {round($delta * [lindex $Priv(initValues) 0])}] ! eval [list $w] set [lreplace $Priv(initValues) 2 3 \ ! [expr {[lindex $Priv(initValues) 2] + $delta}] \ ! [expr {[lindex $Priv(initValues) 3] + $delta}]] } } else { ! ScrollToPos $w [expr {$Priv(initPos) + $delta}] } } ! # ::tk::ScrollEndDrag -- # This procedure is called to end an interactive drag of the slider. # It scrolls the window if we're in jump mode, otherwise it does nothing. # *************** *** 276,296 **** # w - The scrollbar widget. # x, y - The mouse position at the end of the drag operation. ! proc tkScrollEndDrag {w x y} { ! global tkPriv ! if {[string equal $tkPriv(initPos) ""]} { return } if {[$w cget -jump]} { ! set delta [$w delta [expr {$x - $tkPriv(pressX)}] \ ! [expr {$y - $tkPriv(pressY)}]] ! tkScrollToPos $w [expr {$tkPriv(initPos) + $delta}] } ! set tkPriv(initPos) "" } ! # tkScrollByUnits -- # This procedure tells the scrollbar's associated widget to scroll up # or down by a given number of units. It notifies the associated widget # in different ways for old and new command syntaxes. --- 276,296 ---- # w - The scrollbar widget. # x, y - The mouse position at the end of the drag operation. ! proc ::tk::ScrollEndDrag {w x y} { ! variable ::tk::Priv ! if {[string equal $Priv(initPos) ""]} { return } if {[$w cget -jump]} { ! set delta [$w delta [expr {$x - $Priv(pressX)}] \ ! [expr {$y - $Priv(pressY)}]] ! ScrollToPos $w [expr {$Priv(initPos) + $delta}] } ! set Priv(initPos) "" } ! # ::tk::ScrollByUnits -- # This procedure tells the scrollbar's associated widget to scroll up # or down by a given number of units. It notifies the associated widget # in different ways for old and new command syntaxes. *************** *** 301,307 **** # horizontal, "v" for vertical, "hv" for both. # amount - How many units to scroll: typically 1 or -1. ! proc tkScrollByUnits {w orient amount} { set cmd [$w cget -command] if {[string equal $cmd ""] || ([string first \ [string index [$w cget -orient] 0] $orient] < 0)} { --- 301,307 ---- # horizontal, "v" for vertical, "hv" for both. # amount - How many units to scroll: typically 1 or -1. ! proc ::tk::ScrollByUnits {w orient amount} { set cmd [$w cget -command] if {[string equal $cmd ""] || ([string first \ [string index [$w cget -orient] 0] $orient] < 0)} { *************** *** 315,321 **** } } ! # tkScrollByPages -- # This procedure tells the scrollbar's associated widget to scroll up # or down by a given number of screenfuls. It notifies the associated # widget in different ways for old and new command syntaxes. --- 315,321 ---- } } ! # ::tk::ScrollByPages -- # This procedure tells the scrollbar's associated widget to scroll up # or down by a given number of screenfuls. It notifies the associated # widget in different ways for old and new command syntaxes. *************** *** 326,332 **** # horizontal, "v" for vertical, "hv" for both. # amount - How many screens to scroll: typically 1 or -1. ! proc tkScrollByPages {w orient amount} { set cmd [$w cget -command] if {[string equal $cmd ""] || ([string first \ [string index [$w cget -orient] 0] $orient] < 0)} { --- 326,332 ---- # horizontal, "v" for vertical, "hv" for both. # amount - How many screens to scroll: typically 1 or -1. ! proc ::tk::ScrollByPages {w orient amount} { set cmd [$w cget -command] if {[string equal $cmd ""] || ([string first \ [string index [$w cget -orient] 0] $orient] < 0)} { *************** *** 340,346 **** } } ! # tkScrollToPos -- # This procedure tells the scrollbar's associated widget to scroll to # a particular location, given by a fraction between 0 and 1. It notifies # the associated widget in different ways for old and new command syntaxes. --- 340,346 ---- } } ! # ::tk::ScrollToPos -- # This procedure tells the scrollbar's associated widget to scroll to # a particular location, given by a fraction between 0 and 1. It notifies # the associated widget in different ways for old and new command syntaxes. *************** *** 350,356 **** # pos - A fraction between 0 and 1 indicating a desired position # in the document. ! proc tkScrollToPos {w pos} { set cmd [$w cget -command] if {[string equal $cmd ""]} { return --- 350,356 ---- # pos - A fraction between 0 and 1 indicating a desired position # in the document. ! proc ::tk::ScrollToPos {w pos} { set cmd [$w cget -command] if {[string equal $cmd ""]} { return *************** *** 363,369 **** } } ! # tkScrollTopBottom # Scroll to the top or bottom of the document, depending on the mouse # position. # --- 363,369 ---- } } ! # ::tk::ScrollTopBottom # Scroll to the top or bottom of the document, depending on the mouse # position. # *************** *** 371,391 **** # w - The scrollbar widget. # x, y - Mouse coordinates within the widget. ! proc tkScrollTopBottom {w x y} { ! global tkPriv set element [$w identify $x $y] if {[string match *1 $element]} { ! tkScrollToPos $w 0 } elseif {[string match *2 $element]} { ! tkScrollToPos $w 1 } ! # Set tkPriv(relief), since it's needed by tkScrollButtonUp. ! set tkPriv(relief) [$w cget -activerelief] } ! # tkScrollButton2Down # This procedure is invoked when button 2 is pressed over a scrollbar. # If the button is over the trough or slider, it sets the scrollbar to # the mouse position and starts a slider drag. Otherwise it just --- 371,391 ---- # w - The scrollbar widget. # x, y - Mouse coordinates within the widget. ! proc ::tk::ScrollTopBottom {w x y} { ! variable ::tk::Priv set element [$w identify $x $y] if {[string match *1 $element]} { ! ScrollToPos $w 0 } elseif {[string match *2 $element]} { ! ScrollToPos $w 1 } ! # Set Priv(relief), since it's needed by tk::ScrollButtonUp. ! set Priv(relief) [$w cget -activerelief] } ! # ::tk::ScrollButton2Down # This procedure is invoked when button 2 is pressed over a scrollbar. # If the button is over the trough or slider, it sets the scrollbar to # the mouse position and starts a slider drag. Otherwise it just *************** *** 395,409 **** # w - The scrollbar widget. # x, y - Mouse coordinates within the widget. ! proc tkScrollButton2Down {w x y} { ! global tkPriv set element [$w identify $x $y] if {[string match {arrow[12]} $element]} { ! tkScrollButtonDown $w $x $y return } ! tkScrollToPos $w [$w fraction $x $y] ! set tkPriv(relief) [$w cget -activerelief] # Need the "update idletasks" below so that the widget calls us # back to reset the actual scrollbar position before we start the --- 395,409 ---- # w - The scrollbar widget. # x, y - Mouse coordinates within the widget. ! proc ::tk::ScrollButton2Down {w x y} { ! variable ::tk::Priv set element [$w identify $x $y] if {[string match {arrow[12]} $element]} { ! ScrollButtonDown $w $x $y return } ! ScrollToPos $w [$w fraction $x $y] ! set Priv(relief) [$w cget -activerelief] # Need the "update idletasks" below so that the widget calls us # back to reset the actual scrollbar position before we start the *************** *** 412,416 **** update idletasks $w configure -activerelief sunken $w activate slider ! tkScrollStartDrag $w $x $y } --- 412,416 ---- update idletasks $w configure -activerelief sunken $w activate slider ! ScrollStartDrag $w $x $y } Index: library/spinbox.tcl =================================================================== RCS file: /cvsroot/tk/library/spinbox.tcl,v retrieving revision 1.1 diff -c -r1.1 spinbox.tcl *** spinbox.tcl 2000/05/29 01:43:15 1.1 --- spinbox.tcl 2000/07/17 06:27:57 *************** *** 15,21 **** # #------------------------------------------------------------------------- ! # Elements of tkPriv that are used in this file: # # afterId - If non-null, it means that auto-scanning is underway # and it gives the "after" id for the next auto-scan --- 15,21 ---- # #------------------------------------------------------------------------- ! # Elements of tk::Priv that are used in this file: # # afterId - If non-null, it means that auto-scanning is underway # and it gives the "after" id for the next auto-scan *************** *** 38,55 **** # The code below creates the default class bindings for entries. #------------------------------------------------------------------------- bind Spinbox <> { ! if {![catch {::tk::spinbox::GetSelection %W} tkPriv(data)]} { clipboard clear -displayof %W ! clipboard append -displayof %W $tkPriv(data) %W delete sel.first sel.last ! unset tkPriv(data) } } bind Spinbox <> { ! if {![catch {::tk::spinbox::GetSelection %W} tkPriv(data)]} { clipboard clear -displayof %W ! clipboard append -displayof %W $tkPriv(data) ! unset tkPriv(data) } } bind Spinbox <> { --- 38,55 ---- # The code below creates the default class bindings for entries. #------------------------------------------------------------------------- bind Spinbox <> { ! if {![catch {::tk::spinbox::GetSelection %W} tk::Priv(data)]} { clipboard clear -displayof %W ! clipboard append -displayof %W $tk::Priv(data) %W delete sel.first sel.last ! unset tk::Priv(data) } } bind Spinbox <> { ! if {![catch {::tk::spinbox::GetSelection %W} tk::Priv(data)]} { clipboard clear -displayof %W ! clipboard append -displayof %W $tk::Priv(data) ! unset tk::Priv(data) } } bind Spinbox <> { *************** *** 68,74 **** %W delete sel.first sel.last } bind Spinbox <> { ! if {!$tkPriv(mouseMoved) || $tk_strictMotif} { ::tk::spinbox::Paste %W %x } } --- 68,74 ---- %W delete sel.first sel.last } bind Spinbox <> { ! if {!$tk::Priv(mouseMoved) || $tk_strictMotif} { ::tk::spinbox::Paste %W %x } } *************** *** 82,112 **** ::tk::spinbox::Motion %W %x %y } bind Spinbox { ! set tkPriv(selectMode) word ::tk::spinbox::MouseSelect %W %x sel.first } bind Spinbox { ! set tkPriv(selectMode) line ::tk::spinbox::MouseSelect %W %x 0 } bind Spinbox { ! set tkPriv(selectMode) char %W selection adjust @%x } bind Spinbox { ! set tkPriv(selectMode) word ::tk::spinbox::MouseSelect %W %x } bind Spinbox { ! set tkPriv(selectMode) line ::tk::spinbox::MouseSelect %W %x } bind Spinbox { ! set tkPriv(x) %x ::tk::spinbox::AutoScan %W } bind Spinbox { ! tkCancelRepeat } bind Spinbox { ::tk::spinbox::ButtonUp %W %x %y --- 82,112 ---- ::tk::spinbox::Motion %W %x %y } bind Spinbox { ! set tk::Priv(selectMode) word ::tk::spinbox::MouseSelect %W %x sel.first } bind Spinbox { ! set tk::Priv(selectMode) line ::tk::spinbox::MouseSelect %W %x 0 } bind Spinbox { ! set tk::Priv(selectMode) char %W selection adjust @%x } bind Spinbox { ! set tk::Priv(selectMode) word ::tk::spinbox::MouseSelect %W %x } bind Spinbox { ! set tk::Priv(selectMode) line ::tk::spinbox::MouseSelect %W %x } bind Spinbox { ! set tk::Priv(x) %x ::tk::spinbox::AutoScan %W } bind Spinbox { ! tk::CancelRepeat } bind Spinbox { ::tk::spinbox::ButtonUp %W %x %y *************** *** 295,309 **** bind Spinbox <2> { if {!$tk_strictMotif} { %W scan mark %x ! set tkPriv(x) %x ! set tkPriv(y) %y ! set tkPriv(mouseMoved) 0 } } bind Spinbox { if {!$tk_strictMotif} { ! if {abs(%x-$tkPriv(x)) > 2} { ! set tkPriv(mouseMoved) 1 } %W scan dragto %x } --- 295,309 ---- bind Spinbox <2> { if {!$tk_strictMotif} { %W scan mark %x ! set tk::Priv(x) %x ! set tk::Priv(y) %y ! set tk::Priv(mouseMoved) 0 } } bind Spinbox { if {!$tk_strictMotif} { ! if {abs(%x-$tk::Priv(x)) > 2} { ! set tk::Priv(mouseMoved) 1 } %W scan dragto %x } *************** *** 317,331 **** # elem - Element to invoke proc ::tk::spinbox::Invoke {w elem} { ! global tkPriv ! if {![info exists tkPriv(outsideElement)]} { $w invoke $elem ! incr tkPriv(repeated) } set delay [$w cget -repeatinterval] if {$delay > 0} { ! set tkPriv(afterId) [after $delay \ [list ::tk::spinbox::Invoke $w $elem]] } } --- 317,331 ---- # elem - Element to invoke proc ::tk::spinbox::Invoke {w elem} { ! variable ::tk::Priv ! if {![info exists Priv(outsideElement)]} { $w invoke $elem ! incr Priv(repeated) } set delay [$w cget -repeatinterval] if {$delay > 0} { ! set Priv(afterId) [after $delay \ [list ::tk::spinbox::Invoke $w $elem]] } } *************** *** 358,401 **** # x - The x-coordinate of the button press. proc ::tk::spinbox::ButtonDown {w x y} { ! global tkPriv # Get the element that was clicked in. If we are not directly over # the spinbox, default to entry. This is necessary for spinbox grabs. # ! set tkPriv(element) [$w identify $x $y] ! if {$tkPriv(element) eq ""} { ! set tkPriv(element) "entry" } ! switch -exact $tkPriv(element) { "buttonup" - "buttondown" { if {[string compare "disabled" [$w cget -state]]} { ! $w selection element $tkPriv(element) ! set tkPriv(repeated) 0 ! set tkPriv(relief) [$w cget -$tkPriv(element)relief] ! after cancel $tkPriv(afterId) set delay [$w cget -repeatdelay] if {$delay > 0} { ! set tkPriv(afterId) [after $delay \ ! [list ::tk::spinbox::Invoke $w $tkPriv(element)]] } ! if {[info exists tkPriv(outsideElement)]} { ! unset tkPriv(outsideElement) } } } "entry" { ! set tkPriv(selectMode) char ! set tkPriv(mouseMoved) 0 ! set tkPriv(pressX) $x $w icursor [::tk::spinbox::ClosestGap $w $x] $w selection from insert if {[string compare "disabled" [$w cget -state]]} {focus $w} $w selection clear } default { ! return -code error "unknown spinbox element \"$tkPriv(element)\"" } } } --- 358,401 ---- # x - The x-coordinate of the button press. proc ::tk::spinbox::ButtonDown {w x y} { ! variable ::tk::Priv # Get the element that was clicked in. If we are not directly over # the spinbox, default to entry. This is necessary for spinbox grabs. # ! set Priv(element) [$w identify $x $y] ! if {$Priv(element) eq ""} { ! set Priv(element) "entry" } ! switch -exact $Priv(element) { "buttonup" - "buttondown" { if {[string compare "disabled" [$w cget -state]]} { ! $w selection element $Priv(element) ! set Priv(repeated) 0 ! set Priv(relief) [$w cget -$Priv(element)relief] ! after cancel $Priv(afterId) set delay [$w cget -repeatdelay] if {$delay > 0} { ! set Priv(afterId) [after $delay \ ! [list ::tk::spinbox::Invoke $w $Priv(element)]] } ! if {[info exists Priv(outsideElement)]} { ! unset Priv(outsideElement) } } } "entry" { ! set Priv(selectMode) char ! set Priv(mouseMoved) 0 ! set Priv(pressX) $x $w icursor [::tk::spinbox::ClosestGap $w $x] $w selection from insert if {[string compare "disabled" [$w cget -state]]} {focus $w} $w selection clear } default { ! return -code error "unknown spinbox element \"$Priv(element)\"" } } } *************** *** 409,426 **** # x - The x-coordinate of the button press. proc ::tk::spinbox::ButtonUp {w x y} { ! global tkPriv ! tkCancelRepeat ! # tkPriv(relief) may not exist if the ButtonUp is not paired with # a preceding ButtonDown ! if {[info exists tkPriv(element)] && [info exists tkPriv(relief)] && \ ! [string match "button*" $tkPriv(element)]} { ! if {[info exists tkPriv(repeated)] && !$tkPriv(repeated)} { ! $w invoke $tkPriv(element) } ! $w configure -$tkPriv(element)relief $tkPriv(relief) $w selection element none } } --- 409,426 ---- # x - The x-coordinate of the button press. proc ::tk::spinbox::ButtonUp {w x y} { ! variable ::tk::Priv ! ::tk::CancelRepeat ! # Priv(relief) may not exist if the ButtonUp is not paired with # a preceding ButtonDown ! if {[info exists Priv(element)] && [info exists Priv(relief)] && \ ! [string match "button*" $Priv(element)]} { ! if {[info exists Priv(repeated)] && !$Priv(repeated)} { ! $w invoke $Priv(element) } ! $w configure -$Priv(element)relief $Priv(relief) $w selection element none } } *************** *** 438,462 **** # cursor - optional place to set cursor. proc ::tk::spinbox::MouseSelect {w x {cursor {}}} { ! global tkPriv ! if {[string compare "entry" $tkPriv(element)]} { ! if {[string compare "none" $tkPriv(element)] && \ [string compare "ignore" $cursor]} { $w selection element none ! $w invoke $tkPriv(element) ! $w selection element $tkPriv(element) } return } set cur [::tk::spinbox::ClosestGap $w $x] set anchor [$w index anchor] ! if {($cur != $anchor) || (abs($tkPriv(pressX) - $x) >= 3)} { ! set tkPriv(mouseMoved) 1 } ! switch $tkPriv(selectMode) { char { ! if {$tkPriv(mouseMoved)} { if {$cur < $anchor} { $w selection range $cur $anchor } elseif {$cur > $anchor} { --- 438,462 ---- # cursor - optional place to set cursor. proc ::tk::spinbox::MouseSelect {w x {cursor {}}} { ! variable ::tk::Priv ! if {[string compare "entry" $Priv(element)]} { ! if {[string compare "none" $Priv(element)] && \ [string compare "ignore" $cursor]} { $w selection element none ! $w invoke $Priv(element) ! $w selection element $Priv(element) } return } set cur [::tk::spinbox::ClosestGap $w $x] set anchor [$w index anchor] ! if {($cur != $anchor) || (abs($Priv(pressX) - $x) >= 3)} { ! set Priv(mouseMoved) 1 } ! switch $Priv(selectMode) { char { ! if {$Priv(mouseMoved)} { if {$cur < $anchor} { $w selection range $cur $anchor } elseif {$cur > $anchor} { *************** *** 501,507 **** # x - X position of the mouse. proc ::tk::spinbox::Paste {w x} { - global tkPriv $w icursor [::tk::spinbox::ClosestGap $w $x] catch {$w insert insert [selection get -displayof $w]} --- 501,506 ---- *************** *** 516,541 **** # w - The spinbox window. proc ::tk::spinbox::Motion {w x y} { ! global tkPriv ! if {![info exists tkPriv(element)]} { ! set tkPriv(element) [$w identify $x $y] } ! set tkPriv(x) $x ! if {[string equal "entry" $tkPriv(element)]} { ::tk::spinbox::MouseSelect $w $x ignore ! } elseif {[string compare [$w identify $x $y] $tkPriv(element)]} { ! if {![info exists tkPriv(outsideElement)]} { # We've wandered out of the spin button # setting outside element will cause ::tk::spinbox::Invoke to # loop without doing anything ! set tkPriv(outsideElement) "" $w selection element none } ! } elseif {[info exists tkPriv(outsideElement)]} { ! unset tkPriv(outsideElement) ! $w selection element $tkPriv(element) } } --- 515,540 ---- # w - The spinbox window. proc ::tk::spinbox::Motion {w x y} { ! variable ::tk::Priv ! if {![info exists Priv(element)]} { ! set Priv(element) [$w identify $x $y] } ! set Priv(x) $x ! if {[string equal "entry" $Priv(element)]} { ::tk::spinbox::MouseSelect $w $x ignore ! } elseif {[string compare [$w identify $x $y] $Priv(element)]} { ! if {![info exists Priv(outsideElement)]} { # We've wandered out of the spin button # setting outside element will cause ::tk::spinbox::Invoke to # loop without doing anything ! set Priv(outsideElement) "" $w selection element none } ! } elseif {[info exists Priv(outsideElement)]} { ! unset Priv(outsideElement) ! $w selection element $Priv(element) } } *************** *** 550,558 **** # w - The spinbox window. proc ::tk::spinbox::AutoScan {w} { ! global tkPriv ! set x $tkPriv(x) if {$x >= [winfo width $w]} { $w xview scroll 2 units ::tk::spinbox::MouseSelect $w $x ignore --- 549,557 ---- # w - The spinbox window. proc ::tk::spinbox::AutoScan {w} { ! variable ::tk::Priv ! set x $Priv(x) if {$x >= [winfo width $w]} { $w xview scroll 2 units ::tk::spinbox::MouseSelect $w $x ignore *************** *** 560,566 **** $w xview scroll -2 units ::tk::spinbox::MouseSelect $w $x ignore } ! set tkPriv(afterId) [after 50 [list ::tk::spinbox::AutoScan $w]] } # ::tk::spinbox::KeySelect -- --- 559,565 ---- $w xview scroll -2 units ::tk::spinbox::MouseSelect $w $x ignore } ! set Priv(afterId) [after 50 [list ::tk::spinbox::AutoScan $w]] } # ::tk::spinbox::KeySelect -- Index: library/tclIndex =================================================================== RCS file: /cvsroot/tk/library/tclIndex,v retrieving revision 1.5 diff -c -r1.5 tclIndex *** tclIndex 2000/03/24 19:38:57 1.5 --- tclIndex 2000/07/17 06:28:01 *************** *** 6,218 **** # element name is the name of a command and the value is # a script that loads the command. ! set auto_index(tkButtonEnter) [list source [file join $dir button.tcl]] ! set auto_index(tkButtonLeave) [list source [file join $dir button.tcl]] ! set auto_index(tkCheckRadioEnter) [list source [file join $dir button.tcl]] ! set auto_index(tkButtonDown) [list source [file join $dir button.tcl]] ! set auto_index(tkCheckRadioDown) [list source [file join $dir button.tcl]] ! set auto_index(tkButtonUp) [list source [file join $dir button.tcl]] ! set auto_index(tkButtonEnter) [list source [file join $dir button.tcl]] ! set auto_index(tkButtonLeave) [list source [file join $dir button.tcl]] ! set auto_index(tkButtonDown) [list source [file join $dir button.tcl]] ! set auto_index(tkButtonUp) [list source [file join $dir button.tcl]] ! set auto_index(tkButtonEnter) [list source [file join $dir button.tcl]] ! set auto_index(tkButtonLeave) [list source [file join $dir button.tcl]] ! set auto_index(tkButtonDown) [list source [file join $dir button.tcl]] ! set auto_index(tkButtonUp) [list source [file join $dir button.tcl]] ! set auto_index(tkButtonInvoke) [list source [file join $dir button.tcl]] ! set auto_index(tkCheckRadioInvoke) [list source [file join $dir button.tcl]] set auto_index(tk_dialog) [list source [file join $dir dialog.tcl]] ! set auto_index(tkEntryClosestGap) [list source [file join $dir entry.tcl]] ! set auto_index(tkEntryButton1) [list source [file join $dir entry.tcl]] ! set auto_index(tkEntryMouseSelect) [list source [file join $dir entry.tcl]] ! set auto_index(tkEntryPaste) [list source [file join $dir entry.tcl]] ! set auto_index(tkEntryAutoScan) [list source [file join $dir entry.tcl]] ! set auto_index(tkEntryKeySelect) [list source [file join $dir entry.tcl]] ! set auto_index(tkEntryInsert) [list source [file join $dir entry.tcl]] ! set auto_index(tkEntryBackspace) [list source [file join $dir entry.tcl]] ! set auto_index(tkEntrySeeInsert) [list source [file join $dir entry.tcl]] ! set auto_index(tkEntrySetCursor) [list source [file join $dir entry.tcl]] ! set auto_index(tkEntryTranspose) [list source [file join $dir entry.tcl]] ! set auto_index(tkEntryPreviousWord) [list source [file join $dir entry.tcl]] ! set auto_index(tkListboxBeginSelect) [list source [file join $dir listbox.tcl]] ! set auto_index(tkListboxMotion) [list source [file join $dir listbox.tcl]] ! set auto_index(tkListboxBeginExtend) [list source [file join $dir listbox.tcl]] ! set auto_index(tkListboxBeginToggle) [list source [file join $dir listbox.tcl]] ! set auto_index(tkListboxAutoScan) [list source [file join $dir listbox.tcl]] ! set auto_index(tkListboxUpDown) [list source [file join $dir listbox.tcl]] ! set auto_index(tkListboxExtendUpDown) [list source [file join $dir listbox.tcl]] ! set auto_index(tkListboxDataExtend) [list source [file join $dir listbox.tcl]] ! set auto_index(tkListboxCancel) [list source [file join $dir listbox.tcl]] ! set auto_index(tkListboxSelectAll) [list source [file join $dir listbox.tcl]] ! set auto_index(tkMbEnter) [list source [file join $dir menu.tcl]] ! set auto_index(tkMbLeave) [list source [file join $dir menu.tcl]] ! set auto_index(tkMbPost) [list source [file join $dir menu.tcl]] ! set auto_index(tkMenuUnpost) [list source [file join $dir menu.tcl]] ! set auto_index(tkMbMotion) [list source [file join $dir menu.tcl]] ! set auto_index(tkMbButtonUp) [list source [file join $dir menu.tcl]] ! set auto_index(tkMenuMotion) [list source [file join $dir menu.tcl]] ! set auto_index(tkMenuButtonDown) [list source [file join $dir menu.tcl]] ! set auto_index(tkMenuLeave) [list source [file join $dir menu.tcl]] ! set auto_index(tkMenuInvoke) [list source [file join $dir menu.tcl]] ! set auto_index(tkMenuEscape) [list source [file join $dir menu.tcl]] ! set auto_index(tkMenuUpArrow) [list source [file join $dir menu.tcl]] ! set auto_index(tkMenuDownArrow) [list source [file join $dir menu.tcl]] ! set auto_index(tkMenuLeftArrow) [list source [file join $dir menu.tcl]] ! set auto_index(tkMenuRightArrow) [list source [file join $dir menu.tcl]] ! set auto_index(tkMenuNextMenu) [list source [file join $dir menu.tcl]] ! set auto_index(tkMenuNextEntry) [list source [file join $dir menu.tcl]] ! set auto_index(tkMenuFind) [list source [file join $dir menu.tcl]] ! set auto_index(tkTraverseToMenu) [list source [file join $dir menu.tcl]] ! set auto_index(tkFirstMenu) [list source [file join $dir menu.tcl]] ! set auto_index(tkTraverseWithinMenu) [list source [file join $dir menu.tcl]] ! set auto_index(tkMenuFirstEntry) [list source [file join $dir menu.tcl]] ! set auto_index(tkMenuFindName) [list source [file join $dir menu.tcl]] ! set auto_index(tkPostOverPoint) [list source [file join $dir menu.tcl]] ! set auto_index(tkSaveGrabInfo) [list source [file join $dir menu.tcl]] ! set auto_index(tkRestoreOldGrab) [list source [file join $dir menu.tcl]] set auto_index(tk_menuSetFocus) [list source [file join $dir menu.tcl]] ! set auto_index(tkGenerateMenuSelect) [list source [file join $dir menu.tcl]] set auto_index(tk_popup) [list source [file join $dir menu.tcl]] ! set auto_index(tkScrollButtonDown) [list source [file join $dir scrlbar.tcl]] ! set auto_index(tkScrollButtonUp) [list source [file join $dir scrlbar.tcl]] ! set auto_index(tkScrollSelect) [list source [file join $dir scrlbar.tcl]] ! set auto_index(tkScrollStartDrag) [list source [file join $dir scrlbar.tcl]] ! set auto_index(tkScrollDrag) [list source [file join $dir scrlbar.tcl]] ! set auto_index(tkScrollEndDrag) [list source [file join $dir scrlbar.tcl]] ! set auto_index(tkScrollByUnits) [list source [file join $dir scrlbar.tcl]] ! set auto_index(tkScrollByPages) [list source [file join $dir scrlbar.tcl]] ! set auto_index(tkScrollToPos) [list source [file join $dir scrlbar.tcl]] ! set auto_index(tkScrollTopBottom) [list source [file join $dir scrlbar.tcl]] ! set auto_index(tkScrollButton2Down) [list source [file join $dir scrlbar.tcl]] ! set auto_index(tkTextClosestGap) [list source [file join $dir text.tcl]] ! set auto_index(tkTextButton1) [list source [file join $dir text.tcl]] ! set auto_index(tkTextSelectTo) [list source [file join $dir text.tcl]] ! set auto_index(tkTextKeyExtend) [list source [file join $dir text.tcl]] ! set auto_index(tkTextPaste) [list source [file join $dir text.tcl]] ! set auto_index(tkTextAutoScan) [list source [file join $dir text.tcl]] ! set auto_index(tkTextSetCursor) [list source [file join $dir text.tcl]] ! set auto_index(tkTextKeySelect) [list source [file join $dir text.tcl]] ! set auto_index(tkTextResetAnchor) [list source [file join $dir text.tcl]] ! set auto_index(tkTextInsert) [list source [file join $dir text.tcl]] ! set auto_index(tkTextUpDownLine) [list source [file join $dir text.tcl]] ! set auto_index(tkTextPrevPara) [list source [file join $dir text.tcl]] ! set auto_index(tkTextNextPara) [list source [file join $dir text.tcl]] ! set auto_index(tkTextScrollPages) [list source [file join $dir text.tcl]] ! set auto_index(tkTextTranspose) [list source [file join $dir text.tcl]] ! set auto_index(tk_textCopy) [list source [file join $dir text.tcl]] ! set auto_index(tk_textCut) [list source [file join $dir text.tcl]] ! set auto_index(tk_textPaste) [list source [file join $dir text.tcl]] ! set auto_index(tkTextNextPos) [list source [file join $dir text.tcl]] ! set auto_index(tkTextPrevPos) [list source [file join $dir text.tcl]] ! set auto_index(tkScreenChanged) [list source [file join $dir tk.tcl]] ! set auto_index(tkEventMotifBindings) [list source [file join $dir tk.tcl]] ! set auto_index(tkCancelRepeat) [list source [file join $dir tk.tcl]] ! set auto_index(tkTabToWindow) [list source [file join $dir tk.tcl]] ! set auto_index(bgerror) [list source [file join $dir bgerror.tcl]] ! set auto_index(tkScaleActivate) [list source [file join $dir scale.tcl]] ! set auto_index(tkScaleButtonDown) [list source [file join $dir scale.tcl]] ! set auto_index(tkScaleDrag) [list source [file join $dir scale.tcl]] ! set auto_index(tkScaleEndDrag) [list source [file join $dir scale.tcl]] ! set auto_index(tkScaleIncrement) [list source [file join $dir scale.tcl]] ! set auto_index(tkScaleControlPress) [list source [file join $dir scale.tcl]] ! set auto_index(tkScaleButton2Down) [list source [file join $dir scale.tcl]] ! set auto_index(tk_optionMenu) [list source [file join $dir optMenu.tcl]] ! set auto_index(tkTearOffMenu) [list source [file join $dir tearoff.tcl]] ! set auto_index(tkMenuDup) [list source [file join $dir tearoff.tcl]] set auto_index(tk_menuBar) [list source [file join $dir obsolete.tcl]] set auto_index(tk_bindForTraversal) [list source [file join $dir obsolete.tcl]] ! set auto_index(tk_focusNext) [list source [file join $dir focus.tcl]] ! set auto_index(tk_focusPrev) [list source [file join $dir focus.tcl]] ! set auto_index(tkFocusOK) [list source [file join $dir focus.tcl]] ! set auto_index(tk_focusFollowsMouse) [list source [file join $dir focus.tcl]] ! set auto_index(tkConsoleInit) [list source [file join $dir console.tcl]] ! set auto_index(tkConsoleSource) [list source [file join $dir console.tcl]] ! set auto_index(tkConsoleInvoke) [list source [file join $dir console.tcl]] ! set auto_index(tkConsoleHistory) [list source [file join $dir console.tcl]] ! set auto_index(tkConsolePrompt) [list source [file join $dir console.tcl]] ! set auto_index(tkConsoleBind) [list source [file join $dir console.tcl]] ! set auto_index(tkConsoleInsert) [list source [file join $dir console.tcl]] ! set auto_index(tkConsoleOutput) [list source [file join $dir console.tcl]] ! set auto_index(tkConsoleExit) [list source [file join $dir console.tcl]] ! set auto_index(tkConsoleAbout) [list source [file join $dir console.tcl]] set auto_index(tk_setPalette) [list source [file join $dir palette.tcl]] ! set auto_index(tkRecolorTree) [list source [file join $dir palette.tcl]] ! set auto_index(tkDarken) [list source [file join $dir palette.tcl]] set auto_index(tk_bisque) [list source [file join $dir palette.tcl]] ! set auto_index(tkColorDialog) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_InitValues) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_Config) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_BuildDialog) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_SetRGBValue) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_XToRgb) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_RgbToX) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_DrawColorScale) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_CreateSelector) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_RedrawFinalColor) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_RedrawColorBars) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_StartMove) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_MoveSelector) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_ReleaseMouse) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_ResizeColorBars) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_HandleSelEntry) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_HandleRGBEntry) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_EnterColorBar) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_LeaveColorBar) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_OkCmd) [list source [file join $dir clrpick.tcl]] ! set auto_index(tkColorDialog_CancelCmd) [list source [file join $dir clrpick.tcl]] ! set auto_index(tclParseConfigSpec) [list source [file join $dir comdlg.tcl]] ! set auto_index(tclListValidFlags) [list source [file join $dir comdlg.tcl]] ! set auto_index(tclSortNoCase) [list source [file join $dir comdlg.tcl]] ! set auto_index(tclVerifyInteger) [list source [file join $dir comdlg.tcl]] ! set auto_index(tkFocusGroup_Create) [list source [file join $dir comdlg.tcl]] ! set auto_index(tkFocusGroup_BindIn) [list source [file join $dir comdlg.tcl]] ! set auto_index(tkFocusGroup_BindOut) [list source [file join $dir comdlg.tcl]] ! set auto_index(tkFocusGroup_Destroy) [list source [file join $dir comdlg.tcl]] ! set auto_index(tkFocusGroup_In) [list source [file join $dir comdlg.tcl]] ! set auto_index(tkFocusGroup_Out) [list source [file join $dir comdlg.tcl]] ! set auto_index(tkFDGetFileTypes) [list source [file join $dir comdlg.tcl]] set auto_index(::safe::loadTk) [list source [file join $dir safetk.tcl]] set auto_index(::safe::TkInit) [list source [file join $dir safetk.tcl]] set auto_index(::safe::allowTk) [list source [file join $dir safetk.tcl]] set auto_index(::safe::tkTopLevel) [list source [file join $dir safetk.tcl]] ! set auto_index(tkMessageBox) [list source [file join $dir msgbox.tcl]] ! set auto_index(tkIconList) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_Config) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_Create) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_AutoScan) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_DeleteAll) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_Add) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_Arrange) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_Invoke) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_See) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_SelectAtXY) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_Select) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_Unselect) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_Get) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_Btn1) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_Motion1) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_Double1) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_ReturnKey) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_Leave1) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_FocusIn) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_UpDown) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_LeftRight) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_KeyPress) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_Goto) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkIconList_Reset) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::tkFDialog) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::Config) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::Create) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::UpdateWhenIdle) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::Update) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::SetPathSilently) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::SetPath) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::SetFilter) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkFDialogResolveFile) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::EntFocusIn) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::EntFocusOut) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::ActivateEnt) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::InvokeBtn) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::UpDirCmd) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::JoinFile) [list source [file join $dir tkfbox.tcl]] --- 6,243 ---- # element name is the name of a command and the value is # a script that loads the command. ! set auto_index(::tk::dialog::error::Return) [list source [file join $dir bgerror.tcl]] ! set auto_index(::tk::dialog::error::details) [list source [file join $dir bgerror.tcl]] ! set auto_index(::tk::dialog::error::evalFunction) [list source [file join $dir bgerror.tcl]] ! set auto_index(::tk::dialog::error::saveToLog) [list source [file join $dir bgerror.tcl]] ! set auto_index(::tk::dialog::error::Destroy) [list source [file join $dir bgerror.tcl]] ! set auto_index(bgerror) [list source [file join $dir bgerror.tcl]] ! set auto_index(::tk::ButtonInvoke) [list source [file join $dir button.tcl]] ! set auto_index(::tk::ButtonAutoInvoke) [list source [file join $dir button.tcl]] ! set auto_index(::tk::CheckRadioInvoke) [list source [file join $dir button.tcl]] ! set auto_index(::tk::dialog::file::chooseDir::tkChooseDirectory) [list source [file join $dir choosedir.tcl]] ! set auto_index(::tk::dialog::file::chooseDir::Config) [list source [file join $dir choosedir.tcl]] ! set auto_index(::tk::dialog::file::chooseDir::OkCmd) [list source [file join $dir choosedir.tcl]] ! set auto_index(::tk::dialog::file::chooseDir::DblClick) [list source [file join $dir choosedir.tcl]] ! set auto_index(::tk::dialog::file::chooseDir::ListBrowse) [list source [file join $dir choosedir.tcl]] ! set auto_index(::tk::dialog::file::chooseDir::Done) [list source [file join $dir choosedir.tcl]] ! set auto_index(::tk::dialog::color::) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::InitValues) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::Config) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::BuildDialog) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::SetRGBValue) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::XToRgb) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::RgbToX) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::DrawColorScale) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::CreateSelector) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::RedrawFinalColor) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::RedrawColorBars) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::StartMove) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::MoveSelector) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::ReleaseMouse) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::ResizeColorBars) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::HandleSelEntry) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::HandleRGBEntry) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::EnterColorBar) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::LeaveColorBar) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::OkCmd) [list source [file join $dir clrpick.tcl]] ! set auto_index(::tk::dialog::color::CancelCmd) [list source [file join $dir clrpick.tcl]] ! set auto_index(tclParseConfigSpec) [list source [file join $dir comdlg.tcl]] ! set auto_index(tclListValidFlags) [list source [file join $dir comdlg.tcl]] ! set auto_index(::tk::FocusGroup_Create) [list source [file join $dir comdlg.tcl]] ! set auto_index(::tk::FocusGroup_BindIn) [list source [file join $dir comdlg.tcl]] ! set auto_index(::tk::FocusGroup_BindOut) [list source [file join $dir comdlg.tcl]] ! set auto_index(::tk::FocusGroup_Destroy) [list source [file join $dir comdlg.tcl]] ! set auto_index(::tk::FocusGroup_In) [list source [file join $dir comdlg.tcl]] ! set auto_index(::tk::FocusGroup_Out) [list source [file join $dir comdlg.tcl]] ! set auto_index(::tk::FDGetFileTypes) [list source [file join $dir comdlg.tcl]] ! set auto_index(::tk::ConsoleInit) [list source [file join $dir console.tcl]] ! set auto_index(::tk::ConsoleSource) [list source [file join $dir console.tcl]] ! set auto_index(::tk::ConsoleInvoke) [list source [file join $dir console.tcl]] ! set auto_index(::tk::ConsoleHistory) [list source [file join $dir console.tcl]] ! set auto_index(::tk::ConsolePrompt) [list source [file join $dir console.tcl]] ! set auto_index(::tk::ConsoleBind) [list source [file join $dir console.tcl]] ! set auto_index(::tk::ConsoleInsert) [list source [file join $dir console.tcl]] ! set auto_index(::tk::ConsoleOutput) [list source [file join $dir console.tcl]] ! set auto_index(::tk::ConsoleExit) [list source [file join $dir console.tcl]] ! set auto_index(::tk::ConsoleAbout) [list source [file join $dir console.tcl]] set auto_index(tk_dialog) [list source [file join $dir dialog.tcl]] ! set auto_index(::tk::EntryClosestGap) [list source [file join $dir entry.tcl]] ! set auto_index(::tk::EntryButton1) [list source [file join $dir entry.tcl]] ! set auto_index(::tk::EntryMouseSelect) [list source [file join $dir entry.tcl]] ! set auto_index(::tk::EntryPaste) [list source [file join $dir entry.tcl]] ! set auto_index(::tk::EntryAutoScan) [list source [file join $dir entry.tcl]] ! set auto_index(::tk::EntryKeySelect) [list source [file join $dir entry.tcl]] ! set auto_index(::tk::EntryInsert) [list source [file join $dir entry.tcl]] ! set auto_index(::tk::EntryBackspace) [list source [file join $dir entry.tcl]] ! set auto_index(::tk::EntrySeeInsert) [list source [file join $dir entry.tcl]] ! set auto_index(::tk::EntrySetCursor) [list source [file join $dir entry.tcl]] ! set auto_index(::tk::EntryTranspose) [list source [file join $dir entry.tcl]] ! set auto_index(::tk::EntryPreviousWord) [list source [file join $dir entry.tcl]] ! set auto_index(::tk::EntryGetSelection) [list source [file join $dir entry.tcl]] ! set auto_index(tk_focusNext) [list source [file join $dir focus.tcl]] ! set auto_index(tk_focusPrev) [list source [file join $dir focus.tcl]] ! set auto_index(::tk::FocusOK) [list source [file join $dir focus.tcl]] ! set auto_index(tk_focusFollowsMouse) [list source [file join $dir focus.tcl]] ! set auto_index(::tk::ListboxBeginSelect) [list source [file join $dir listbox.tcl]] ! set auto_index(::tk::ListboxMotion) [list source [file join $dir listbox.tcl]] ! set auto_index(::tk::ListboxBeginExtend) [list source [file join $dir listbox.tcl]] ! set auto_index(::tk::ListboxBeginToggle) [list source [file join $dir listbox.tcl]] ! set auto_index(::tk::ListboxAutoScan) [list source [file join $dir listbox.tcl]] ! set auto_index(::tk::ListboxUpDown) [list source [file join $dir listbox.tcl]] ! set auto_index(::tk::ListboxExtendUpDown) [list source [file join $dir listbox.tcl]] ! set auto_index(::tk::ListboxDataExtend) [list source [file join $dir listbox.tcl]] ! set auto_index(::tk::ListboxCancel) [list source [file join $dir listbox.tcl]] ! set auto_index(::tk::ListboxSelectAll) [list source [file join $dir listbox.tcl]] ! set auto_index(::tk::MbEnter) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MbLeave) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MbPost) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MenuUnpost) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MbMotion) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MbButtonUp) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MenuMotion) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MenuButtonDown) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MenuLeave) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MenuInvoke) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MenuEscape) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MenuUpArrow) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MenuDownArrow) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MenuLeftArrow) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MenuRightArrow) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MenuNextMenu) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MenuNextEntry) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MenuFind) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::TraverseToMenu) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::FirstMenu) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::TraverseWithinMenu) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MenuFirstEntry) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MenuFindName) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::PostOverPoint) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::SaveGrabInfo) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::RestoreOldGrab) [list source [file join $dir menu.tcl]] set auto_index(tk_menuSetFocus) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::GenerateMenuSelect) [list source [file join $dir menu.tcl]] set auto_index(tk_popup) [list source [file join $dir menu.tcl]] ! set auto_index(::tk::MessageBox) [list source [file join $dir msgbox.tcl]] set auto_index(tk_menuBar) [list source [file join $dir obsolete.tcl]] set auto_index(tk_bindForTraversal) [list source [file join $dir obsolete.tcl]] ! set auto_index(tk_optionMenu) [list source [file join $dir optMenu.tcl]] set auto_index(tk_setPalette) [list source [file join $dir palette.tcl]] ! set auto_index(::tk::RecolorTree) [list source [file join $dir palette.tcl]] ! set auto_index(::tk::Darken) [list source [file join $dir palette.tcl]] set auto_index(tk_bisque) [list source [file join $dir palette.tcl]] ! set auto_index(::safe::tkInterpInit) [list source [file join $dir safetk.tcl]] set auto_index(::safe::loadTk) [list source [file join $dir safetk.tcl]] set auto_index(::safe::TkInit) [list source [file join $dir safetk.tcl]] set auto_index(::safe::allowTk) [list source [file join $dir safetk.tcl]] + set auto_index(::safe::disallowTk) [list source [file join $dir safetk.tcl]] + set auto_index(::safe::tkDelete) [list source [file join $dir safetk.tcl]] set auto_index(::safe::tkTopLevel) [list source [file join $dir safetk.tcl]] ! set auto_index(::tk::ScaleActivate) [list source [file join $dir scale.tcl]] ! set auto_index(::tk::ScaleButtonDown) [list source [file join $dir scale.tcl]] ! set auto_index(::tk::ScaleDrag) [list source [file join $dir scale.tcl]] ! set auto_index(::tk::ScaleEndDrag) [list source [file join $dir scale.tcl]] ! set auto_index(::tk::ScaleIncrement) [list source [file join $dir scale.tcl]] ! set auto_index(::tk::ScaleControlPress) [list source [file join $dir scale.tcl]] ! set auto_index(::tk::ScaleButton2Down) [list source [file join $dir scale.tcl]] ! set auto_index(::tk::ScrollButtonDown) [list source [file join $dir scrlbar.tcl]] ! set auto_index(::tk::ScrollButtonUp) [list source [file join $dir scrlbar.tcl]] ! set auto_index(::tk::ScrollSelect) [list source [file join $dir scrlbar.tcl]] ! set auto_index(::tk::ScrollStartDrag) [list source [file join $dir scrlbar.tcl]] ! set auto_index(::tk::ScrollDrag) [list source [file join $dir scrlbar.tcl]] ! set auto_index(::tk::ScrollEndDrag) [list source [file join $dir scrlbar.tcl]] ! set auto_index(::tk::ScrollByUnits) [list source [file join $dir scrlbar.tcl]] ! set auto_index(::tk::ScrollByPages) [list source [file join $dir scrlbar.tcl]] ! set auto_index(::tk::ScrollToPos) [list source [file join $dir scrlbar.tcl]] ! set auto_index(::tk::ScrollTopBottom) [list source [file join $dir scrlbar.tcl]] ! set auto_index(::tk::ScrollButton2Down) [list source [file join $dir scrlbar.tcl]] ! set auto_index(::tk::spinbox::Invoke) [list source [file join $dir spinbox.tcl]] ! set auto_index(::tk::spinbox::ClosestGap) [list source [file join $dir spinbox.tcl]] ! set auto_index(::tk::spinbox::ButtonDown) [list source [file join $dir spinbox.tcl]] ! set auto_index(::tk::spinbox::ButtonUp) [list source [file join $dir spinbox.tcl]] ! set auto_index(::tk::spinbox::MouseSelect) [list source [file join $dir spinbox.tcl]] ! set auto_index(::tk::spinbox::Paste) [list source [file join $dir spinbox.tcl]] ! set auto_index(::tk::spinbox::Motion) [list source [file join $dir spinbox.tcl]] ! set auto_index(::tk::spinbox::AutoScan) [list source [file join $dir spinbox.tcl]] ! set auto_index(::tk::spinbox::KeySelect) [list source [file join $dir spinbox.tcl]] ! set auto_index(::tk::spinbox::Insert) [list source [file join $dir spinbox.tcl]] ! set auto_index(::tk::spinbox::Backspace) [list source [file join $dir spinbox.tcl]] ! set auto_index(::tk::spinbox::SeeInsert) [list source [file join $dir spinbox.tcl]] ! set auto_index(::tk::spinbox::SetCursor) [list source [file join $dir spinbox.tcl]] ! set auto_index(::tk::spinbox::Transpose) [list source [file join $dir spinbox.tcl]] ! set auto_index(::tk::spinbox::PreviousWord) [list source [file join $dir spinbox.tcl]] ! set auto_index(::tk::spinbox::GetSelection) [list source [file join $dir spinbox.tcl]] ! set auto_index(::tk::TearOffMenu) [list source [file join $dir tearoff.tcl]] ! set auto_index(::tk::MenuDup) [list source [file join $dir tearoff.tcl]] ! set auto_index(::tk::TextClosestGap) [list source [file join $dir text.tcl]] ! set auto_index(::tk::TextButton1) [list source [file join $dir text.tcl]] ! set auto_index(::tk::TextSelectTo) [list source [file join $dir text.tcl]] ! set auto_index(::tk::TextKeyExtend) [list source [file join $dir text.tcl]] ! set auto_index(::tk::TextPaste) [list source [file join $dir text.tcl]] ! set auto_index(::tk::TextAutoScan) [list source [file join $dir text.tcl]] ! set auto_index(::tk::TextSetCursor) [list source [file join $dir text.tcl]] ! set auto_index(::tk::TextKeySelect) [list source [file join $dir text.tcl]] ! set auto_index(::tk::TextResetAnchor) [list source [file join $dir text.tcl]] ! set auto_index(::tk::TextInsert) [list source [file join $dir text.tcl]] ! set auto_index(::tk::TextUpDownLine) [list source [file join $dir text.tcl]] ! set auto_index(::tk::TextPrevPara) [list source [file join $dir text.tcl]] ! set auto_index(::tk::TextNextPara) [list source [file join $dir text.tcl]] ! set auto_index(::tk::TextScrollPages) [list source [file join $dir text.tcl]] ! set auto_index(::tk::TextTranspose) [list source [file join $dir text.tcl]] ! set auto_index(tk_textCopy) [list source [file join $dir text.tcl]] ! set auto_index(tk_textCut) [list source [file join $dir text.tcl]] ! set auto_index(tk_textPaste) [list source [file join $dir text.tcl]] ! set auto_index(::tk::TextNextPos) [list source [file join $dir text.tcl]] ! set auto_index(::tk::TextPrevPos) [list source [file join $dir text.tcl]] ! set auto_index(::tk::PlaceWindow) [list source [file join $dir tk.tcl]] ! set auto_index(::tk::SetFocusGrab) [list source [file join $dir tk.tcl]] ! set auto_index(::tk::RestoreFocusGrab) [list source [file join $dir tk.tcl]] ! set auto_index(::tk::ScreenChanged) [list source [file join $dir tk.tcl]] ! set auto_index(::tk::EventMotifBindings) [list source [file join $dir tk.tcl]] ! set auto_index(::tk::CancelRepeat) [list source [file join $dir tk.tcl]] ! set auto_index(::tk::TabToWindow) [list source [file join $dir tk.tcl]] ! set auto_index(::tk::IconList) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_Index) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_Selection) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_Curselection) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_DrawSelection) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_Get) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_Config) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_Create) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_AutoScan) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_DeleteAll) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_Add) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_Arrange) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_Invoke) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_See) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_Btn1) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_CtrlBtn1) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_ShiftBtn1) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_Motion1) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_Double1) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_ReturnKey) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_Leave1) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_FocusIn) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_FocusOut) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_UpDown) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_LeftRight) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_KeyPress) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_Goto) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::IconList_Reset) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::tkFDialog) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::Config) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::Create) [list source [file join $dir tkfbox.tcl]] + set auto_index(::tk::dialog::file::SetSelectMode) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::UpdateWhenIdle) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::Update) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::SetPathSilently) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::SetPath) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::SetFilter) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::dialog::file::ResolveFile) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::EntFocusIn) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::EntFocusOut) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::ActivateEnt) [list source [file join $dir tkfbox.tcl]] + set auto_index(::tk::dialog::file::VerifyFileName) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::InvokeBtn) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::UpDirCmd) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::JoinFile) [list source [file join $dir tkfbox.tcl]] *************** *** 221,245 **** set auto_index(::tk::dialog::file::ListBrowse) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::ListInvoke) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::Done) [list source [file join $dir tkfbox.tcl]] ! set auto_index(tkMotifFDialog) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkMotifFDialog_Config) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkMotifFDialog_Create) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkMotifFDialog_MakeSList) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkMotifFDialog_BrowseDList) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkMotifFDialog_ActivateDList) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkMotifFDialog_BrowseFList) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkMotifFDialog_ActivateFList) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkMotifFDialog_ActivateFEnt) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkMotifFDialog_InterpFilter) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkMotifFDialog_ActivateSEnt) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkMotifFDialog_OkCmd) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkMotifFDialog_FilterCmd) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkMotifFDialog_CancelCmd) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkMotifFDialog_Update) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkMotifFDialog_LoadFiles) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkListBoxKeyAccel_Set) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkListBoxKeyAccel_Unset) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkListBoxKeyAccel_Key) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkListBoxKeyAccel_Goto) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tkListBoxKeyAccel_Reset) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::dialog::file::chooseDir::tkChooseDirectory) [list source [file join $dir choosedir.tcl]] --- 246,274 ---- set auto_index(::tk::dialog::file::ListBrowse) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::ListInvoke) [list source [file join $dir tkfbox.tcl]] set auto_index(::tk::dialog::file::Done) [list source [file join $dir tkfbox.tcl]] ! set auto_index(::tk::MotifFDialog) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_Create) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_FileTypes) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_SetFilter) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_Config) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_BuildUI) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_SetListMode) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_MakeSList) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_InterpFilter) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_Update) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_LoadFiles) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_BrowseDList) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_ActivateDList) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_BrowseFList) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_ActivateFList) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_ActivateFEnt) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_ActivateSEnt) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_OkCmd) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_FilterCmd) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::MotifFDialog_CancelCmd) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::ListBoxKeyAccel_Set) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::ListBoxKeyAccel_Unset) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::ListBoxKeyAccel_Key) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::ListBoxKeyAccel_Goto) [list source [file join $dir xmfbox.tcl]] ! set auto_index(::tk::ListBoxKeyAccel_Reset) [list source [file join $dir xmfbox.tcl]] ! set auto_index(tk_getFileType) [list source [file join $dir xmfbox.tcl]] Index: library/tearoff.tcl =================================================================== RCS file: /cvsroot/tk/library/tearoff.tcl,v retrieving revision 1.6 diff -c -r1.6 tearoff.tcl *** tearoff.tcl 2000/01/06 02:22:24 1.6 --- tearoff.tcl 2000/07/17 06:28:02 *************** *** 11,17 **** # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # ! # tkTearoffMenu -- # Given the name of a menu, this procedure creates a torn-off menu # that is identical to the given menu (including nested submenus). # The new torn-off menu exists as a toplevel window managed by the --- 11,17 ---- # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # ! # ::tk::TearoffMenu -- # Given the name of a menu, this procedure creates a torn-off menu # that is identical to the given menu (including nested submenus). # The new torn-off menu exists as a toplevel window managed by the *************** *** 23,29 **** # x - x coordinate where window is created # y - y coordinate where window is created ! proc tkTearOffMenu {w {x 0} {y 0}} { # Find a unique name to use for the torn-off menu. Find the first # ancestor of w that is a toplevel but not a menu, and use this as # the parent of the new menu. This guarantees that the torn off --- 23,29 ---- # x - x coordinate where window is created # y - y coordinate where window is created ! proc ::tk::TearOffMenu {w {x 0} {y 0}} { # Find a unique name to use for the torn-off menu. Find the first # ancestor of w that is a toplevel but not a menu, and use this as # the parent of the new menu. This guarantees that the torn off *************** *** 80,91 **** return "" } ! # Set tkPriv(focus) on entry: otherwise the focus will get lost # after keyboard invocation of a sub-menu (it will stay on the # submenu). bind $menu { ! set tkPriv(focus) %W } # If there is a -tearoffcommand option for the menu, invoke it --- 80,91 ---- return "" } ! # Set tk::Priv(focus) on entry: otherwise the focus will get lost # after keyboard invocation of a sub-menu (it will stay on the # submenu). bind $menu { ! set tk::Priv(focus) %W } # If there is a -tearoffcommand option for the menu, invoke it *************** *** 98,104 **** return $menu } ! # tkMenuDup -- # Given a menu (hierarchy), create a duplicate menu (hierarchy) # in a given window. # --- 98,104 ---- return $menu } ! # ::tk::MenuDup -- # Given a menu (hierarchy), create a duplicate menu (hierarchy) # in a given window. # *************** *** 108,114 **** # dst - Name to use for topmost menu in duplicate # hierarchy. ! proc tkMenuDup {src dst type} { set cmd [list menu $dst -type $type] foreach option [$src configure] { if {[llength $option] == 2} { --- 108,114 ---- # dst - Name to use for topmost menu in duplicate # hierarchy. ! proc ::tk::MenuDup {src dst type} { set cmd [list menu $dst -type $type] foreach option [$src configure] { if {[llength $option] == 2} { Index: library/text.tcl =================================================================== RCS file: /cvsroot/tk/library/text.tcl,v retrieving revision 1.12 diff -c -r1.12 text.tcl *** text.tcl 2000/04/17 23:24:29 1.12 --- text.tcl 2000/07/17 06:28:07 *************** *** 14,20 **** # #------------------------------------------------------------------------- ! # Elements of tkPriv that are used in this file: # # afterId - If non-null, it means that auto-scanning is underway # and it gives the "after" id for the next auto-scan --- 14,20 ---- # #------------------------------------------------------------------------- ! # Elements of ::tk::Priv that are used in this file: # # afterId - If non-null, it means that auto-scanning is underway # and it gives the "after" id for the next auto-scan *************** *** 42,153 **** # Standard Motif bindings: bind Text <1> { ! tkTextButton1 %W %x %y %W tag remove sel 0.0 end } bind Text { ! set tkPriv(x) %x ! set tkPriv(y) %y ! tkTextSelectTo %W %x %y } bind Text { ! set tkPriv(selectMode) word ! tkTextSelectTo %W %x %y catch {%W mark set insert sel.last} catch {%W mark set anchor sel.first} } bind Text { ! set tkPriv(selectMode) line ! tkTextSelectTo %W %x %y catch {%W mark set insert sel.last} catch {%W mark set anchor sel.first} } bind Text { ! tkTextResetAnchor %W @%x,%y ! set tkPriv(selectMode) char ! tkTextSelectTo %W %x %y } bind Text { ! set tkPriv(selectMode) word ! tkTextSelectTo %W %x %y 1 } bind Text { ! set tkPriv(selectMode) line ! tkTextSelectTo %W %x %y } bind Text { ! set tkPriv(x) %x ! set tkPriv(y) %y ! tkTextAutoScan %W } bind Text { ! tkCancelRepeat } bind Text { ! tkCancelRepeat } bind Text { %W mark set insert @%x,%y } bind Text { ! tkTextSetCursor %W insert-1c } bind Text { ! tkTextSetCursor %W insert+1c } bind Text { ! tkTextSetCursor %W [tkTextUpDownLine %W -1] } bind Text { ! tkTextSetCursor %W [tkTextUpDownLine %W 1] } bind Text { ! tkTextKeySelect %W [%W index {insert - 1c}] } bind Text { ! tkTextKeySelect %W [%W index {insert + 1c}] } bind Text { ! tkTextKeySelect %W [tkTextUpDownLine %W -1] } bind Text { ! tkTextKeySelect %W [tkTextUpDownLine %W 1] } bind Text { ! tkTextSetCursor %W [tkTextPrevPos %W insert tcl_startOfPreviousWord] } bind Text { ! tkTextSetCursor %W [tkTextNextWord %W insert] } bind Text { ! tkTextSetCursor %W [tkTextPrevPara %W insert] } bind Text { ! tkTextSetCursor %W [tkTextNextPara %W insert] } bind Text { ! tkTextKeySelect %W [tkTextPrevPos %W insert tcl_startOfPreviousWord] } bind Text { ! tkTextKeySelect %W [tkTextNextWord %W insert] } bind Text { ! tkTextKeySelect %W [tkTextPrevPara %W insert] } bind Text { ! tkTextKeySelect %W [tkTextNextPara %W insert] } bind Text { ! tkTextSetCursor %W [tkTextScrollPages %W -1] } bind Text { ! tkTextKeySelect %W [tkTextScrollPages %W -1] } bind Text { ! tkTextSetCursor %W [tkTextScrollPages %W 1] } bind Text { ! tkTextKeySelect %W [tkTextScrollPages %W 1] } bind Text { %W xview scroll -1 page --- 42,153 ---- # Standard Motif bindings: bind Text <1> { ! tk::TextButton1 %W %x %y %W tag remove sel 0.0 end } bind Text { ! set tk::Priv(x) %x ! set tk::Priv(y) %y ! tk::TextSelectTo %W %x %y } bind Text { ! set tk::Priv(selectMode) word ! tk::TextSelectTo %W %x %y catch {%W mark set insert sel.last} catch {%W mark set anchor sel.first} } bind Text { ! set tk::Priv(selectMode) line ! tk::TextSelectTo %W %x %y catch {%W mark set insert sel.last} catch {%W mark set anchor sel.first} } bind Text { ! tk::TextResetAnchor %W @%x,%y ! set tk::Priv(selectMode) char ! tk::TextSelectTo %W %x %y } bind Text { ! set tk::Priv(selectMode) word ! tk::TextSelectTo %W %x %y 1 } bind Text { ! set tk::Priv(selectMode) line ! tk::TextSelectTo %W %x %y } bind Text { ! set tk::Priv(x) %x ! set tk::Priv(y) %y ! tk::TextAutoScan %W } bind Text { ! tk::CancelRepeat } bind Text { ! tk::CancelRepeat } bind Text { %W mark set insert @%x,%y } bind Text { ! tk::TextSetCursor %W insert-1c } bind Text { ! tk::TextSetCursor %W insert+1c } bind Text { ! tk::TextSetCursor %W [tk::TextUpDownLine %W -1] } bind Text { ! tk::TextSetCursor %W [tk::TextUpDownLine %W 1] } bind Text { ! tk::TextKeySelect %W [%W index {insert - 1c}] } bind Text { ! tk::TextKeySelect %W [%W index {insert + 1c}] } bind Text { ! tk::TextKeySelect %W [tk::TextUpDownLine %W -1] } bind Text { ! tk::TextKeySelect %W [tk::TextUpDownLine %W 1] } bind Text { ! tk::TextSetCursor %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord] } bind Text { ! tk::TextSetCursor %W [tk::TextNextWord %W insert] } bind Text { ! tk::TextSetCursor %W [tk::TextPrevPara %W insert] } bind Text { ! tk::TextSetCursor %W [tk::TextNextPara %W insert] } bind Text { ! tk::TextKeySelect %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord] } bind Text { ! tk::TextKeySelect %W [tk::TextNextWord %W insert] } bind Text { ! tk::TextKeySelect %W [tk::TextPrevPara %W insert] } bind Text { ! tk::TextKeySelect %W [tk::TextNextPara %W insert] } bind Text { ! tk::TextSetCursor %W [tk::TextScrollPages %W -1] } bind Text { ! tk::TextKeySelect %W [tk::TextScrollPages %W -1] } bind Text { ! tk::TextSetCursor %W [tk::TextScrollPages %W 1] } bind Text { ! tk::TextKeySelect %W [tk::TextScrollPages %W 1] } bind Text { %W xview scroll -1 page *************** *** 157,188 **** } bind Text { ! tkTextSetCursor %W {insert linestart} } bind Text { ! tkTextKeySelect %W {insert linestart} } bind Text { ! tkTextSetCursor %W {insert lineend} } bind Text { ! tkTextKeySelect %W {insert lineend} } bind Text { ! tkTextSetCursor %W 1.0 } bind Text { ! tkTextKeySelect %W 1.0 } bind Text { ! tkTextSetCursor %W {end - 1 char} } bind Text { ! tkTextKeySelect %W {end - 1 char} } bind Text { ! tkTextInsert %W \t focus %W break } --- 157,188 ---- } bind Text { ! tk::TextSetCursor %W {insert linestart} } bind Text { ! tk::TextKeySelect %W {insert linestart} } bind Text { ! tk::TextSetCursor %W {insert lineend} } bind Text { ! tk::TextKeySelect %W {insert lineend} } bind Text { ! tk::TextSetCursor %W 1.0 } bind Text { ! tk::TextKeySelect %W 1.0 } bind Text { ! tk::TextSetCursor %W {end - 1 char} } bind Text { ! tk::TextKeySelect %W {end - 1 char} } bind Text { ! tk::TextInsert %W \t focus %W break } *************** *** 198,207 **** focus [tk_focusPrev %W] } bind Text { ! tkTextInsert %W \t } bind Text { ! tkTextInsert %W \n } bind Text { if {[string compare [%W tag nextrange sel 1.0 end] ""]} { --- 198,207 ---- focus [tk_focusPrev %W] } bind Text { ! tk::TextInsert %W \t } bind Text { ! tk::TextInsert %W \n } bind Text { if {[string compare [%W tag nextrange sel 1.0 end] ""]} { *************** *** 227,238 **** %W mark set anchor insert } bind Text { ! set tkPriv(selectMode) char ! tkTextKeyExtend %W insert } bind Text { ! set tkPriv(selectMode) char ! tkTextKeyExtend %W insert } bind Text { %W tag add sel 1.0 end --- 227,238 ---- %W mark set anchor insert } bind Text { ! set tk::Priv(selectMode) char ! tk::TextKeyExtend %W insert } bind Text { ! set tk::Priv(selectMode) char ! tk::TextKeyExtend %W insert } bind Text { %W tag add sel 1.0 end *************** *** 253,267 **** catch {%W delete sel.first sel.last} } bind Text <> { ! if {!$tkPriv(mouseMoved) || $tk_strictMotif} { ! tkTextPaste %W %x %y } } bind Text { ! catch {tkTextInsert %W [selection get -displayof %W]} } bind Text { ! tkTextInsert %W %A } # Ignore all Alt, Meta, and Control keypresses unless explicitly bound. --- 253,267 ---- catch {%W delete sel.first sel.last} } bind Text <> { ! if {!$tk::Priv(mouseMoved) || $tk_strictMotif} { ! tk::TextPaste %W %x %y } } bind Text { ! catch {tk::TextInsert %W [selection get -displayof %W]} } bind Text { ! tk::TextInsert %W %A } # Ignore all Alt, Meta, and Control keypresses unless explicitly bound. *************** *** 282,293 **** bind Text { if {!$tk_strictMotif} { ! tkTextSetCursor %W {insert linestart} } } bind Text { if {!$tk_strictMotif} { ! tkTextSetCursor %W insert-1c } } bind Text { --- 282,293 ---- bind Text { if {!$tk_strictMotif} { ! tk::TextSetCursor %W {insert linestart} } } bind Text { if {!$tk_strictMotif} { ! tk::TextSetCursor %W insert-1c } } bind Text { *************** *** 297,308 **** } bind Text { if {!$tk_strictMotif} { ! tkTextSetCursor %W {insert lineend} } } bind Text { if {!$tk_strictMotif} { ! tkTextSetCursor %W insert+1c } } bind Text { --- 297,308 ---- } bind Text { if {!$tk_strictMotif} { ! tk::TextSetCursor %W {insert lineend} } } bind Text { if {!$tk_strictMotif} { ! tk::TextSetCursor %W insert+1c } } bind Text { *************** *** 316,322 **** } bind Text { if {!$tk_strictMotif} { ! tkTextSetCursor %W [tkTextUpDownLine %W 1] } } bind Text { --- 316,322 ---- } bind Text { if {!$tk_strictMotif} { ! tk::TextSetCursor %W [tk::TextUpDownLine %W 1] } } bind Text { *************** *** 327,382 **** } bind Text { if {!$tk_strictMotif} { ! tkTextSetCursor %W [tkTextUpDownLine %W -1] } } bind Text { if {!$tk_strictMotif} { ! tkTextTranspose %W } } if {[string compare $tcl_platform(platform) "windows"]} { bind Text { if {!$tk_strictMotif} { ! tkTextScrollPages %W 1 } } } bind Text { if {!$tk_strictMotif} { ! tkTextSetCursor %W [tkTextPrevPos %W insert tcl_startOfPreviousWord] } } bind Text { if {!$tk_strictMotif} { ! %W delete insert [tkTextNextWord %W insert] } } bind Text { if {!$tk_strictMotif} { ! tkTextSetCursor %W [tkTextNextWord %W insert] } } bind Text { if {!$tk_strictMotif} { ! tkTextSetCursor %W 1.0 } } bind Text { if {!$tk_strictMotif} { ! tkTextSetCursor %W end-1c } } bind Text { if {!$tk_strictMotif} { ! %W delete [tkTextPrevPos %W insert tcl_startOfPreviousWord] insert } } bind Text { if {!$tk_strictMotif} { ! %W delete [tkTextPrevPos %W insert tcl_startOfPreviousWord] insert } } --- 327,382 ---- } bind Text { if {!$tk_strictMotif} { ! tk::TextSetCursor %W [tk::TextUpDownLine %W -1] } } bind Text { if {!$tk_strictMotif} { ! tk::TextTranspose %W } } if {[string compare $tcl_platform(platform) "windows"]} { bind Text { if {!$tk_strictMotif} { ! tk::TextScrollPages %W 1 } } } bind Text { if {!$tk_strictMotif} { ! tk::TextSetCursor %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord] } } bind Text { if {!$tk_strictMotif} { ! %W delete insert [tk::TextNextWord %W insert] } } bind Text { if {!$tk_strictMotif} { ! tk::TextSetCursor %W [tk::TextNextWord %W insert] } } bind Text { if {!$tk_strictMotif} { ! tk::TextSetCursor %W 1.0 } } bind Text { if {!$tk_strictMotif} { ! tk::TextSetCursor %W end-1c } } bind Text { if {!$tk_strictMotif} { ! %W delete [tk::TextPrevPos %W insert tcl_startOfPreviousWord] insert } } bind Text { if {!$tk_strictMotif} { ! %W delete [tk::TextPrevPos %W insert tcl_startOfPreviousWord] insert } } *************** *** 393,420 **** %W configure -selectbackground white -selectforeground black } bind Text { ! tkTextSetCursor %W [tkTextPrevPos %W insert tcl_startOfPreviousWord] } bind Text { ! tkTextSetCursor %W [tkTextNextWord %W insert] } bind Text { ! tkTextSetCursor %W [tkTextPrevPara %W insert] } bind Text { ! tkTextSetCursor %W [tkTextNextPara %W insert] } bind Text { ! tkTextKeySelect %W [tkTextPrevPos %W insert tcl_startOfPreviousWord] } bind Text { ! tkTextKeySelect %W [tkTextNextWord %W insert] } bind Text { ! tkTextKeySelect %W [tkTextPrevPara %W insert] } bind Text { ! tkTextKeySelect %W [tkTextNextPara %W insert] } # End of Mac only bindings --- 393,420 ---- %W configure -selectbackground white -selectforeground black } bind Text { ! tk::TextSetCursor %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord] } bind Text { ! tk::TextSetCursor %W [tk::TextNextWord %W insert] } bind Text { ! tk::TextSetCursor %W [tk::TextPrevPara %W insert] } bind Text { ! tk::TextSetCursor %W [tk::TextNextPara %W insert] } bind Text { ! tk::TextKeySelect %W [tk::TextPrevPos %W insert tcl_startOfPreviousWord] } bind Text { ! tk::TextKeySelect %W [tk::TextNextWord %W insert] } bind Text { ! tk::TextKeySelect %W [tk::TextPrevPara %W insert] } bind Text { ! tk::TextKeySelect %W [tk::TextNextPara %W insert] } # End of Mac only bindings *************** *** 433,454 **** bind Text <2> { if {!$tk_strictMotif} { %W scan mark %x %y ! set tkPriv(x) %x ! set tkPriv(y) %y ! set tkPriv(mouseMoved) 0 } } bind Text { if {!$tk_strictMotif} { ! if {(%x != $tkPriv(x)) || (%y != $tkPriv(y))} { ! set tkPriv(mouseMoved) 1 } ! if {$tkPriv(mouseMoved)} { %W scan dragto %x %y } } } ! set tkPriv(prevPos) {} # The MouseWheel will typically only fire on Windows. However, # someone could use the "event generate" command to produce one --- 433,454 ---- bind Text <2> { if {!$tk_strictMotif} { %W scan mark %x %y ! set tk::Priv(x) %x ! set tk::Priv(y) %y ! set tk::Priv(mouseMoved) 0 } } bind Text { if {!$tk_strictMotif} { ! if {(%x != $tk::Priv(x)) || (%y != $tk::Priv(y))} { ! set tk::Priv(mouseMoved) 1 } ! if {$tk::Priv(mouseMoved)} { %W scan dragto %x %y } } } ! set ::tk::Priv(prevPos) {} # The MouseWheel will typically only fire on Windows. However, # someone could use the "event generate" command to produce one *************** *** 475,481 **** } } ! # tkTextClosestGap -- # Given x and y coordinates, this procedure finds the closest boundary # between characters to the given coordinates and returns the index # of the character just after the boundary. --- 475,481 ---- } } ! # ::tk::TextClosestGap -- # Given x and y coordinates, this procedure finds the closest boundary # between characters to the given coordinates and returns the index # of the character just after the boundary. *************** *** 485,491 **** # x - X-coordinate within the window. # y - Y-coordinate within the window. ! proc tkTextClosestGap {w x y} { set pos [$w index @$x,$y] set bbox [$w bbox $pos] if {[string equal $bbox ""]} { --- 485,491 ---- # x - X-coordinate within the window. # y - Y-coordinate within the window. ! proc ::tk::TextClosestGap {w x y} { set pos [$w index @$x,$y] set bbox [$w bbox $pos] if {[string equal $bbox ""]} { *************** *** 497,503 **** $w index "$pos + 1 char" } ! # tkTextButton1 -- # This procedure is invoked to handle button-1 presses in text # widgets. It moves the insertion cursor, sets the selection anchor, # and claims the input focus. --- 497,503 ---- $w index "$pos + 1 char" } ! # ::tk::TextButton1 -- # This procedure is invoked to handle button-1 presses in text # widgets. It moves the insertion cursor, sets the selection anchor, # and claims the input focus. *************** *** 507,524 **** # x - The x-coordinate of the button press. # y - The x-coordinate of the button press. ! proc tkTextButton1 {w x y} { ! global tkPriv ! set tkPriv(selectMode) char ! set tkPriv(mouseMoved) 0 ! set tkPriv(pressX) $x ! $w mark set insert [tkTextClosestGap $w $x $y] $w mark set anchor insert if {[string equal [$w cget -state] "normal"]} {focus $w} } ! # tkTextSelectTo -- # This procedure is invoked to extend the selection, typically when # dragging it with the mouse. Depending on the selection mode (character, # word, line) it selects in different-sized units. This procedure --- 507,524 ---- # x - The x-coordinate of the button press. # y - The x-coordinate of the button press. ! proc ::tk::TextButton1 {w x y} { ! variable ::tk::Priv ! set Priv(selectMode) char ! set Priv(mouseMoved) 0 ! set Priv(pressX) $x ! $w mark set insert [TextClosestGap $w $x $y] $w mark set anchor insert if {[string equal [$w cget -state] "normal"]} {focus $w} } ! # ::tk::TextSelectTo -- # This procedure is invoked to extend the selection, typically when # dragging it with the mouse. Depending on the selection mode (character, # word, line) it selects in different-sized units. This procedure *************** *** 530,547 **** # x - Mouse x position. # y - Mouse y position. ! proc tkTextSelectTo {w x y {extend 0}} { ! global tkPriv tcl_platform ! set cur [tkTextClosestGap $w $x $y] if {[catch {$w index anchor}]} { $w mark set anchor $cur } set anchor [$w index anchor] ! if {[$w compare $cur != $anchor] || (abs($tkPriv(pressX) - $x) >= 3)} { ! set tkPriv(mouseMoved) 1 } ! switch $tkPriv(selectMode) { char { if {[$w compare $cur < anchor]} { set first $cur --- 530,548 ---- # x - Mouse x position. # y - Mouse y position. ! proc ::tk::TextSelectTo {w x y {extend 0}} { ! global tcl_platform ! variable ::tk::Priv ! set cur [TextClosestGap $w $x $y] if {[catch {$w index anchor}]} { $w mark set anchor $cur } set anchor [$w index anchor] ! if {[$w compare $cur != $anchor] || (abs($Priv(pressX) - $x) >= 3)} { ! set Priv(mouseMoved) 1 } ! switch $Priv(selectMode) { char { if {[$w compare $cur < anchor]} { set first $cur *************** *** 553,568 **** } word { if {[$w compare $cur < anchor]} { ! set first [tkTextPrevPos $w "$cur + 1c" tcl_wordBreakBefore] if { !$extend } { ! set last [tkTextNextPos $w "anchor" tcl_wordBreakAfter] } else { set last anchor } } else { ! set last [tkTextNextPos $w "$cur - 1c" tcl_wordBreakAfter] if { !$extend } { ! set first [tkTextPrevPos $w anchor tcl_wordBreakBefore] } else { set first anchor } --- 554,569 ---- } word { if {[$w compare $cur < anchor]} { ! set first [TextPrevPos $w "$cur + 1c" tcl_wordBreakBefore] if { !$extend } { ! set last [TextNextPos $w "anchor" tcl_wordBreakAfter] } else { set last anchor } } else { ! set last [TextNextPos $w "$cur - 1c" tcl_wordBreakAfter] if { !$extend } { ! set first [TextPrevPos $w anchor tcl_wordBreakBefore] } else { set first anchor } *************** *** 578,584 **** } } } ! if {$tkPriv(mouseMoved) || [string compare $tkPriv(selectMode) "char"]} { if {[string compare $tcl_platform(platform) "unix"] \ && [$w compare $cur < anchor]} { $w mark set insert $first --- 579,585 ---- } } } ! if {$Priv(mouseMoved) || [string compare $Priv(selectMode) "char"]} { if {[string compare $tcl_platform(platform) "unix"] \ && [$w compare $cur < anchor]} { $w mark set insert $first *************** *** 592,598 **** } } ! # tkTextKeyExtend -- # This procedure handles extending the selection from the keyboard, # where the point to extend to is really the boundary between two # characters rather than a particular character. --- 593,599 ---- } } ! # ::tk::TextKeyExtend -- # This procedure handles extending the selection from the keyboard, # where the point to extend to is really the boundary between two # characters rather than a particular character. *************** *** 601,608 **** # w - The text window. # index - The point to which the selection is to be extended. ! proc tkTextKeyExtend {w index} { ! global tkPriv set cur [$w index $index] if {[catch {$w index anchor}]} { --- 602,608 ---- # w - The text window. # index - The point to which the selection is to be extended. ! proc ::tk::TextKeyExtend {w index} { set cur [$w index $index] if {[catch {$w index anchor}]} { *************** *** 621,627 **** $w tag remove sel $last end } ! # tkTextPaste -- # This procedure sets the insertion cursor to the mouse position, # inserts the selection, and sets the focus to the window. # --- 621,627 ---- $w tag remove sel $last end } ! # ::tk::TextPaste -- # This procedure sets the insertion cursor to the mouse position, # inserts the selection, and sets the focus to the window. # *************** *** 629,670 **** # w - The text window. # x, y - Position of the mouse. ! proc tkTextPaste {w x y} { ! $w mark set insert [tkTextClosestGap $w $x $y] catch {$w insert insert [selection get -displayof $w]} if {[string equal [$w cget -state] "normal"]} {focus $w} } ! # tkTextAutoScan -- # This procedure is invoked when the mouse leaves a text window # with button 1 down. It scrolls the window up, down, left, or right, # depending on where the mouse is (this information was saved in ! # tkPriv(x) and tkPriv(y)), and reschedules itself as an "after" # command so that the window continues to scroll until the mouse # moves back into the window or the mouse button is released. # # Arguments: # w - The text window. ! proc tkTextAutoScan {w} { ! global tkPriv if {![winfo exists $w]} return ! if {$tkPriv(y) >= [winfo height $w]} { $w yview scroll 2 units ! } elseif {$tkPriv(y) < 0} { $w yview scroll -2 units ! } elseif {$tkPriv(x) >= [winfo width $w]} { $w xview scroll 2 units ! } elseif {$tkPriv(x) < 0} { $w xview scroll -2 units } else { return } ! tkTextSelectTo $w $tkPriv(x) $tkPriv(y) ! set tkPriv(afterId) [after 50 [list tkTextAutoScan $w]] } ! # tkTextSetCursor # Move the insertion cursor to a given position in a text. Also # clears the selection, if there is one in the text, and makes sure # that the insertion cursor is visible. Also, don't let the insertion --- 629,670 ---- # w - The text window. # x, y - Position of the mouse. ! proc ::tk::TextPaste {w x y} { ! $w mark set insert [TextClosestGap $w $x $y] catch {$w insert insert [selection get -displayof $w]} if {[string equal [$w cget -state] "normal"]} {focus $w} } ! # ::tk::TextAutoScan -- # This procedure is invoked when the mouse leaves a text window # with button 1 down. It scrolls the window up, down, left, or right, # depending on where the mouse is (this information was saved in ! # ::tk::Priv(x) and ::tk::Priv(y)), and reschedules itself as an "after" # command so that the window continues to scroll until the mouse # moves back into the window or the mouse button is released. # # Arguments: # w - The text window. ! proc ::tk::TextAutoScan {w} { ! variable ::tk::Priv if {![winfo exists $w]} return ! if {$Priv(y) >= [winfo height $w]} { $w yview scroll 2 units ! } elseif {$Priv(y) < 0} { $w yview scroll -2 units ! } elseif {$Priv(x) >= [winfo width $w]} { $w xview scroll 2 units ! } elseif {$Priv(x) < 0} { $w xview scroll -2 units } else { return } ! TextSelectTo $w $Priv(x) $Priv(y) ! set Priv(afterId) [after 50 [list tk::TextAutoScan $w]] } ! # ::tk::TextSetCursor # Move the insertion cursor to a given position in a text. Also # clears the selection, if there is one in the text, and makes sure # that the insertion cursor is visible. Also, don't let the insertion *************** *** 674,681 **** # w - The text window. # pos - The desired new position for the cursor in the window. ! proc tkTextSetCursor {w pos} { ! global tkPriv if {[$w compare $pos == end]} { set pos {end - 1 chars} --- 674,680 ---- # w - The text window. # pos - The desired new position for the cursor in the window. ! proc ::tk::TextSetCursor {w pos} { if {[$w compare $pos == end]} { set pos {end - 1 chars} *************** *** 685,691 **** $w see insert } ! # tkTextKeySelect # This procedure is invoked when stroking out selections using the # keyboard. It moves the cursor to a new position, then extends # the selection to that position. --- 684,690 ---- $w see insert } ! # ::tk::TextKeySelect # This procedure is invoked when stroking out selections using the # keyboard. It moves the cursor to a new position, then extends # the selection to that position. *************** *** 695,702 **** # new - A new position for the insertion cursor (the cursor hasn't # actually been moved to this position yet). ! proc tkTextKeySelect {w new} { ! global tkPriv if {[string equal [$w tag nextrange sel 1.0 end] ""]} { if {[$w compare $new < insert]} { --- 694,700 ---- # new - A new position for the insertion cursor (the cursor hasn't # actually been moved to this position yet). ! proc ::tk::TextKeySelect {w new} { if {[string equal [$w tag nextrange sel 1.0 end] ""]} { if {[$w compare $new < insert]} { *************** *** 722,728 **** update idletasks } ! # tkTextResetAnchor -- # Set the selection anchor to whichever end is farthest from the # index argument. One special trick: if the selection has two or # fewer characters, just leave the anchor where it is. In this --- 720,726 ---- update idletasks } ! # ::tk::TextResetAnchor -- # Set the selection anchor to whichever end is farthest from the # index argument. One special trick: if the selection has two or # fewer characters, just leave the anchor where it is. In this *************** *** 736,743 **** # index - Position at which mouse button was pressed, which determines # which end of selection should be used as anchor point. ! proc tkTextResetAnchor {w index} { ! global tkPriv if {[string equal [$w tag ranges sel] ""]} { $w mark set anchor $index --- 734,740 ---- # index - Position at which mouse button was pressed, which determines # which end of selection should be used as anchor point. ! proc ::tk::TextResetAnchor {w index} { if {[string equal [$w tag ranges sel] ""]} { $w mark set anchor $index *************** *** 776,782 **** } } ! # tkTextInsert -- # Insert a string into a text at the point of the insertion cursor. # If there is a selection in the text, and it covers the point of the # insertion cursor, then delete the selection before inserting. --- 773,779 ---- } } ! # ::tk::TextInsert -- # Insert a string into a text at the point of the insertion cursor. # If there is a selection in the text, and it covers the point of the # insertion cursor, then delete the selection before inserting. *************** *** 785,791 **** # w - The text window in which to insert the string # s - The string to insert (usually just a single character) ! proc tkTextInsert {w s} { if {[string equal $s ""] || [string equal [$w cget -state] "disabled"]} { return } --- 782,788 ---- # w - The text window in which to insert the string # s - The string to insert (usually just a single character) ! proc ::tk::TextInsert {w s} { if {[string equal $s ""] || [string equal [$w cget -state] "disabled"]} { return } *************** *** 799,805 **** $w see insert } ! # tkTextUpDownLine -- # Returns the index of the character one line above or below the # insertion cursor. There are two tricky things here. First, # we want to maintain the original column across repeated operations, --- 796,802 ---- $w see insert } ! # ::tk::TextUpDownLine -- # Returns the index of the character one line above or below the # insertion cursor. There are two tricky things here. First, # we want to maintain the original column across repeated operations, *************** *** 812,834 **** # n - The number of lines to move: -1 for up one line, # +1 for down one line. ! proc tkTextUpDownLine {w n} { ! global tkPriv set i [$w index insert] scan $i "%d.%d" line char ! if {[string compare $tkPriv(prevPos) $i]} { ! set tkPriv(char) $char } ! set new [$w index [expr {$line + $n}].$tkPriv(char)] if {[$w compare $new == end] || [$w compare $new == "insert linestart"]} { set new $i } ! set tkPriv(prevPos) $new return $new } ! # tkTextPrevPara -- # Returns the index of the beginning of the paragraph just before a given # position in the text (the beginning of a paragraph is the first non-blank # character after a blank line). --- 809,831 ---- # n - The number of lines to move: -1 for up one line, # +1 for down one line. ! proc ::tk::TextUpDownLine {w n} { ! variable ::tk::Priv set i [$w index insert] scan $i "%d.%d" line char ! if {[string compare $Priv(prevPos) $i]} { ! set Priv(char) $char } ! set new [$w index [expr {$line + $n}].$Priv(char)] if {[$w compare $new == end] || [$w compare $new == "insert linestart"]} { set new $i } ! set Priv(prevPos) $new return $new } ! # ::tk::TextPrevPara -- # Returns the index of the beginning of the paragraph just before a given # position in the text (the beginning of a paragraph is the first non-blank # character after a blank line). *************** *** 837,843 **** # w - The text window in which the cursor is to move. # pos - Position at which to start search. ! proc tkTextPrevPara {w pos} { set pos [$w index "$pos linestart"] while {1} { if {([string equal [$w get "$pos - 1 line"] "\n"] \ --- 834,840 ---- # w - The text window in which the cursor is to move. # pos - Position at which to start search. ! proc ::tk::TextPrevPara {w pos} { set pos [$w index "$pos linestart"] while {1} { if {([string equal [$w get "$pos - 1 line"] "\n"] \ *************** *** 855,861 **** } } ! # tkTextNextPara -- # Returns the index of the beginning of the paragraph just after a given # position in the text (the beginning of a paragraph is the first non-blank # character after a blank line). --- 852,858 ---- } } ! # ::tk::TextNextPara -- # Returns the index of the beginning of the paragraph just after a given # position in the text (the beginning of a paragraph is the first non-blank # character after a blank line). *************** *** 864,870 **** # w - The text window in which the cursor is to move. # start - Position at which to start search. ! proc tkTextNextPara {w start} { set pos [$w index "$start linestart + 1 line"] while {[string compare [$w get $pos] "\n"]} { if {[$w compare $pos == end]} { --- 861,867 ---- # w - The text window in which the cursor is to move. # start - Position at which to start search. ! proc ::tk::TextNextPara {w start} { set pos [$w index "$start linestart + 1 line"] while {[string compare [$w get $pos] "\n"]} { if {[$w compare $pos == end]} { *************** *** 885,891 **** return $pos } ! # tkTextScrollPages -- # This is a utility procedure used in bindings for moving up and down # pages and possibly extending the selection along the way. It scrolls # the view in the widget by the number of pages, and it returns the --- 882,888 ---- return $pos } ! # ::tk::TextScrollPages -- # This is a utility procedure used in bindings for moving up and down # pages and possibly extending the selection along the way. It scrolls # the view in the widget by the number of pages, and it returns the *************** *** 897,903 **** # count - Number of pages forward to scroll; may be negative # to scroll backwards. ! proc tkTextScrollPages {w count} { set bbox [$w bbox insert] $w yview scroll $count pages if {[string equal $bbox ""]} { --- 894,900 ---- # count - Number of pages forward to scroll; may be negative # to scroll backwards. ! proc ::tk::TextScrollPages {w count} { set bbox [$w bbox insert] $w yview scroll $count pages if {[string equal $bbox ""]} { *************** *** 906,912 **** return [$w index @[lindex $bbox 0],[lindex $bbox 1]] } ! # tkTextTranspose -- # This procedure implements the "transpose" function for text widgets. # It tranposes the characters on either side of the insertion cursor, # unless the cursor is at the end of the line. In this case it --- 903,909 ---- return [$w index @[lindex $bbox 0],[lindex $bbox 1]] } ! # ::tk::TextTranspose -- # This procedure implements the "transpose" function for text widgets. # It tranposes the characters on either side of the insertion cursor, # unless the cursor is at the end of the line. In this case it *************** *** 916,922 **** # Arguments: # w - Text window in which to transpose. ! proc tkTextTranspose w { set pos insert if {[$w compare $pos != "$pos lineend"]} { set pos [$w index "$pos + 1 char"] --- 913,919 ---- # Arguments: # w - Text window in which to transpose. ! proc ::tk::TextTranspose w { set pos insert if {[$w compare $pos != "$pos lineend"]} { set pos [$w index "$pos + 1 char"] *************** *** 930,950 **** $w see insert } ! # tk_textCopy -- # This procedure copies the selection from a text widget into the # clipboard. # # Arguments: # w - Name of a text widget. ! proc tk_textCopy w { if {![catch {set data [$w get sel.first sel.last]}]} { clipboard clear -displayof $w clipboard append -displayof $w $data } } ! # tk_textCut -- # This procedure copies the selection from a text widget into the # clipboard, then deletes the selection (if it exists in the given # widget). --- 927,947 ---- $w see insert } ! # ::tk_textCopy -- # This procedure copies the selection from a text widget into the # clipboard. # # Arguments: # w - Name of a text widget. ! proc ::tk_textCopy w { if {![catch {set data [$w get sel.first sel.last]}]} { clipboard clear -displayof $w clipboard append -displayof $w $data } } ! # ::tk_textCut -- # This procedure copies the selection from a text widget into the # clipboard, then deletes the selection (if it exists in the given # widget). *************** *** 952,958 **** # Arguments: # w - Name of a text widget. ! proc tk_textCut w { if {![catch {set data [$w get sel.first sel.last]}]} { clipboard clear -displayof $w clipboard append -displayof $w $data --- 949,955 ---- # Arguments: # w - Name of a text widget. ! proc ::tk_textCut w { if {![catch {set data [$w get sel.first sel.last]}]} { clipboard clear -displayof $w clipboard append -displayof $w $data *************** *** 960,973 **** } } ! # tk_textPaste -- # This procedure pastes the contents of the clipboard to the insertion # point in a text widget. # # Arguments: # w - Name of a text widget. ! proc tk_textPaste w { global tcl_platform catch { if {[string compare $tcl_platform(platform) "unix"]} { --- 957,970 ---- } } ! # ::tk_textPaste -- # This procedure pastes the contents of the clipboard to the insertion # point in a text widget. # # Arguments: # w - Name of a text widget. ! proc ::tk_textPaste w { global tcl_platform catch { if {[string compare $tcl_platform(platform) "unix"]} { *************** *** 979,985 **** } } ! # tkTextNextWord -- # Returns the index of the next word position after a given position in the # text. The next word is platform dependent and may be either the next # end-of-word position or the next start-of-word position after the next --- 976,982 ---- } } ! # ::tk::TextNextWord -- # Returns the index of the next word position after a given position in the # text. The next word is platform dependent and may be either the next # end-of-word position or the next start-of-word position after the next *************** *** 990,1006 **** # start - Position at which to start search. if {[string equal $tcl_platform(platform) "windows"]} { ! proc tkTextNextWord {w start} { ! tkTextNextPos $w [tkTextNextPos $w $start tcl_endOfWord] \ tcl_startOfNextWord } } else { ! proc tkTextNextWord {w start} { ! tkTextNextPos $w $start tcl_endOfWord } } ! # tkTextNextPos -- # Returns the index of the next position after the given starting # position in the text as computed by a specified function. # --- 987,1003 ---- # start - Position at which to start search. if {[string equal $tcl_platform(platform) "windows"]} { ! proc ::tk::TextNextWord {w start} { ! TextNextPos $w [TextNextPos $w $start tcl_endOfWord] \ tcl_startOfNextWord } } else { ! proc ::tk::TextNextWord {w start} { ! TextNextPos $w $start tcl_endOfWord } } ! # ::tk::TextNextPos -- # Returns the index of the next position after the given starting # position in the text as computed by a specified function. # *************** *** 1009,1015 **** # start - Position at which to start search. # op - Function to use to find next position. ! proc tkTextNextPos {w start op} { set text "" set cur $start while {[$w compare $cur < end]} { --- 1006,1012 ---- # start - Position at which to start search. # op - Function to use to find next position. ! proc ::tk::TextNextPos {w start op} { set text "" set cur $start while {[$w compare $cur < end]} { *************** *** 1029,1035 **** return end } ! # tkTextPrevPos -- # Returns the index of the previous position before the given starting # position in the text as computed by a specified function. # --- 1026,1032 ---- return end } ! # ::tk::TextPrevPos -- # Returns the index of the previous position before the given starting # position in the text as computed by a specified function. # *************** *** 1038,1044 **** # start - Position at which to start search. # op - Function to use to find next position. ! proc tkTextPrevPos {w start op} { set text "" set cur $start while {[$w compare $cur > 0.0]} { --- 1035,1041 ---- # start - Position at which to start search. # op - Function to use to find next position. ! proc ::tk::TextPrevPos {w start op} { set text "" set cur $start while {[$w compare $cur > 0.0]} { Index: library/tk.tcl =================================================================== RCS file: /cvsroot/tk/library/tk.tcl,v retrieving revision 1.24 diff -c -r1.24 tk.tcl *** tk.tcl 2000/06/30 20:19:06 1.24 --- tk.tcl 2000/07/17 06:28:09 *************** *** 24,37 **** # Add Tk's directory to the end of the auto-load search path, if it # isn't already on the path: ! if {[info exists auto_path] && [string compare {} $tk_library] && \ ! [lsearch -exact $auto_path $tk_library] < 0} { ! lappend auto_path $tk_library } # Turn off strict Motif look and feel as a default. ! set tk_strictMotif 0 # Create a ::tk namespace --- 24,37 ---- # Add Tk's directory to the end of the auto-load search path, if it # isn't already on the path: ! if {[info exists ::auto_path] && [string compare {} $::tk_library] && \ ! [lsearch -exact $::auto_path $::tk_library] < 0} { ! lappend ::auto_path $::tk_library } # Turn off strict Motif look and feel as a default. ! set ::tk_strictMotif 0 # Create a ::tk namespace *************** *** 144,160 **** } } ! # tkScreenChanged -- # This procedure is invoked by the binding mechanism whenever the # "current" screen is changing. The procedure does two things. ! # First, it uses "upvar" to make global variable "tkPriv" point at an # array variable that holds state for the current display. Second, # it initializes the array if it didn't already exist. # # Arguments: # screen - The name of the new screen. ! proc tkScreenChanged screen { set x [string last . $screen] if {$x > 0} { set disp [string range $screen 0 [expr {$x - 1}]] --- 144,160 ---- } } ! # ::tk::ScreenChanged -- # This procedure is invoked by the binding mechanism whenever the # "current" screen is changing. The procedure does two things. ! # First, it uses "upvar" to make variable "::tk::Priv" point at an # array variable that holds state for the current display. Second, # it initializes the array if it didn't already exist. # # Arguments: # screen - The name of the new screen. ! proc ::tk::ScreenChanged screen { set x [string last . $screen] if {$x > 0} { set disp [string range $screen 0 [expr {$x - 1}]] *************** *** 162,176 **** set disp $screen } ! uplevel #0 upvar #0 tkPriv.$disp tkPriv ! global tkPriv global tcl_platform ! if {[info exists tkPriv]} { ! set tkPriv(screen) $screen return } ! array set tkPriv { activeMenu {} activeItem {} afterId {} --- 162,176 ---- set disp $screen } ! uplevel #0 upvar #0 ::tk::Priv.$disp ::tk::Priv ! variable ::tk::Priv global tcl_platform ! if {[info exists Priv]} { ! set Priv(screen) $screen return } ! array set Priv { activeMenu {} activeItem {} afterId {} *************** *** 192,217 **** prevPos 0 selectMode char } ! set tkPriv(screen) $screen ! set tkPriv(tearoff) [string equal $tcl_platform(platform) "unix"] ! set tkPriv(window) {} } ! # Do initial setup for tkPriv, so that it is always bound to something # (otherwise, if someone references it, it may get set to a non-upvar-ed # value, which will cause trouble later). ! tkScreenChanged [winfo screen .] ! # tkEventMotifBindings -- ! # This procedure is invoked as a trace whenever tk_strictMotif is # changed. It is used to turn on or turn off the motif virtual # bindings. # # Arguments: ! # n1 - the name of the variable being changed ("tk_strictMotif"). ! proc tkEventMotifBindings {n1 dummy dummy} { upvar $n1 name if {$name} { --- 192,217 ---- prevPos 0 selectMode char } ! set Priv(screen) $screen ! set Priv(tearoff) [string equal $tcl_platform(platform) "unix"] ! set Priv(window) {} } ! # Do initial setup for Priv, so that it is always bound to something # (otherwise, if someone references it, it may get set to a non-upvar-ed # value, which will cause trouble later). ! tk::ScreenChanged [winfo screen .] ! # ::tk::EventMotifBindings -- ! # This procedure is invoked as a trace whenever ::tk_strictMotif is # changed. It is used to turn on or turn off the motif virtual # bindings. # # Arguments: ! # n1 - the name of the variable being changed ("::tk_strictMotif"). ! proc ::tk::EventMotifBindings {n1 dummy dummy} { upvar $n1 name if {$name} { *************** *** 231,265 **** #---------------------------------------------------------------------- if {[string equal [info commands tk_chooseColor] ""]} { ! proc tk_chooseColor {args} { ! return [eval tkColorDialog $args] } } if {[string equal [info commands tk_getOpenFile] ""]} { ! proc tk_getOpenFile {args} { if {$::tk_strictMotif} { ! return [eval tkMotifFDialog open $args] } else { return [eval ::tk::dialog::file::tkFDialog open $args] } } } if {[string equal [info commands tk_getSaveFile] ""]} { ! proc tk_getSaveFile {args} { if {$::tk_strictMotif} { ! return [eval tkMotifFDialog save $args] } else { return [eval ::tk::dialog::file::tkFDialog save $args] } } } if {[string equal [info commands tk_messageBox] ""]} { ! proc tk_messageBox {args} { ! return [eval tkMessageBox $args] } } if {[string equal [info command tk_chooseDirectory] ""]} { ! proc tk_chooseDirectory {args} { return [eval ::tk::dialog::file::chooseDir::tkChooseDirectory $args] } } --- 231,265 ---- #---------------------------------------------------------------------- if {[string equal [info commands tk_chooseColor] ""]} { ! proc ::tk_chooseColor {args} { ! return [eval tk::dialog::color:: $args] } } if {[string equal [info commands tk_getOpenFile] ""]} { ! proc ::tk_getOpenFile {args} { if {$::tk_strictMotif} { ! return [eval tk::MotifFDialog open $args] } else { return [eval ::tk::dialog::file::tkFDialog open $args] } } } if {[string equal [info commands tk_getSaveFile] ""]} { ! proc ::tk_getSaveFile {args} { if {$::tk_strictMotif} { ! return [eval tk::MotifFDialog save $args] } else { return [eval ::tk::dialog::file::tkFDialog save $args] } } } if {[string equal [info commands tk_messageBox] ""]} { ! proc ::tk_messageBox {args} { ! return [eval tk::MessageBox $args] } } if {[string equal [info command tk_chooseDirectory] ""]} { ! proc ::tk_chooseDirectory {args} { return [eval ::tk::dialog::file::chooseDir::tkChooseDirectory $args] } } *************** *** 268,274 **** # Define the set of common virtual events. #---------------------------------------------------------------------- ! switch $tcl_platform(platform) { "unix" { event add <> event add <> --- 268,274 ---- # Define the set of common virtual events. #---------------------------------------------------------------------- ! switch $::tcl_platform(platform) { "unix" { event add <> event add <> *************** *** 287,294 **** "HP-UX" { event add <> } } } ! trace variable tk_strictMotif w tkEventMotifBindings ! set tk_strictMotif $tk_strictMotif } "windows" { event add <> --- 287,294 ---- "HP-UX" { event add <> } } } ! trace variable ::tk_strictMotif w ::tk::EventMotifBindings ! set ::tk_strictMotif $::tk_strictMotif } "windows" { event add <> *************** *** 309,324 **** # Read in files that define all of the class bindings. # ---------------------------------------------------------------------- ! if {[string compare $tcl_platform(platform) "macintosh"] && \ ! [string compare {} $tk_library]} { ! source [file join $tk_library button.tcl] ! source [file join $tk_library entry.tcl] ! source [file join $tk_library listbox.tcl] ! source [file join $tk_library menu.tcl] ! source [file join $tk_library scale.tcl] ! source [file join $tk_library scrlbar.tcl] ! source [file join $tk_library spinbox.tcl] ! source [file join $tk_library text.tcl] } # ---------------------------------------------------------------------- --- 309,324 ---- # Read in files that define all of the class bindings. # ---------------------------------------------------------------------- ! if {[string compare $::tcl_platform(platform) "macintosh"] && \ ! [string compare {} $::tk_library]} { ! source [file join $::tk_library button.tcl] ! source [file join $::tk_library entry.tcl] ! source [file join $::tk_library listbox.tcl] ! source [file join $::tk_library menu.tcl] ! source [file join $::tk_library scale.tcl] ! source [file join $::tk_library scrlbar.tcl] ! source [file join $::tk_library spinbox.tcl] ! source [file join $::tk_library text.tcl] } # ---------------------------------------------------------------------- *************** *** 326,357 **** # ---------------------------------------------------------------------- event add <> ! bind all {tkTabToWindow [tk_focusNext %W]} ! bind all <> {tkTabToWindow [tk_focusPrev %W]} ! # tkCancelRepeat -- # This procedure is invoked to cancel an auto-repeat action described ! # by tkPriv(afterId). It's used by several widgets to auto-scroll # the widget when the mouse is dragged out of the widget with a # button pressed. # # Arguments: # None. ! proc tkCancelRepeat {} { ! global tkPriv ! after cancel $tkPriv(afterId) ! set tkPriv(afterId) {} } ! # tkTabToWindow -- # This procedure moves the focus to the given widget. If the widget # is an entry, it selects the entire contents of the widget. # # Arguments: # w - Window to which focus should be set. ! proc tkTabToWindow {w} { if {[string equal [winfo class $w] Entry]} { $w selection range 0 end $w icursor end --- 326,357 ---- # ---------------------------------------------------------------------- event add <> ! bind all {tk::TabToWindow [tk_focusNext %W]} ! bind all <> {tk::TabToWindow [tk_focusPrev %W]} ! # ::tk::CancelRepeat -- # This procedure is invoked to cancel an auto-repeat action described ! # by ::tk::Priv(afterId). It's used by several widgets to auto-scroll # the widget when the mouse is dragged out of the widget with a # button pressed. # # Arguments: # None. ! proc ::tk::CancelRepeat {} { ! variable ::tk::Priv ! after cancel $Priv(afterId) ! set Priv(afterId) {} } ! # ::tk::TabToWindow -- # This procedure moves the focus to the given widget. If the widget # is an entry, it selects the entire contents of the widget. # # Arguments: # w - Window to which focus should be set. ! proc ::tk::TabToWindow {w} { if {[string equal [winfo class $w] Entry]} { $w selection range 0 end $w icursor end Index: library/tkfbox.tcl =================================================================== RCS file: /cvsroot/tk/library/tkfbox.tcl,v retrieving revision 1.21 diff -c -r1.21 tkfbox.tcl *** tkfbox.tcl 2000/06/30 06:38:38 1.21 --- tkfbox.tcl 2000/07/17 06:28:18 *************** *** 7,13 **** # The "TK" standard file selection dialog box is similar to the # file selection dialog box on Win95(TM). The user can navigate # the directories by clicking on the folder icons or by ! # selectinf the "Directory" option menu. The user can select # files by clicking on the file icons or by entering a filename # in the "Filename:" entry. # --- 7,13 ---- # The "TK" standard file selection dialog box is similar to the # file selection dialog box on Win95(TM). The user can navigate # the directories by clicking on the folder icons or by ! # selecting the "Directory" option menu. The user can select # files by clicking on the file icons or by entering a filename # in the "Filename:" entry. # *************** *** 28,47 **** # #---------------------------------------------------------------------- ! # tkIconList -- # # Creates an IconList widget. # ! proc tkIconList {w args} { ! upvar #0 $w data ! ! tkIconList_Config $w $args ! tkIconList_Create $w } ! proc tkIconList_Index {w i} { ! upvar #0 $w data ! upvar #0 $w:itemList itemList switch -regexp -- $i { "^[0-9]+$" { return $i --- 28,45 ---- # #---------------------------------------------------------------------- ! # ::tk::IconList -- # # Creates an IconList widget. # ! proc ::tk::IconList {w args} { ! IconList_Config $w $args ! IconList_Create $w } ! proc ::tk::IconList_Index {w i} { ! upvar ::tk::$w data ! upvar ::tk::$w:itemList itemList switch -regexp -- $i { "^[0-9]+$" { return $i *************** *** 65,72 **** } } ! proc tkIconList_Selection {w op args} { ! upvar #0 $w data switch -exact -- $op { "anchor" { if { [llength $args] == 1 } { --- 63,70 ---- } } ! proc ::tk::IconList_Selection {w op args} { ! upvar ::tk::$w data switch -exact -- $op { "anchor" { if { [llength $args] == 1 } { *************** *** 83,93 **** } elseif { [llength $args] == 1 } { set first [set last [lindex $args 0]] } else { ! error "wrong # args: should be tkIconList_Selection path\ clear first ?last?" } ! set first [tkIconList_Index $w $first] ! set last [tkIconList_Index $w $last] if { $first > $last } { set tmp $first set first $last --- 81,91 ---- } elseif { [llength $args] == 1 } { set first [set last [lindex $args 0]] } else { ! error "wrong # args: should be [lindex [info level 0] 0] path\ clear first ?last?" } ! set first [IconList_Index $w $first] ! set last [IconList_Index $w $last] if { $first > $last } { set tmp $first set first $last *************** *** 114,120 **** } set data(selection) [lreplace $data(selection) $first $last] event generate $w <> ! tkIconList_DrawSelection $w } "includes" { set index [lsearch -exact $data(selection) [lindex $args 0]] --- 112,118 ---- } set data(selection) [lreplace $data(selection) $first $last] event generate $w <> ! IconList_DrawSelection $w } "includes" { set index [lsearch -exact $data(selection) [lindex $args 0]] *************** *** 128,139 **** } elseif { [llength $args] == 1 } { set last [set first [lindex $args 0]] } else { ! error "wrong # args: should be tkIconList_Selection path\ set first ?last?" } ! set first [tkIconList_Index $w $first] ! set last [tkIconList_Index $w $last] if { $first > $last } { set tmp $first set first $last --- 126,137 ---- } elseif { [llength $args] == 1 } { set last [set first [lindex $args 0]] } else { ! error "wrong # args: should be [lindex [info level 0] 0] path\ set first ?last?" } ! set first [IconList_Index $w $first] ! set last [IconList_Index $w $last] if { $first > $last } { set tmp $first set first $last *************** *** 144,162 **** } set data(selection) [lsort -integer -unique $data(selection)] event generate $w <> ! tkIconList_DrawSelection $w } } } ! proc tkIconList_Curselection {w} { ! upvar #0 $w data return $data(selection) } ! proc tkIconList_DrawSelection {w} { ! upvar #0 $w data ! upvar #0 $w:itemList itemList $data(canvas) delete selection foreach item $data(selection) { --- 142,160 ---- } set data(selection) [lsort -integer -unique $data(selection)] event generate $w <> ! IconList_DrawSelection $w } } } ! proc ::tk::IconList_Curselection {w} { ! upvar ::tk::$w data return $data(selection) } ! proc ::tk::IconList_DrawSelection {w} { ! upvar ::tk::$w data ! upvar ::tk::$w:itemList itemList $data(canvas) delete selection foreach item $data(selection) { *************** *** 173,181 **** return } ! proc tkIconList_Get {w item} { ! upvar #0 $w data ! upvar #0 $w:itemList itemList set rTag [lindex [lindex $data(list) $item] 2] foreach {iTag tTag text serial} $itemList($rTag) { break --- 171,179 ---- return } ! proc ::tk::IconList_Get {w item} { ! upvar ::tk::$w data ! upvar ::tk::$w:itemList itemList set rTag [lindex [lindex $data(list) $item] 2] foreach {iTag tTag text serial} $itemList($rTag) { break *************** *** 183,195 **** return $text } ! # tkIconList_Config -- # # Configure the widget variables of IconList, according to the command # line arguments. # ! proc tkIconList_Config {w argList} { ! upvar #0 $w data # 1: the configuration specs # --- 181,192 ---- return $text } ! # ::tk::IconList_Config -- # # Configure the widget variables of IconList, according to the command # line arguments. # ! proc ::tk::IconList_Config {w argList} { # 1: the configuration specs # *************** *** 200,216 **** # 2: parse the arguments # ! tclParseConfigSpec $w $specs "" $argList } ! # tkIconList_Create -- # # Creates an IconList widget by assembling a canvas widget and a # scrollbar widget. Sets all the bindings necessary for the IconList's # operations. # ! proc tkIconList_Create {w} { ! upvar #0 $w data frame $w set data(sbar) [scrollbar $w.sbar -orient horizontal \ --- 197,213 ---- # 2: parse the arguments # ! tclParseConfigSpec ::tk::$w $specs "" $argList } ! # ::tk::IconList_Create -- # # Creates an IconList widget by assembling a canvas widget and a # scrollbar widget. Sets all the bindings necessary for the IconList's # operations. # ! proc ::tk::IconList_Create {w} { ! upvar ::tk::$w data frame $w set data(sbar) [scrollbar $w.sbar -orient horizontal \ *************** *** 237,270 **** # Creates the event bindings. # ! bind $data(canvas) [list tkIconList_Arrange $w] ! bind $data(canvas) <1> [list tkIconList_Btn1 $w %x %y] ! bind $data(canvas) [list tkIconList_Motion1 $w %x %y] ! bind $data(canvas) [list tkIconList_Leave1 $w %x %y] ! bind $data(canvas) [list tkIconList_CtrlBtn1 $w %x %y] ! bind $data(canvas) [list tkIconList_ShiftBtn1 $w %x %y] ! bind $data(canvas) [list tkCancelRepeat] ! bind $data(canvas) [list tkCancelRepeat] bind $data(canvas) \ ! [list tkIconList_Double1 $w %x %y] ! bind $data(canvas) [list tkIconList_UpDown $w -1] ! bind $data(canvas) [list tkIconList_UpDown $w 1] ! bind $data(canvas) [list tkIconList_LeftRight $w -1] ! bind $data(canvas) [list tkIconList_LeftRight $w 1] ! bind $data(canvas) [list tkIconList_ReturnKey $w] ! bind $data(canvas) [list tkIconList_KeyPress $w %A] bind $data(canvas) ";" bind $data(canvas) ";" ! bind $data(canvas) [list tkIconList_FocusIn $w] ! bind $data(canvas) [list tkIconList_FocusOut $w] return $w } ! # tkIconList_AutoScan -- # # This procedure is invoked when the mouse leaves an entry window # with button 1 down. It scrolls the window up, down, left, or --- 234,267 ---- # Creates the event bindings. # ! bind $data(canvas) [list tk::IconList_Arrange $w] ! bind $data(canvas) <1> [list tk::IconList_Btn1 $w %x %y] ! bind $data(canvas) [list tk::IconList_Motion1 $w %x %y] ! bind $data(canvas) [list tk::IconList_Leave1 $w %x %y] ! bind $data(canvas) [list tk::IconList_CtrlBtn1 $w %x %y] ! bind $data(canvas) [list tk::IconList_ShiftBtn1 $w %x %y] ! bind $data(canvas) [list tk::CancelRepeat] ! bind $data(canvas) [list tk::CancelRepeat] bind $data(canvas) \ ! [list tk::IconList_Double1 $w %x %y] ! bind $data(canvas) [list tk::IconList_UpDown $w -1] ! bind $data(canvas) [list tk::IconList_UpDown $w 1] ! bind $data(canvas) [list tk::IconList_LeftRight $w -1] ! bind $data(canvas) [list tk::IconList_LeftRight $w 1] ! bind $data(canvas) [list tk::IconList_ReturnKey $w] ! bind $data(canvas) [list tk::IconList_KeyPress $w %A] bind $data(canvas) ";" bind $data(canvas) ";" ! bind $data(canvas) [list tk::IconList_FocusIn $w] ! bind $data(canvas) [list tk::IconList_FocusOut $w] return $w } ! # ::tk::IconList_AutoScan -- # # This procedure is invoked when the mouse leaves an entry window # with button 1 down. It scrolls the window up, down, left, or *************** *** 275,287 **** # Arguments: # w - The IconList window. # ! proc tkIconList_AutoScan {w} { ! upvar #0 $w data ! global tkPriv if {![winfo exists $w]} return ! set x $tkPriv(x) ! set y $tkPriv(y) if {$data(noScroll)} { return --- 272,284 ---- # Arguments: # w - The IconList window. # ! proc ::tk::IconList_AutoScan {w} { ! upvar ::tk::$w data ! variable ::tk::Priv if {![winfo exists $w]} return ! set x $Priv(x) ! set y $Priv(y) if {$data(noScroll)} { return *************** *** 298,313 **** return } ! tkIconList_Motion1 $w $x $y ! set tkPriv(afterId) [after 50 [list tkIconList_AutoScan $w]] } # Deletes all the items inside the canvas subwidget and reset the IconList's # state. # ! proc tkIconList_DeleteAll {w} { ! upvar #0 $w data ! upvar #0 $w:itemList itemList $data(canvas) delete all catch {unset data(selected)} --- 295,310 ---- return } ! IconList_Motion1 $w $x $y ! set Priv(afterId) [after 50 [list tk::IconList_AutoScan $w]] } # Deletes all the items inside the canvas subwidget and reset the IconList's # state. # ! proc ::tk::IconList_DeleteAll {w} { ! upvar ::tk::$w data ! upvar ::tk::$w:itemList itemList $data(canvas) delete all catch {unset data(selected)} *************** *** 329,338 **** # Adds an icon into the IconList with the designated image and text # ! proc tkIconList_Add {w image items} { ! upvar #0 $w data ! upvar #0 $w:itemList itemList ! upvar #0 $w:textList textList foreach text $items { set iTag [$data(canvas) create image 0 0 -image $image -anchor nw \ --- 326,335 ---- # Adds an icon into the IconList with the designated image and text # ! proc ::tk::IconList_Add {w image items} { ! upvar ::tk::$w data ! upvar ::tk::$w:itemList itemList ! upvar ::tk::$w:textList textList foreach text $items { set iTag [$data(canvas) create image 0 0 -image $image -anchor nw \ *************** *** 376,383 **** # Places the icons in a column-major arrangement. # ! proc tkIconList_Arrange {w} { ! upvar #0 $w data if {![info exists data(list)]} { if {[info exists data(canvas)] && [winfo exists $data(canvas)]} { --- 373,380 ---- # Places the icons in a column-major arrangement. # ! proc ::tk::IconList_Arrange {w} { ! upvar ::tk::$w data if {![info exists data(list)]} { if {[info exists data(canvas)] && [winfo exists $data(canvas)]} { *************** *** 454,481 **** } if {$data(curItem) != ""} { ! tkIconList_Select $w [lindex [lindex $data(list) $data(curItem)] 2] 0 } } # Gets called when the user invokes the IconList (usually by double-clicking # or pressing the Return key). # ! proc tkIconList_Invoke {w} { ! upvar #0 $w data if {$data(-command) != "" && [llength $data(selection)]} { uplevel #0 $data(-command) } } ! # tkIconList_See -- # # If the item is not (completely) visible, scroll the canvas so that # it becomes visible. ! proc tkIconList_See {w rTag} { ! upvar #0 $w data ! upvar #0 $w:itemList itemList if {$data(noScroll)} { return --- 451,478 ---- } if {$data(curItem) != ""} { ! IconList_Select $w [lindex [lindex $data(list) $data(curItem)] 2] 0 } } # Gets called when the user invokes the IconList (usually by double-clicking # or pressing the Return key). # ! proc ::tk::IconList_Invoke {w} { ! upvar ::tk::$w data if {$data(-command) != "" && [llength $data(selection)]} { uplevel #0 $data(-command) } } ! # ::tk::IconList_See -- # # If the item is not (completely) visible, scroll the canvas so that # it becomes visible. ! proc ::tk::IconList_See {w rTag} { ! upvar ::tk::$w data ! upvar ::tk::$w:itemList itemList if {$data(noScroll)} { return *************** *** 522,624 **** } } ! proc tkIconList_Btn1 {w x y} { ! upvar #0 $w data focus $data(canvas) set x [expr {int([$data(canvas) canvasx $x])}] set y [expr {int([$data(canvas) canvasy $y])}] ! set i [tkIconList_Index $w @${x},${y}] ! tkIconList_Selection $w clear 0 end ! tkIconList_Selection $w set $i ! tkIconList_Selection $w anchor $i } ! proc tkIconList_CtrlBtn1 {w x y} { ! upvar #0 $w data if { $data(-multiple) } { focus $data(canvas) set x [expr {int([$data(canvas) canvasx $x])}] set y [expr {int([$data(canvas) canvasy $y])}] ! set i [tkIconList_Index $w @${x},${y}] ! if { [tkIconList_Selection $w includes $i] } { ! tkIconList_Selection $w clear $i } else { ! tkIconList_Selection $w set $i ! tkIconList_Selection $w anchor $i } } } ! proc tkIconList_ShiftBtn1 {w x y} { ! upvar #0 $w data if { $data(-multiple) } { focus $data(canvas) set x [expr {int([$data(canvas) canvasx $x])}] set y [expr {int([$data(canvas) canvasy $y])}] ! set i [tkIconList_Index $w @${x},${y}] ! set a [tkIconList_Index $w anchor] if { [string equal $a ""] } { set a $i } ! tkIconList_Selection $w clear 0 end ! tkIconList_Selection $w set $a $i } } # Gets called on button-1 motions # ! proc tkIconList_Motion1 {w x y} { ! upvar #0 $w data ! global tkPriv ! set tkPriv(x) $x ! set tkPriv(y) $y set x [expr {int([$data(canvas) canvasx $x])}] set y [expr {int([$data(canvas) canvasy $y])}] ! set i [tkIconList_Index $w @${x},${y}] ! tkIconList_Selection $w clear 0 end ! tkIconList_Selection $w set $i } ! proc tkIconList_Double1 {w x y} { ! upvar #0 $w data if {[llength $data(selection)]} { ! tkIconList_Invoke $w } } ! proc tkIconList_ReturnKey {w} { ! tkIconList_Invoke $w } ! proc tkIconList_Leave1 {w x y} { ! global tkPriv ! set tkPriv(x) $x ! set tkPriv(y) $y ! tkIconList_AutoScan $w } ! proc tkIconList_FocusIn {w} { ! upvar #0 $w data if {![info exists data(list)]} { return } if {[llength $data(selection)]} { ! tkIconList_DrawSelection $w } } ! proc tkIconList_FocusOut {w} { ! tkIconList_Selection $w clear 0 end } ! # tkIconList_UpDown -- # # Moves the active element up or down by one element # --- 519,621 ---- } } ! proc ::tk::IconList_Btn1 {w x y} { ! upvar ::tk::$w data focus $data(canvas) set x [expr {int([$data(canvas) canvasx $x])}] set y [expr {int([$data(canvas) canvasy $y])}] ! set i [IconList_Index $w @${x},${y}] ! IconList_Selection $w clear 0 end ! IconList_Selection $w set $i ! IconList_Selection $w anchor $i } ! proc ::tk::IconList_CtrlBtn1 {w x y} { ! upvar ::tk::$w data if { $data(-multiple) } { focus $data(canvas) set x [expr {int([$data(canvas) canvasx $x])}] set y [expr {int([$data(canvas) canvasy $y])}] ! set i [IconList_Index $w @${x},${y}] ! if { [IconList_Selection $w includes $i] } { ! IconList_Selection $w clear $i } else { ! IconList_Selection $w set $i ! IconList_Selection $w anchor $i } } } ! proc ::tk::IconList_ShiftBtn1 {w x y} { ! upvar ::tk::$w data if { $data(-multiple) } { focus $data(canvas) set x [expr {int([$data(canvas) canvasx $x])}] set y [expr {int([$data(canvas) canvasy $y])}] ! set i [IconList_Index $w @${x},${y}] ! set a [IconList_Index $w anchor] if { [string equal $a ""] } { set a $i } ! IconList_Selection $w clear 0 end ! IconList_Selection $w set $a $i } } # Gets called on button-1 motions # ! proc ::tk::IconList_Motion1 {w x y} { ! upvar ::tk::$w data ! variable ::tk::Priv ! set Priv(x) $x ! set Priv(y) $y set x [expr {int([$data(canvas) canvasx $x])}] set y [expr {int([$data(canvas) canvasy $y])}] ! set i [IconList_Index $w @${x},${y}] ! IconList_Selection $w clear 0 end ! IconList_Selection $w set $i } ! proc ::tk::IconList_Double1 {w x y} { ! upvar ::tk::$w data if {[llength $data(selection)]} { ! IconList_Invoke $w } } ! proc ::tk::IconList_ReturnKey {w} { ! IconList_Invoke $w } ! proc ::tk::IconList_Leave1 {w x y} { ! variable ::tk::Priv ! set Priv(x) $x ! set Priv(y) $y ! IconList_AutoScan $w } ! proc ::tk::IconList_FocusIn {w} { ! upvar ::tk::$w data if {![info exists data(list)]} { return } if {[llength $data(selection)]} { ! IconList_DrawSelection $w } } ! proc ::tk::IconList_FocusOut {w} { ! IconList_Selection $w clear 0 end } ! # ::tk::IconList_UpDown -- # # Moves the active element up or down by one element # *************** *** 626,633 **** # w - The IconList widget. # amount - +1 to move down one item, -1 to move back one item. # ! proc tkIconList_UpDown {w amount} { ! upvar #0 $w data if {![info exists data(list)]} { return --- 623,630 ---- # w - The IconList widget. # amount - +1 to move down one item, -1 to move back one item. # ! proc ::tk::IconList_UpDown {w amount} { ! upvar ::tk::$w data if {![info exists data(list)]} { return *************** *** 644,655 **** } if {[string compare $rTag ""]} { ! tkIconList_Select $w $rTag ! tkIconList_See $w $rTag } } ! # tkIconList_LeftRight -- # # Moves the active element left or right by one column # --- 641,652 ---- } if {[string compare $rTag ""]} { ! IconList_Select $w $rTag ! IconList_See $w $rTag } } ! # ::tk::IconList_LeftRight -- # # Moves the active element left or right by one column # *************** *** 657,664 **** # w - The IconList widget. # amount - +1 to move right one column, -1 to move left one column. # ! proc tkIconList_LeftRight {w amount} { ! upvar #0 $w data if {![info exists data(list)]} { return --- 654,661 ---- # w - The IconList widget. # amount - +1 to move right one column, -1 to move left one column. # ! proc ::tk::IconList_LeftRight {w amount} { ! upvar ::tk::$w data if {![info exists data(list)]} { return *************** *** 675,682 **** } if {[string compare $rTag ""]} { ! tkIconList_Select $w $rTag ! tkIconList_See $w $rTag } } --- 672,679 ---- } if {[string compare $rTag ""]} { ! IconList_Select $w $rTag ! IconList_See $w $rTag } } *************** *** 684,708 **** # Accelerator key bindings #---------------------------------------------------------------------- ! # tkIconList_KeyPress -- # # Gets called when user enters an arbitrary key in the listbox. # ! proc tkIconList_KeyPress {w key} { ! global tkPriv ! append tkPriv(ILAccel,$w) $key ! tkIconList_Goto $w $tkPriv(ILAccel,$w) catch { ! after cancel $tkPriv(ILAccel,$w,afterId) } ! set tkPriv(ILAccel,$w,afterId) [after 500 [list tkIconList_Reset $w]] } ! proc tkIconList_Goto {w text} { ! upvar #0 $w data ! upvar #0 $w:textList textList ! global tkPriv if {![info exists data(list)]} { return --- 681,705 ---- # Accelerator key bindings #---------------------------------------------------------------------- ! # ::tk::IconList_KeyPress -- # # Gets called when user enters an arbitrary key in the listbox. # ! proc ::tk::IconList_KeyPress {w key} { ! variable ::tk::Priv ! append Priv(ILAccel,$w) $key ! IconList_Goto $w $Priv(ILAccel,$w) catch { ! after cancel $Priv(ILAccel,$w,afterId) } ! set Priv(ILAccel,$w,afterId) [after 500 [list tk::IconList_Reset $w]] } ! proc ::tk::IconList_Goto {w text} { ! upvar ::tk::$w data ! upvar ::tk::$w:textList textList ! variable ::tk::Priv if {![info exists data(list)]} { return *************** *** 744,758 **** if {$theIndex > -1} { set rTag [lindex [lindex $data(list) $theIndex] 2] ! tkIconList_Select $w $rTag ! tkIconList_See $w $rTag } } ! proc tkIconList_Reset {w} { ! global tkPriv ! catch {unset tkPriv(ILAccel,$w)} } #---------------------------------------------------------------------- --- 741,755 ---- if {$theIndex > -1} { set rTag [lindex [lindex $data(list) $theIndex] 2] ! IconList_Select $w $rTag ! IconList_See $w $rTag } } ! proc ::tk::IconList_Reset {w} { ! variable ::tk::Priv ! catch {unset Priv(ILAccel,$w)} } #---------------------------------------------------------------------- *************** *** 776,782 **** # proc ::tk::dialog::file::tkFDialog {type args} { ! global tkPriv set dataName __tk_filedialog upvar ::tk::dialog::file::$dataName data --- 773,779 ---- # proc ::tk::dialog::file::tkFDialog {type args} { ! variable ::tk::Priv set dataName __tk_filedialog upvar ::tk::dialog::file::$dataName data *************** *** 858,864 **** # may take the focus away so we can't redirect it. Finally, # restore any grab that was in effect. ! tkwait variable tkPriv(selectFilePath) ::tk::RestoreFocusGrab $w $data(ent) withdraw --- 855,861 ---- # may take the focus away so we can't redirect it. Finally, # restore any grab that was in effect. ! vwait tk::Priv(selectFilePath) ::tk::RestoreFocusGrab $w $data(ent) withdraw *************** *** 870,876 **** } $data(dirMenuBtn) configure -textvariable {} ! return $tkPriv(selectFilePath) } # ::tk::dialog::file::Config -- --- 867,873 ---- } $data(dirMenuBtn) configure -textvariable {} ! return $Priv(selectFilePath) } # ::tk::dialog::file::Config -- *************** *** 945,951 **** # 5. Parse the -filetypes option # ! set data(-filetypes) [tkFDGetFileTypes $data(-filetypes)] if {![winfo exists $data(-parent)]} { error "bad window path name \"$data(-parent)\"" --- 942,948 ---- # 5. Parse the -filetypes option # ! set data(-filetypes) [::tk::FDGetFileTypes $data(-filetypes)] if {![winfo exists $data(-parent)]} { error "bad window path name \"$data(-parent)\"" *************** *** 967,973 **** proc ::tk::dialog::file::Create {w class} { set dataName [lindex [split $w .] end] upvar ::tk::dialog::file::$dataName data ! global tk_library tkPriv toplevel $w -class $class --- 964,971 ---- proc ::tk::dialog::file::Create {w class} { set dataName [lindex [split $w .] end] upvar ::tk::dialog::file::$dataName data ! variable ::tk::Priv ! global tk_library toplevel $w -class $class *************** *** 978,985 **** set data(dirMenuBtn) $f1.menu set data(dirMenu) [tk_optionMenu $f1.menu [format %s(selectPath) ::tk::dialog::file::$dataName] ""] set data(upBtn) [button $f1.up] ! if {![info exists tkPriv(updirImage)]} { ! set tkPriv(updirImage) [image create bitmap -data { #define updir_width 28 #define updir_height 16 static char updir_bits[] = { --- 976,983 ---- set data(dirMenuBtn) $f1.menu set data(dirMenu) [tk_optionMenu $f1.menu [format %s(selectPath) ::tk::dialog::file::$dataName] ""] set data(upBtn) [button $f1.up] ! if {![info exists Priv(updirImage)]} { ! set Priv(updirImage) [image create bitmap -data { #define updir_width 28 #define updir_height 16 static char updir_bits[] = { *************** *** 990,996 **** 0x10, 0xfe, 0x07, 0x01, 0x10, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x01, 0xf0, 0xff, 0xff, 0x01};}] } ! $data(upBtn) config -image $tkPriv(updirImage) $f1.menu config -takefocus 1 -highlightthickness 2 --- 988,994 ---- 0x10, 0xfe, 0x07, 0x01, 0x10, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x01, 0xf0, 0xff, 0xff, 0x01};}] } ! $data(upBtn) config -image $Priv(updirImage) $f1.menu config -takefocus 1 -highlightthickness 2 *************** *** 1017,1023 **** set fCaptionWidth [string length $fNameCaption] set iconListCommand [list ::tk::dialog::file::chooseDir::DblClick $w] } ! set data(icons) [tkIconList $w.icons \ -command $iconListCommand \ -multiple $data(-multiple)] bind $data(icons) <> \ --- 1015,1021 ---- set fCaptionWidth [string length $fNameCaption] set iconListCommand [list ::tk::dialog::file::chooseDir::DblClick $w] } ! set data(icons) [::tk::IconList $w.icons \ -command $iconListCommand \ -multiple $data(-multiple)] bind $data(icons) <> \ *************** *** 1032,1039 **** # The font to use for the icons. The default Canvas font on Unix # is just deviant. ! global $w.icons ! set $w.icons(font) [$data(ent) cget -font] # f3: the frame with the cancel button and the file types field # --- 1030,1036 ---- # The font to use for the icons. The default Canvas font on Unix # is just deviant. ! set ::tk::$w.icons(font) [$data(ent) cget -font] # f3: the frame with the cancel button and the file types field # *************** *** 1098,1105 **** wm protocol $w WM_DELETE_WINDOW [list ::tk::dialog::file::CancelCmd $w] $data(upBtn) config -command [list ::tk::dialog::file::UpDirCmd $w] $data(cancelBtn) config -command [list ::tk::dialog::file::CancelCmd $w] ! bind $w [list tkButtonInvoke $data(cancelBtn)] ! bind $w [list tkButtonInvoke $data(cancelBtn)] bind $w [list focus $data(dirMenuBtn)] # Set up event handlers specific to File or Directory Dialogs --- 1095,1102 ---- wm protocol $w WM_DELETE_WINDOW [list ::tk::dialog::file::CancelCmd $w] $data(upBtn) config -command [list ::tk::dialog::file::UpDirCmd $w] $data(cancelBtn) config -command [list ::tk::dialog::file::CancelCmd $w] ! bind $w [list tk::ButtonInvoke $data(cancelBtn)] ! bind $w [list tk::ButtonInvoke $data(cancelBtn)] bind $w [list focus $data(dirMenuBtn)] # Set up event handlers specific to File or Directory Dialogs *************** *** 1121,1134 **** bind $data(ent) $okCmd $data(okBtn) config -command $okCmd bind $w [list focus $data(ent)] ! bind $w [list tkButtonInvoke $data(okBtn)] } # Build the focus group for all the entries # ! tkFocusGroup_Create $w ! tkFocusGroup_BindIn $w $data(ent) [list ::tk::dialog::file::EntFocusIn $w] ! tkFocusGroup_BindOut $w $data(ent) [list ::tk::dialog::file::EntFocusOut $w] } # ::tk::dialog::file::SetSelectMode -- --- 1118,1131 ---- bind $data(ent) $okCmd $data(okBtn) config -command $okCmd bind $w [list focus $data(ent)] ! bind $w [list tk::ButtonInvoke $data(okBtn)] } # Build the focus group for all the entries # ! ::tk::FocusGroup_Create $w ! ::tk::FocusGroup_BindIn $w $data(ent) [list ::tk::dialog::file::EntFocusIn $w] ! ::tk::FocusGroup_BindOut $w $data(ent) [list ::tk::dialog::file::EntFocusOut $w] } # ::tk::dialog::file::SetSelectMode -- *************** *** 1153,1159 **** set fNameUnder 5 set iconListCommand [list ::tk::dialog::file::OkCmd $w] $w.f2.lab configure -text $fNameCaption -under $fNameUnder ! tkIconList_Config $data(icons) \ [list -multiple $multi -command $iconListCommand] return } --- 1150,1156 ---- set fNameUnder 5 set iconListCommand [list ::tk::dialog::file::OkCmd $w] $w.f2.lab configure -text $fNameCaption -under $fNameUnder ! ::tk::IconList_Config $data(icons) \ [list -multiple $multi -command $iconListCommand] return } *************** *** 1196,1214 **** set dataName [winfo name $w] upvar ::tk::dialog::file::$dataName data ! global tk_library tkPriv catch {unset data(updateId)} ! if {![info exists tkPriv(folderImage)]} { ! set tkPriv(folderImage) [image create photo -data { R0lGODlhEAAMAKEAAAD//wAAAPD/gAAAACH5BAEAAAAALAAAAAAQAAwAAAIghINhyycvVFsB QtmS3rjaH1Hg141WaT5ouprt2HHcUgAAOw==}] ! set tkPriv(fileImage) [image create photo -data { R0lGODlhDAAMAKEAALLA3AAAAP//8wAAACH5BAEAAAAALAAAAAAMAAwAAAIgRI4Ha+IfWHsO rSASvJTGhnhcV3EJlo3kh53ltF5nAhQAOw==}] } ! set folder $tkPriv(folderImage) ! set file $tkPriv(fileImage) set appPWD [pwd] if {[catch { --- 1193,1212 ---- set dataName [winfo name $w] upvar ::tk::dialog::file::$dataName data ! variable ::tk::Priv ! global tk_library catch {unset data(updateId)} ! if {![info exists Priv(folderImage)]} { ! set Priv(folderImage) [image create photo -data { R0lGODlhEAAMAKEAAAD//wAAAPD/gAAAACH5BAEAAAAALAAAAAAQAAwAAAIghINhyycvVFsB QtmS3rjaH1Hg141WaT5ouprt2HHcUgAAOw==}] ! set Priv(fileImage) [image create photo -data { R0lGODlhDAAMAKEAALLA3AAAAP//8wAAACH5BAEAAAAALAAAAAAMAAwAAAIgRI4Ha+IfWHsO rSASvJTGhnhcV3EJlo3kh53ltF5nAhQAOw==}] } ! set folder $Priv(folderImage) ! set file $Priv(fileImage) set appPWD [pwd] if {[catch { *************** *** 1234,1240 **** $w config -cursor watch update idletasks ! tkIconList_DeleteAll $data(icons) # Make the dir list # --- 1232,1238 ---- $w config -cursor watch update idletasks ! ::tk::IconList_DeleteAll $data(icons) # Make the dir list # *************** *** 1251,1257 **** lappend dirList $f } } ! tkIconList_Add $data(icons) $folder $dirList if { [string equal $class TkFDialog] } { # Make the file list if this is a File Dialog # --- 1249,1255 ---- lappend dirList $f } } ! ::tk::IconList_Add $data(icons) $folder $dirList if { [string equal $class TkFDialog] } { # Make the file list if this is a File Dialog # *************** *** 1271,1280 **** lappend fileList $f } } ! tkIconList_Add $data(icons) $file $fileList } ! tkIconList_Arrange $data(icons) # Update the Directory: option menu # --- 1269,1278 ---- lappend fileList $f } } ! ::tk::IconList_Add $data(icons) $file $fileList } ! ::tk::IconList_Arrange $data(icons) # Update the Directory: option menu # *************** *** 1352,1358 **** # proc ::tk::dialog::file::SetFilter {w type} { upvar ::tk::dialog::file::[winfo name $w] data ! upvar \#0 $data(icons) icons set data(filter) [lindex $type 1] $data(typeMenuBtn) config -text [lindex $type 0] -indicatoron 1 --- 1350,1356 ---- # proc ::tk::dialog::file::SetFilter {w type} { upvar ::tk::dialog::file::[winfo name $w] data ! upvar ::tk::$data(icons) icons set data(filter) [lindex $type 1] $data(typeMenuBtn) config -text [lindex $type 0] -indicatoron 1 *************** *** 1583,1589 **** upvar ::tk::dialog::file::[winfo name $w] data if {[string equal [$data(okBtn) cget -text] $key]} { ! tkButtonInvoke $data(okBtn) } } --- 1581,1587 ---- upvar ::tk::dialog::file::[winfo name $w] data if {[string equal [$data(okBtn) cget -text] $key]} { ! ::tk::ButtonInvoke $data(okBtn) } } *************** *** 1614,1621 **** upvar ::tk::dialog::file::[winfo name $w] data set text {} ! foreach item [tkIconList_Curselection $data(icons)] { ! lappend text [tkIconList_Get $data(icons) $item] } if {[llength $text] && !$data(-multiple)} { --- 1612,1619 ---- upvar ::tk::dialog::file::[winfo name $w] data set text {} ! foreach item [::tk::IconList_Curselection $data(icons)] { ! lappend text [::tk::IconList_Get $data(icons) $item] } if {[llength $text] && !$data(-multiple)} { *************** *** 1634,1642 **** # proc ::tk::dialog::file::CancelCmd {w} { upvar ::tk::dialog::file::[winfo name $w] data ! global tkPriv ! set tkPriv(selectFilePath) "" } # Gets called when user browses the IconList widget (dragging mouse, arrow --- 1632,1640 ---- # proc ::tk::dialog::file::CancelCmd {w} { upvar ::tk::dialog::file::[winfo name $w] data ! variable ::tk::Priv ! set Priv(selectFilePath) "" } # Gets called when user browses the IconList widget (dragging mouse, arrow *************** *** 1646,1653 **** upvar ::tk::dialog::file::[winfo name $w] data set text {} ! foreach item [tkIconList_Curselection $data(icons)] { ! lappend text [tkIconList_Get $data(icons) $item] } if {[llength $text] == 0} { return --- 1644,1651 ---- upvar ::tk::dialog::file::[winfo name $w] data set text {} ! foreach item [::tk::IconList_Curselection $data(icons)] { ! lappend text [::tk::IconList_Get $data(icons) $item] } if {[llength $text] == 0} { return *************** *** 1723,1735 **** # # Gets called when user has input a valid filename. Pops up a # dialog box to confirm selection when necessary. Sets the ! # tkPriv(selectFilePath) variable, which will break the "tkwait" # loop in tkFDialog and return the selected filename to the # script that calls tk_getOpenFile or tk_getSaveFile # proc ::tk::dialog::file::Done {w {selectFilePath ""}} { upvar ::tk::dialog::file::[winfo name $w] data ! global tkPriv if {[string equal $selectFilePath ""]} { if {$data(-multiple)} { --- 1721,1733 ---- # # Gets called when user has input a valid filename. Pops up a # dialog box to confirm selection when necessary. Sets the ! # tk::Priv(selectFilePath) variable, which will break the "vwait" # loop in tkFDialog and return the selected filename to the # script that calls tk_getOpenFile or tk_getSaveFile # proc ::tk::dialog::file::Done {w {selectFilePath ""}} { upvar ::tk::dialog::file::[winfo name $w] data ! variable ::tk::Priv if {[string equal $selectFilePath ""]} { if {$data(-multiple)} { *************** *** 1743,1750 **** $data(selectPath) $data(selectFile)] } ! set tkPriv(selectFile) $data(selectFile) ! set tkPriv(selectPath) $data(selectPath) if {[string equal $data(type) save]} { if {[file exists $selectFilePath]} { --- 1741,1748 ---- $data(selectPath) $data(selectFile)] } ! set Priv(selectFile) $data(selectFile) ! set Priv(selectPath) $data(selectPath) if {[string equal $data(type) save]} { if {[file exists $selectFilePath]} { *************** *** 1757,1761 **** } } } ! set tkPriv(selectFilePath) $selectFilePath } --- 1755,1759 ---- } } } ! set Priv(selectFilePath) $selectFilePath } Index: library/xmfbox.tcl =================================================================== RCS file: /cvsroot/tk/library/xmfbox.tcl,v retrieving revision 1.14 diff -c -r1.14 xmfbox.tcl *** xmfbox.tcl 2000/06/30 20:19:07 1.14 --- xmfbox.tcl 2000/07/17 06:28:23 *************** *** 2,8 **** # # Implements the "Motif" style file selection dialog for the # Unix platform. This implementation is used only if the ! # "tk_strictMotif" flag is set. # # RCS: @(#) $Id: xmfbox.tcl,v 1.14 2000/06/30 20:19:07 ericm Exp $ # --- 2,8 ---- # # Implements the "Motif" style file selection dialog for the # Unix platform. This implementation is used only if the ! # "::tk_strictMotif" flag is set. # # RCS: @(#) $Id: xmfbox.tcl,v 1.14 2000/06/30 20:19:07 ericm Exp $ # *************** *** 16,22 **** namespace eval ::tk::dialog::file {} ! # tkMotifFDialog -- # # Implements a file dialog similar to the standard Motif file # selection box. --- 16,22 ---- namespace eval ::tk::dialog::file {} ! # ::tk::MotifFDialog -- # # Implements a file dialog similar to the standard Motif file # selection box. *************** *** 35,46 **** # with Windows it defines the maximum amount of memory to allocate for # the returned filenames. ! proc tkMotifFDialog {type args} { ! global tkPriv set dataName __tk_filedialog upvar ::tk::dialog::file::$dataName data ! set w [tkMotifFDialog_Create $dataName $type $args] # Set a grab and claim the focus too. --- 35,46 ---- # with Windows it defines the maximum amount of memory to allocate for # the returned filenames. ! proc ::tk::MotifFDialog {type args} { ! variable ::tk::Priv set dataName __tk_filedialog upvar ::tk::dialog::file::$dataName data ! set w [MotifFDialog_Create $dataName $type $args] # Set a grab and claim the focus too. *************** *** 53,71 **** # may take the focus away so we can't redirect it. Finally, # restore any grab that was in effect. ! tkwait variable tkPriv(selectFilePath) ::tk::RestoreFocusGrab $w $data(sEnt) withdraw ! return $tkPriv(selectFilePath) } ! # tkMotifFDialog_Create -- # # Creates the Motif file dialog (if it doesn't exist yet) and # initialize the internal data structure associated with the # dialog. # ! # This procedure is used by tkMotifFDialog to create the # dialog. It's also used by the test suite to test the Motif # file dialog implementation. User code shouldn't call this # procedure directly. --- 53,71 ---- # may take the focus away so we can't redirect it. Finally, # restore any grab that was in effect. ! vwait ::tk::Priv(selectFilePath) ::tk::RestoreFocusGrab $w $data(sEnt) withdraw ! return $Priv(selectFilePath) } ! # ::tk::MotifFDialog_Create -- # # Creates the Motif file dialog (if it doesn't exist yet) and # initialize the internal data structure associated with the # dialog. # ! # This procedure is used by ::tk::MotifFDialog to create the # dialog. It's also used by the test suite to test the Motif # file dialog implementation. User code shouldn't call this # procedure directly. *************** *** 78,88 **** # Results: # Pathname of the file dialog. ! proc tkMotifFDialog_Create {dataName type argList} { ! global tkPriv upvar ::tk::dialog::file::$dataName data ! tkMotifFDialog_Config $dataName $type $argList if {[string equal $data(-parent) .]} { set w .$dataName --- 78,87 ---- # Results: # Pathname of the file dialog. ! proc ::tk::MotifFDialog_Create {dataName type argList} { upvar ::tk::dialog::file::$dataName data ! MotifFDialog_Config $dataName $type $argList if {[string equal $data(-parent) .]} { set w .$dataName *************** *** 93,102 **** # (re)create the dialog box if necessary # if {![winfo exists $w]} { ! tkMotifFDialog_BuildUI $w } elseif {[string compare [winfo class $w] TkMotifFDialog]} { destroy $w ! tkMotifFDialog_BuildUI $w } else { set data(fEnt) $w.top.f1.ent set data(dList) $w.top.f2.a.l --- 92,101 ---- # (re)create the dialog box if necessary # if {![winfo exists $w]} { ! MotifFDialog_BuildUI $w } elseif {[string compare [winfo class $w] TkMotifFDialog]} { destroy $w ! MotifFDialog_BuildUI $w } else { set data(fEnt) $w.top.f1.ent set data(dList) $w.top.f2.a.l *************** *** 106,117 **** set data(filterBtn) $w.bot.filter set data(cancelBtn) $w.bot.cancel } ! tkMotifFDialog_SetListMode $w wm transient $w $data(-parent) ! tkMotifFDialog_FileTypes $w ! tkMotifFDialog_Update $w # Withdraw the window, then update all the geometry information # so we know how big it wants to be, then center the window in the --- 105,116 ---- set data(filterBtn) $w.bot.filter set data(cancelBtn) $w.bot.cancel } ! MotifFDialog_SetListMode $w wm transient $w $data(-parent) ! MotifFDialog_FileTypes $w ! MotifFDialog_Update $w # Withdraw the window, then update all the geometry information # so we know how big it wants to be, then center the window in the *************** *** 123,129 **** return $w } ! # tkMotifFDialog_FileTypes -- # # Checks the -filetypes option. If present this adds a list of radio- # buttons to pick the file types from. --- 122,128 ---- return $w } ! # ::tk::MotifFDialog_FileTypes -- # # Checks the -filetypes option. If present this adds a list of radio- # buttons to pick the file types from. *************** *** 134,140 **** # Results: # none ! proc tkMotifFDialog_FileTypes {w} { upvar ::tk::dialog::file::[winfo name $w] data set f $w.top.f3.types --- 133,139 ---- # Results: # none ! proc ::tk::MotifFDialog_FileTypes {w} { upvar ::tk::dialog::file::[winfo name $w] data set f $w.top.f3.types *************** *** 150,156 **** # set data(fileType) $data(-defaulttype) set data(fileType) 0 ! tkMotifFDialog_SetFilter $w [lindex $data(-filetypes) $data(fileType)] #don't produce radiobuttons for only one filetype if {[llength $data(-filetypes)] == 1} { --- 149,155 ---- # set data(fileType) $data(-defaulttype) set data(fileType) 0 ! MotifFDialog_SetFilter $w [lindex $data(-filetypes) $data(fileType)] #don't produce radiobuttons for only one filetype if {[llength $data(-filetypes)] == 1} { *************** *** 165,173 **** set filter [lindex $type 1] radiobutton $f.b$cnt \ -text $title \ ! -variable [winfo name $w](fileType) \ -value $cnt \ ! -command "[list tkMotifFDialog_SetFilter $w $type]" pack $f.b$cnt -side left incr cnt } --- 164,172 ---- set filter [lindex $type 1] radiobutton $f.b$cnt \ -text $title \ ! -variable ::tk::dialog::file::[winfo name $w](fileType) \ -value $cnt \ ! -command "[list tk::MotifFDialog_SetFilter $w $type]" pack $f.b$cnt -side left incr cnt } *************** *** 181,197 **** # This proc gets called whenever data(filter) is set # ! proc tkMotifFDialog_SetFilter {w type} { upvar ::tk::dialog::file::[winfo name $w] data ! global tkpriv set data(filter) [lindex $type 1] ! set tkpriv(selectFileType) [lindex [lindex $type 0] 0] ! tkMotifFDialog_Update $w } ! # tkMotifFDialog_Config -- # # Iterates over the optional arguments to determine the option # values for the Motif file dialog; gives default values to --- 180,196 ---- # This proc gets called whenever data(filter) is set # ! proc ::tk::MotifFDialog_SetFilter {w type} { upvar ::tk::dialog::file::[winfo name $w] data ! variable ::tk::Priv set data(filter) [lindex $type 1] ! set Priv(selectFileType) [lindex [lindex $type 0] 0] ! MotifFDialog_Update $w } ! # ::tk::MotifFDialog_Config -- # # Iterates over the optional arguments to determine the option # values for the Motif file dialog; gives default values to *************** *** 203,209 **** # type "Save" or "Open" # argList Options parsed by the procedure. ! proc tkMotifFDialog_Config {dataName type argList} { upvar ::tk::dialog::file::$dataName data set data(type) $type --- 202,208 ---- # type "Save" or "Open" # argList Options parsed by the procedure. ! proc ::tk::MotifFDialog_Config {dataName type argList} { upvar ::tk::dialog::file::$dataName data set data(type) $type *************** *** 270,276 **** # file dialog, but we check for validity of the value to make sure # the application code also runs fine with the TK file dialog. # ! set data(-filetypes) [tkFDGetFileTypes $data(-filetypes)] if {![info exists data(filter)]} { set data(filter) * --- 269,275 ---- # file dialog, but we check for validity of the value to make sure # the application code also runs fine with the TK file dialog. # ! set data(-filetypes) [::tk::FDGetFileTypes $data(-filetypes)] if {![info exists data(filter)]} { set data(filter) * *************** *** 280,286 **** } } ! # tkMotifFDialog_BuildUI -- # # Builds the UI components of the Motif file dialog. # --- 279,285 ---- } } ! # ::tk::MotifFDialog_BuildUI -- # # Builds the UI components of the Motif file dialog. # *************** *** 290,296 **** # Results: # None. ! proc tkMotifFDialog_BuildUI {w} { set dataName [lindex [split $w .] end] upvar ::tk::dialog::file::$dataName data --- 289,295 ---- # Results: # None. ! proc ::tk::MotifFDialog_BuildUI {w} { set dataName [lindex [split $w .] end] upvar ::tk::dialog::file::$dataName data *************** *** 332,340 **** # The file and directory lists # ! set data(dList) [tkMotifFDialog_MakeSList $w $f2a \ [::msgcat::mc "Directory:"] 0 DList] ! set data(fList) [tkMotifFDialog_MakeSList $w $f2b \ [::msgcat::mc "Files:"] 2 FList] # The Selection box --- 331,339 ---- # The file and directory lists # ! set data(dList) [MotifFDialog_MakeSList $w $f2a \ [::msgcat::mc "Directory:"] 0 DList] ! set data(fList) [MotifFDialog_MakeSList $w $f2b \ [::msgcat::mc "Files:"] 2 FList] # The Selection box *************** *** 351,363 **** set maxWidth [expr $maxWidth<6?6:$maxWidth] set data(okBtn) [button $bot.ok -text [::msgcat::mc "OK"] \ -width $maxWidth -under 0 \ ! -command [list tkMotifFDialog_OkCmd $w]] set data(filterBtn) [button $bot.filter -text [::msgcat::mc "Filter"] \ -width $maxWidth -under 0 \ ! -command [list tkMotifFDialog_FilterCmd $w]] set data(cancelBtn) [button $bot.cancel -text [::msgcat::mc "Cancel"] \ -width $maxWidth -under 0 \ ! -command [list tkMotifFDialog_CancelCmd $w]] pack $bot.ok $bot.filter $bot.cancel -padx 10 -pady 10 -expand yes \ -side left --- 350,362 ---- set maxWidth [expr $maxWidth<6?6:$maxWidth] set data(okBtn) [button $bot.ok -text [::msgcat::mc "OK"] \ -width $maxWidth -under 0 \ ! -command [list tk::MotifFDialog_OkCmd $w]] set data(filterBtn) [button $bot.filter -text [::msgcat::mc "Filter"] \ -width $maxWidth -under 0 \ ! -command [list tk::MotifFDialog_FilterCmd $w]] set data(cancelBtn) [button $bot.cancel -text [::msgcat::mc "Cancel"] \ -width $maxWidth -under 0 \ ! -command [list tk::MotifFDialog_CancelCmd $w]] pack $bot.ok $bot.filter $bot.cancel -padx 10 -pady 10 -expand yes \ -side left *************** *** 369,385 **** bind $w [list focus $data(fList)] bind $w [list focus $data(sEnt)] ! bind $w [list tkButtonInvoke $bot.ok] ! bind $w [list tkButtonInvoke $bot.filter] ! bind $w [list tkButtonInvoke $bot.cancel] ! bind $data(fEnt) [list tkMotifFDialog_ActivateFEnt $w] ! bind $data(sEnt) [list tkMotifFDialog_ActivateSEnt $w] ! wm protocol $w WM_DELETE_WINDOW [list tkMotifFDialog_CancelCmd $w] } ! proc tkMotifFDialog_SetListMode {w} { upvar ::tk::dialog::file::[winfo name $w] data if {$data(-multiple) != 0} { --- 368,384 ---- bind $w [list focus $data(fList)] bind $w [list focus $data(sEnt)] ! bind $w [list tk::ButtonInvoke $bot.ok] ! bind $w [list tk::ButtonInvoke $bot.filter] ! bind $w [list tk::ButtonInvoke $bot.cancel] ! bind $data(fEnt) [list tk::MotifFDialog_ActivateFEnt $w] ! bind $data(sEnt) [list tk::MotifFDialog_ActivateSEnt $w] ! wm protocol $w WM_DELETE_WINDOW [list tk::MotifFDialog_CancelCmd $w] } ! proc ::tk::MotifFDialog_SetListMode {w} { upvar ::tk::dialog::file::[winfo name $w] data if {$data(-multiple) != 0} { *************** *** 391,397 **** $f.l configure -selectmode $selectmode } ! # tkMotifFDialog_MakeSList -- # # Create a scrolled-listbox and set the keyboard accelerator # bindings so that the list selection follows what the user --- 390,396 ---- $f.l configure -selectmode $selectmode } ! # ::tk::MotifFDialog_MakeSList -- # # Create a scrolled-listbox and set the keyboard accelerator # bindings so that the list selection follows what the user *************** *** 406,412 **** # cmdPrefix Specifies procedures to call when the listbox is # browsed or activated. ! proc tkMotifFDialog_MakeSList {w f label under cmdPrefix} { label $f.lab -text $label -under $under -anchor w listbox $f.l -width 12 -height 5 -exportselection 0\ -xscrollcommand [list $f.h set] -yscrollcommand [list $f.v set] --- 405,411 ---- # cmdPrefix Specifies procedures to call when the listbox is # browsed or activated. ! proc ::tk::MotifFDialog_MakeSList {w f label under cmdPrefix} { label $f.lab -text $label -under $under -anchor w listbox $f.l -width 12 -height 5 -exportselection 0\ -xscrollcommand [list $f.h set] -yscrollcommand [list $f.v set] *************** *** 425,443 **** # bindings for the listboxes # set list $f.l ! bind $list <> [list tkMotifFDialog_Browse$cmdPrefix $w] bind $list \ ! [list tkMotifFDialog_Activate$cmdPrefix $w] ! bind $list "tkMotifFDialog_Browse$cmdPrefix [list $w]; \ ! tkMotifFDialog_Activate$cmdPrefix [list $w]" bindtags $list [list Listbox $list [winfo toplevel $list] all] ! tkListBoxKeyAccel_Set $list return $f.l } ! # tkMotifFDialog_InterpFilter -- # # Interpret the string in the filter entry into two components: # the directory and the pattern. If the string is a relative --- 424,442 ---- # bindings for the listboxes # set list $f.l ! bind $list <> [list tk::MotifFDialog_Browse$cmdPrefix $w] bind $list \ ! [list tk::MotifFDialog_Activate$cmdPrefix $w] ! bind $list "tk::MotifFDialog_Browse$cmdPrefix [list $w]; \ ! tk::MotifFDialog_Activate$cmdPrefix [list $w]" bindtags $list [list Listbox $list [winfo toplevel $list] all] ! ListBoxKeyAccel_Set $list return $f.l } ! # ::tk::MotifFDialog_InterpFilter -- # # Interpret the string in the filter entry into two components: # the directory and the pattern. If the string is a relative *************** *** 452,458 **** # specified # by the filter. The second element is the filter # pattern itself. ! proc tkMotifFDialog_InterpFilter {w} { upvar ::tk::dialog::file::[winfo name $w] data set text [string trim [$data(fEnt) get]] --- 451,457 ---- # specified # by the filter. The second element is the filter # pattern itself. ! proc ::tk::MotifFDialog_InterpFilter {w} { upvar ::tk::dialog::file::[winfo name $w] data set text [string trim [$data(fEnt) get]] *************** *** 504,510 **** return [list $dir $fil] } ! # tkMotifFDialog_Update # # Load the files and synchronize the "filter" and "selection" fields # boxes. --- 503,509 ---- return [list $dir $fil] } ! # ::tk::MotifFDialog_Update # # Load the files and synchronize the "filter" and "selection" fields # boxes. *************** *** 515,521 **** # Results: # None. ! proc tkMotifFDialog_Update {w} { upvar ::tk::dialog::file::[winfo name $w] data $data(fEnt) delete 0 end --- 514,520 ---- # Results: # None. ! proc ::tk::MotifFDialog_Update {w} { upvar ::tk::dialog::file::[winfo name $w] data $data(fEnt) delete 0 end *************** *** 524,533 **** $data(sEnt) insert 0 [::tk::dialog::file::JoinFile $data(selectPath) \ $data(selectFile)] ! tkMotifFDialog_LoadFiles $w } ! # tkMotifFDialog_LoadFiles -- # # Loads the files and directories into the two listboxes according # to the filter setting. --- 523,532 ---- $data(sEnt) insert 0 [::tk::dialog::file::JoinFile $data(selectPath) \ $data(selectFile)] ! MotifFDialog_LoadFiles $w } ! # ::tk::MotifFDialog_LoadFiles -- # # Loads the files and directories into the two listboxes according # to the filter setting. *************** *** 538,544 **** # Results: # None. ! proc tkMotifFDialog_LoadFiles {w} { upvar ::tk::dialog::file::[winfo name $w] data $data(dList) delete 0 end --- 537,543 ---- # Results: # None. ! proc ::tk::MotifFDialog_LoadFiles {w} { upvar ::tk::dialog::file::[winfo name $w] data $data(dList) delete 0 end *************** *** 585,591 **** cd $appPWD } ! # tkMotifFDialog_BrowseDList -- # # This procedure is called when the directory list is browsed # (clicked-over) by the user. --- 584,590 ---- cd $appPWD } ! # ::tk::MotifFDialog_BrowseDList -- # # This procedure is called when the directory list is browsed # (clicked-over) by the user. *************** *** 596,602 **** # Results: # None. ! proc tkMotifFDialog_BrowseDList {w} { upvar ::tk::dialog::file::[winfo name $w] data focus $data(dList) --- 595,601 ---- # Results: # None. ! proc ::tk::MotifFDialog_BrowseDList {w} { upvar ::tk::dialog::file::[winfo name $w] data focus $data(dList) *************** *** 610,616 **** $data(fList) selection clear 0 end ! set list [tkMotifFDialog_InterpFilter $w] set data(filter) [lindex $list 1] switch -- $subdir { --- 609,615 ---- $data(fList) selection clear 0 end ! set list [MotifFDialog_InterpFilter $w] set data(filter) [lindex $list 1] switch -- $subdir { *************** *** 631,637 **** $data(fEnt) insert 0 $newSpec } ! # tkMotifFDialog_ActivateDList -- # # This procedure is called when the directory list is activated # (double-clicked) by the user. --- 630,636 ---- $data(fEnt) insert 0 $newSpec } ! # ::tk::MotifFDialog_ActivateDList -- # # This procedure is called when the directory list is activated # (double-clicked) by the user. *************** *** 642,648 **** # Results: # None. ! proc tkMotifFDialog_ActivateDList {w} { upvar ::tk::dialog::file::[winfo name $w] data if {[string equal [$data(dList) curselection] ""]} { --- 641,647 ---- # Results: # None. ! proc ::tk::MotifFDialog_ActivateDList {w} { upvar ::tk::dialog::file::[winfo name $w] data if {[string equal [$data(dList) curselection] ""]} { *************** *** 668,674 **** } set data(selectPath) $newDir ! tkMotifFDialog_Update $w if {[string compare $subdir ..]} { $data(dList) selection set 0 --- 667,673 ---- } set data(selectPath) $newDir ! MotifFDialog_Update $w if {[string compare $subdir ..]} { $data(dList) selection set 0 *************** *** 679,685 **** } } ! # tkMotifFDialog_BrowseFList -- # # This procedure is called when the file list is browsed # (clicked-over) by the user. --- 678,684 ---- } } ! # ::tk::MotifFDialog_BrowseFList -- # # This procedure is called when the file list is browsed # (clicked-over) by the user. *************** *** 690,696 **** # Results: # None. ! proc tkMotifFDialog_BrowseFList {w} { upvar ::tk::dialog::file::[winfo name $w] data focus $data(fList) --- 689,695 ---- # Results: # None. ! proc ::tk::MotifFDialog_BrowseFList {w} { upvar ::tk::dialog::file::[winfo name $w] data focus $data(fList) *************** *** 721,727 **** $data(sEnt) xview end } ! # tkMotifFDialog_ActivateFList -- # # This procedure is called when the file list is activated # (double-clicked) by the user. --- 720,726 ---- $data(sEnt) xview end } ! # ::tk::MotifFDialog_ActivateFList -- # # This procedure is called when the file list is activated # (double-clicked) by the user. *************** *** 732,738 **** # Results: # None. ! proc tkMotifFDialog_ActivateFList {w} { upvar ::tk::dialog::file::[winfo name $w] data if {[string equal [$data(fList) curselection] ""]} { --- 731,737 ---- # Results: # None. ! proc ::tk::MotifFDialog_ActivateFList {w} { upvar ::tk::dialog::file::[winfo name $w] data if {[string equal [$data(fList) curselection] ""]} { *************** *** 742,752 **** if {[string equal $data(selectFile) ""]} { return } else { ! tkMotifFDialog_ActivateSEnt $w } } ! # tkMotifFDialog_ActivateFEnt -- # # This procedure is called when the user presses Return inside # the "filter" entry. It updates the dialog according to the --- 741,751 ---- if {[string equal $data(selectFile) ""]} { return } else { ! MotifFDialog_ActivateSEnt $w } } ! # ::tk::MotifFDialog_ActivateFEnt -- # # This procedure is called when the user presses Return inside # the "filter" entry. It updates the dialog according to the *************** *** 758,778 **** # Results: # None. ! proc tkMotifFDialog_ActivateFEnt {w} { upvar ::tk::dialog::file::[winfo name $w] data ! set list [tkMotifFDialog_InterpFilter $w] set data(selectPath) [lindex $list 0] set data(filter) [lindex $list 1] ! tkMotifFDialog_Update $w } ! # tkMotifFDialog_ActivateSEnt -- # # This procedure is called when the user presses Return inside ! # the "selection" entry. It sets the tkPriv(selectFilePath) global ! # variable so that the vwait loop in tkMotifFDialog will be # terminated. # # Arguments: --- 757,777 ---- # Results: # None. ! proc ::tk::MotifFDialog_ActivateFEnt {w} { upvar ::tk::dialog::file::[winfo name $w] data ! set list [MotifFDialog_InterpFilter $w] set data(selectPath) [lindex $list 0] set data(filter) [lindex $list 1] ! MotifFDialog_Update $w } ! # ::tk::MotifFDialog_ActivateSEnt -- # # This procedure is called when the user presses Return inside ! # the "selection" entry. It sets the ::tk::Priv(selectFilePath) ! # variable so that the vwait loop in tk::MotifFDialog will be # terminated. # # Arguments: *************** *** 781,794 **** # Results: # None. ! proc tkMotifFDialog_ActivateSEnt {w} { ! global tkPriv upvar ::tk::dialog::file::[winfo name $w] data set selectFilePath [string trim [$data(sEnt) get]] if {[string equal $selectFilePath ""]} { ! tkMotifFDialog_FilterCmd $w return } --- 780,793 ---- # Results: # None. ! proc ::tk::MotifFDialog_ActivateSEnt {w} { ! variable ::tk::Priv upvar ::tk::dialog::file::[winfo name $w] data set selectFilePath [string trim [$data(sEnt) get]] if {[string equal $selectFilePath ""]} { ! MotifFDialog_FilterCmd $w return } *************** *** 799,805 **** if {[file isdirectory [lindex $selectFilePath 0]]} { set data(selectPath) [lindex [glob $selectFilePath] 0] set data(selectFile) "" ! tkMotifFDialog_Update $w return } --- 798,804 ---- if {[file isdirectory [lindex $selectFilePath 0]]} { set data(selectPath) [lindex [glob $selectFilePath] 0] set data(selectFile) "" ! MotifFDialog_Update $w return } *************** *** 839,890 **** } if {$data(-multiple) != 0} { ! set tkPriv(selectFilePath) $newFileList } else { ! set tkPriv(selectFilePath) [lindex $newFileList 0] } # Set selectFile and selectPath to first item in list ! set tkPriv(selectFile) [file tail [lindex $newFileList 0]] ! set tkPriv(selectPath) [file dirname [lindex $newFileList 0]] } ! proc tkMotifFDialog_OkCmd {w} { upvar ::tk::dialog::file::[winfo name $w] data ! tkMotifFDialog_ActivateSEnt $w } ! proc tkMotifFDialog_FilterCmd {w} { upvar ::tk::dialog::file::[winfo name $w] data ! tkMotifFDialog_ActivateFEnt $w } ! proc tkMotifFDialog_CancelCmd {w} { ! global tkPriv ! set tkPriv(selectFilePath) "" ! set tkPriv(selectFile) "" ! set tkPriv(selectPath) "" } ! proc tkListBoxKeyAccel_Set {w} { bind Listbox "" ! bind $w [list tkListBoxKeyAccel_Unset $w] ! bind $w [list tkListBoxKeyAccel_Key $w %A] } ! proc tkListBoxKeyAccel_Unset {w} { ! global tkPriv ! catch {after cancel $tkPriv(lbAccel,$w,afterId)} ! catch {unset tkPriv(lbAccel,$w)} ! catch {unset tkPriv(lbAccel,$w,afterId)} } ! # tkListBoxKeyAccel_Key-- # # This procedure maintains a list of recently entered keystrokes # over a listbox widget. It arranges an idle event to move the --- 838,889 ---- } if {$data(-multiple) != 0} { ! set Priv(selectFilePath) $newFileList } else { ! set Priv(selectFilePath) [lindex $newFileList 0] } # Set selectFile and selectPath to first item in list ! set Priv(selectFile) [file tail [lindex $newFileList 0]] ! set Priv(selectPath) [file dirname [lindex $newFileList 0]] } ! proc ::tk::MotifFDialog_OkCmd {w} { upvar ::tk::dialog::file::[winfo name $w] data ! MotifFDialog_ActivateSEnt $w } ! proc ::tk::MotifFDialog_FilterCmd {w} { upvar ::tk::dialog::file::[winfo name $w] data ! MotifFDialog_ActivateFEnt $w } ! proc ::tk::MotifFDialog_CancelCmd {w} { ! variable ::tk::Priv ! set Priv(selectFilePath) "" ! set Priv(selectFile) "" ! set Priv(selectPath) "" } ! proc ::tk::ListBoxKeyAccel_Set {w} { bind Listbox "" ! bind $w [list tk::ListBoxKeyAccel_Unset $w] ! bind $w [list tk::ListBoxKeyAccel_Key $w %A] } ! proc ::tk::ListBoxKeyAccel_Unset {w} { ! variable ::tk::Priv ! catch {after cancel $Priv(lbAccel,$w,afterId)} ! catch {unset Priv(lbAccel,$w)} ! catch {unset Priv(lbAccel,$w,afterId)} } ! # ::tk::ListBoxKeyAccel_Key-- # # This procedure maintains a list of recently entered keystrokes # over a listbox widget. It arranges an idle event to move the *************** *** 898,920 **** # Results: # None. ! proc tkListBoxKeyAccel_Key {w key} { ! global tkPriv if { $key == "" } { return } ! append tkPriv(lbAccel,$w) $key ! tkListBoxKeyAccel_Goto $w $tkPriv(lbAccel,$w) catch { ! after cancel $tkPriv(lbAccel,$w,afterId) } ! set tkPriv(lbAccel,$w,afterId) [after 500 \ ! [list tkListBoxKeyAccel_Reset $w]] } ! proc tkListBoxKeyAccel_Goto {w string} { ! global tkPriv set string [string tolower $string] set end [$w index end] --- 897,919 ---- # Results: # None. ! proc ::tk::ListBoxKeyAccel_Key {w key} { ! variable ::tk::Priv if { $key == "" } { return } ! append Priv(lbAccel,$w) $key ! ListBoxKeyAccel_Goto $w $Priv(lbAccel,$w) catch { ! after cancel $Priv(lbAccel,$w,afterId) } ! set Priv(lbAccel,$w,afterId) [after 500 \ ! [list tk::ListBoxKeyAccel_Reset $w]] } ! proc ::tk::ListBoxKeyAccel_Goto {w string} { ! variable ::tk::Priv set string [string tolower $string] set end [$w index end] *************** *** 940,954 **** } } ! proc tkListBoxKeyAccel_Reset {w} { ! global tkPriv ! catch {unset tkPriv(lbAccel,$w)} } ! proc tk_getFileType {} { ! global tkpriv ! ! return $tkpriv(selectFileType) } --- 939,953 ---- } } ! proc ::tk::ListBoxKeyAccel_Reset {w} { ! variable ::tk::Priv ! catch {unset Priv(lbAccel,$w)} } + proc ::tk_getFileType {} { + variable ::tk::Priv ! return $Priv(selectFileType) } + Index: mac/tkMacMenu.c =================================================================== RCS file: /cvsroot/tk/mac/tkMacMenu.c,v retrieving revision 1.18 diff -c -r1.18 tkMacMenu.c *** tkMacMenu.c 2000/02/10 08:55:47 1.18 --- tkMacMenu.c 2000/07/17 06:28:49 *************** *** 3340,3346 **** if (windowPart != inMenuBar) { Tcl_DStringInit(&tearoffCmdStr); ! Tcl_DStringAppendElement(&tearoffCmdStr, "tkTearOffMenu"); Tcl_DStringAppendElement(&tearoffCmdStr, Tk_PathName(tearoffStruct.menuPtr->tkwin)); sprintf(intString, "%d", tearoffStruct.point.h); --- 3340,3346 ---- if (windowPart != inMenuBar) { Tcl_DStringInit(&tearoffCmdStr); ! Tcl_DStringAppendElement(&tearoffCmdStr, "tk::TearOffMenu"); Tcl_DStringAppendElement(&tearoffCmdStr, Tk_PathName(tearoffStruct.menuPtr->tkwin)); sprintf(intString, "%d", tearoffStruct.point.h); Index: tests/all.tcl =================================================================== RCS file: /cvsroot/tk/tests/all.tcl,v retrieving revision 1.4 diff -c -r1.4 all.tcl *** all.tcl 1999/04/21 21:53:29 1.4 --- all.tcl 2000/07/17 06:28:49 *************** *** 13,18 **** --- 13,19 ---- source [file join [pwd] [file dirname [info script]] defs.tcl] } set ::tcltest::testSingleFile false + set ::tcltest::verbose bps puts stdout "Tk $tk_patchLevel tests running in interp: [info nameofexecutable]" puts stdout "Tests running in working dir: $::tcltest::workingDir" Index: tests/clrpick.test =================================================================== RCS file: /cvsroot/tk/tests/clrpick.test,v retrieving revision 1.5 diff -c -r1.5 clrpick.test *** clrpick.test 2000/03/02 03:02:13 1.5 --- clrpick.test 2000/07/17 06:28:51 *************** *** 54,60 **** list [catch {tk_chooseColor -initialcolor ##badbadbaadcolor} msg] $msg } {1 {invalid color name "##badbadbaadcolor"}} ! if {[info commands tkColorDialog] == ""} { set isNative 1 } else { set isNative 0 --- 54,60 ---- list [catch {tk_chooseColor -initialcolor ##badbadbaadcolor} msg] $msg } {1 {invalid color name "##badbadbaadcolor"}} ! if {[info commands tk::dialog::color::] == ""} { set isNative 1 } else { set isNative 0 *************** *** 82,88 **** proc ChooseColorByKey {parent r g b} { set w .__tk__color ! upvar #0 $w data update $data(red,entry) delete 0 end --- 82,88 ---- proc ChooseColorByKey {parent r g b} { set w .__tk__color ! upvar ::tk::dialog::color::[winfo name $w] data update $data(red,entry) delete 0 end *************** *** 96,109 **** # Manually force the refresh of the color values instead # of counting on the timing of the event stream to change # the values for us. ! tkColorDialog_HandleRGBEntry $w SendButtonPress $parent ok mouse } proc SendButtonPress {parent btn type} { set w .__tk__color ! upvar #0 $w data set button $data($btn\Btn) if ![winfo ismapped $button] { --- 96,109 ---- # Manually force the refresh of the color values instead # of counting on the timing of the event stream to change # the values for us. ! tk::dialog::color::HandleRGBEntry $w SendButtonPress $parent ok mouse } proc SendButtonPress {parent btn type} { set w .__tk__color ! upvar ::tk::dialog::color::[winfo name $w] data set button $data($btn\Btn) if ![winfo ismapped $button] { Index: tests/filebox.test =================================================================== RCS file: /cvsroot/tk/tests/filebox.test,v retrieving revision 1.10 diff -c -r1.10 filebox.test *** filebox.test 2000/06/30 20:19:07 1.10 --- filebox.test 2000/07/17 06:28:53 *************** *** 161,167 **** list [catch {$command -filetypes {Foo}} msg] $msg } {1 {bad file type "Foo", should be "typeName {extension ?extensions ...?} ?{macType ?macTypes ...?}?"}} ! if {[info commands tkMotifFDialog] == "" && [info commands ::tk::dialog::file::tkFDialog] == ""} { set isNative 1 } else { set isNative 0 --- 161,167 ---- list [catch {$command -filetypes {Foo}} msg] $msg } {1 {bad file type "Foo", should be "typeName {extension ?extensions ...?} ?{macType ?macTypes ...?}?"}} ! if {[info commands tk::MotifFDialog] == "" && [info commands ::tk::dialog::file::tkFDialog] == ""} { set isNative 1 } else { set isNative 0 Index: tests/macMenu.test =================================================================== RCS file: /cvsroot/tk/tests/macMenu.test,v retrieving revision 1.3 diff -c -r1.3 macMenu.test *** macMenu.test 1999/04/16 01:51:39 1.3 --- macMenu.test 2000/07/17 06:29:02 *************** *** 916,922 **** menu .t2.m1.foo .t2.m1.foo add command -label foo raise .t2 ! tkTearOffMenu .t2.m1.foo 100 100 list [catch {update} msg] $msg [destroy .t2] } {0 {} {}} --- 916,922 ---- menu .t2.m1.foo .t2.m1.foo add command -label foo raise .t2 ! tk::TearOffMenu .t2.m1.foo 100 100 list [catch {update} msg] $msg [destroy .t2] } {0 {} {}} *************** *** 932,993 **** menu .m1 .m1 add checkbutton -label foo .m1 invoke foo ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-25.1 {GetMenuAccelGeometry - cascade entry} { catch {destroy .m1} menu .m1 .m1 add cascade -label foo ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-25.2 {GetMenuAccelGeometry - no accel} { catch {destroy .m1} menu .m1 .m1 add command ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-25.3 {GetMenuAccelGeometry - no special chars - arbitrary string} { catch {destroy .m1} menu .m1 .m1 add command -accel "Test" ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-25.4 {GetMenuAccelGeometry - Command} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Cmd+S" ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-25.5 {GetMenuAccelGeometry - Control} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Ctrl+S" ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-25.6 {GetMenuAccelGeometry - Shift} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Shift+S" ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-25.7 {GetMenuAccelGeometry - Option} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Opt+S" ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-25.8 {GetMenuAccelGeometry - Combination} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Cmd+Shift+S" ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-25.9 {GetMenuAccelGeometry - extra text} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Command+Delete" ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-26.1 {GetTearoffEntryGeometry} { --- 932,993 ---- menu .m1 .m1 add checkbutton -label foo .m1 invoke foo ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-25.1 {GetMenuAccelGeometry - cascade entry} { catch {destroy .m1} menu .m1 .m1 add cascade -label foo ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-25.2 {GetMenuAccelGeometry - no accel} { catch {destroy .m1} menu .m1 .m1 add command ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-25.3 {GetMenuAccelGeometry - no special chars - arbitrary string} { catch {destroy .m1} menu .m1 .m1 add command -accel "Test" ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-25.4 {GetMenuAccelGeometry - Command} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Cmd+S" ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-25.5 {GetMenuAccelGeometry - Control} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Ctrl+S" ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-25.6 {GetMenuAccelGeometry - Shift} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Shift+S" ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-25.7 {GetMenuAccelGeometry - Option} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Opt+S" ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-25.8 {GetMenuAccelGeometry - Combination} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Cmd+Shift+S" ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-25.9 {GetMenuAccelGeometry - extra text} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Command+Delete" ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-26.1 {GetTearoffEntryGeometry} { *************** *** 998,1011 **** catch {destroy .m1} menu .m1 .m1 add separator ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-28.1 {DrawMenuEntryIndicator - non-checkbutton} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-28.2 {DrawMenuEntryIndicator - indicator off} { --- 998,1011 ---- catch {destroy .m1} menu .m1 .m1 add separator ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test macMenu-28.1 {DrawMenuEntryIndicator - non-checkbutton} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-28.2 {DrawMenuEntryIndicator - indicator off} { *************** *** 1013,1026 **** menu .m1 .m1 add checkbutton -label foo -indicatoron 0 .m1 invoke foo ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-28.3 {DrawMenuEntryIndicator - not selected} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-28.4 {DrawMenuEntryIndicator - checkbutton} { --- 1013,1026 ---- menu .m1 .m1 add checkbutton -label foo -indicatoron 0 .m1 invoke foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-28.3 {DrawMenuEntryIndicator - not selected} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-28.4 {DrawMenuEntryIndicator - checkbutton} { *************** *** 1028,1034 **** menu .m1 .m1 add checkbutton -label foo .m1 invoke foo ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-28.5 {DrawMenuEntryIndicator - radiobutton} { --- 1028,1034 ---- menu .m1 .m1 add checkbutton -label foo .m1 invoke foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-28.5 {DrawMenuEntryIndicator - radiobutton} { *************** *** 1036,1042 **** menu .m1 .m1 add radiobutton -label foo .m1 invoke foo ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} --- 1036,1042 ---- menu .m1 .m1 add radiobutton -label foo .m1 invoke foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} *************** *** 1045,1051 **** catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Cmd+S" ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} --- 1045,1051 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Cmd+S" ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} *************** *** 1054,1109 **** catch {destroy .m1} menu .m1 .m1 add cascade -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-30.2 {DrawMenuEntryAccelerator - no accel string} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-30.3 {DrawMenuEntryAccelerator - random accel string} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel foo ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-30.4 {DrawMenuEntryAccelerator - Command} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Cmd+S" ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-30.5 {DrawMenuEntryAccelerator - Option} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Opt+S" ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-30.6 {DrawMenuEntryAccelerator - Shift} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Shift+S" ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-30.7 {DrawMenuEntryAccelerator - Control} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Ctrl+S" ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-30.8 {DrawMenuEntryAccelerator - combination} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Cmd+Shift+S" ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} --- 1054,1109 ---- catch {destroy .m1} menu .m1 .m1 add cascade -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-30.2 {DrawMenuEntryAccelerator - no accel string} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-30.3 {DrawMenuEntryAccelerator - random accel string} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-30.4 {DrawMenuEntryAccelerator - Command} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Cmd+S" ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-30.5 {DrawMenuEntryAccelerator - Option} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Opt+S" ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-30.6 {DrawMenuEntryAccelerator - Shift} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Shift+S" ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-30.7 {DrawMenuEntryAccelerator - Control} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Ctrl+S" ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test macMenu-30.8 {DrawMenuEntryAccelerator - combination} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Cmd+Shift+S" ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} *************** *** 1111,1117 **** catch {destroy .m1} menu .m1 .m1 add separator ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} --- 1111,1117 ---- catch {destroy .m1} menu .m1 .m1 add separator ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} *************** *** 1119,1125 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} --- 1119,1125 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} *************** *** 1143,1149 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} --- 1143,1149 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} *************** *** 1151,1157 **** catch {destroy .m1} menu .m1 .m1 add command -label foo -activeforeground red ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} --- 1151,1157 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo -activeforeground red ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} *************** *** 1160,1166 **** menu .m1 set tk_strictMotif 1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] [set tk_strictMotif 0] } {{} {} 0} --- 1160,1166 ---- menu .m1 set tk_strictMotif 1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] [set tk_strictMotif 0] } {{} {} 0} *************** *** 1168,1202 **** catch {destroy .m1} menu .m1 -disabledforeground blue .m1 add command -label foo -state disabled -background red ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} { catch {destroy .m1} menu .m1 -disabledforeground blue .m1 add command -label foo -state disabled ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} { catch {destroy .m1} menu .m1 -disabledforeground "" .m1 add command -label foo -state disabled ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.7 {TkpDrawMenuEntry - gc for normal - custom entry} { catch {destroy .m1} menu .m1 .m1 add command -label foo -foreground red ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.8 {TkpDrawMenuEntry - gc for normal} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.9 {TkpDrawMenuEntry - gc for indicator - custom entry} { --- 1168,1202 ---- catch {destroy .m1} menu .m1 -disabledforeground blue .m1 add command -label foo -state disabled -background red ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} { catch {destroy .m1} menu .m1 -disabledforeground blue .m1 add command -label foo -state disabled ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} { catch {destroy .m1} menu .m1 -disabledforeground "" .m1 add command -label foo -state disabled ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.7 {TkpDrawMenuEntry - gc for normal - custom entry} { catch {destroy .m1} menu .m1 .m1 add command -label foo -foreground red ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.8 {TkpDrawMenuEntry - gc for normal} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.9 {TkpDrawMenuEntry - gc for indicator - custom entry} { *************** *** 1204,1210 **** menu .m1 .m1 add checkbutton -label foo -selectcolor orange .m1 invoke 1 ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.10 {TkpDrawMenuEntry - gc for indicator} { --- 1204,1210 ---- menu .m1 .m1 add checkbutton -label foo -selectcolor orange .m1 invoke 1 ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.10 {TkpDrawMenuEntry - gc for indicator} { *************** *** 1212,1225 **** menu .m1 .m1 add checkbutton -label foo .m1 invoke 1 ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.11 {TkpDrawMenuEntry - border - custom entry} { catch {destroy .m1} menu .m1 .m1 add command -label foo -activebackground green ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} --- 1212,1225 ---- menu .m1 .m1 add checkbutton -label foo .m1 invoke 1 ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.11 {TkpDrawMenuEntry - border - custom entry} { catch {destroy .m1} menu .m1 .m1 add command -label foo -activebackground green ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} *************** *** 1227,1233 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} --- 1227,1233 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} *************** *** 1236,1242 **** set tk_strictMotif 1 menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] [set tk_strictMotif 0] } {{} {} 0} --- 1236,1242 ---- set tk_strictMotif 1 menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] [set tk_strictMotif 0] } {{} {} 0} *************** *** 1244,1250 **** catch {destroy .m1} menu .m1 .m1 add command -label foo -activeforeground yellow ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} --- 1244,1250 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo -activeforeground yellow ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} *************** *** 1252,1258 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} --- 1252,1258 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} *************** *** 1260,1287 **** catch {destroy .m1} menu .m1 .m1 add command -label foo -font "Helvectica 72" ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.17 {TkpDrawMenuEntry - font} { catch {destroy .m1} menu .m1 -font "Courier 72" .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.18 {TkpDrawMenuEntry - separator} { catch {destroy .m1} menu .m1 .m1 add separator ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.19 {TkpDrawMenuEntry - standard} { catch {destroy .mb} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.20 {TkpDrawMenuEntry - disabled cascade item} { --- 1260,1287 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo -font "Helvectica 72" ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.17 {TkpDrawMenuEntry - font} { catch {destroy .m1} menu .m1 -font "Courier 72" .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.18 {TkpDrawMenuEntry - separator} { catch {destroy .m1} menu .m1 .m1 add separator ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.19 {TkpDrawMenuEntry - standard} { catch {destroy .mb} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.20 {TkpDrawMenuEntry - disabled cascade item} { *************** *** 1291,1297 **** menu .m1.file .m1.file add command -label foo .m1 entryconfigure File -state disabled ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.21 {TkpDrawMenuEntry - indicator} { --- 1291,1297 ---- menu .m1.file .m1.file add command -label foo .m1 entryconfigure File -state disabled ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.21 {TkpDrawMenuEntry - indicator} { *************** *** 1299,1305 **** menu .m1 .m1 add checkbutton -label macMenu-40.20 .m1 invoke 0 ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.22 {TkpDrawMenuEntry - indicator - hideMargin} { --- 1299,1305 ---- menu .m1 .m1 add checkbutton -label macMenu-40.20 .m1 invoke 0 ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-40.22 {TkpDrawMenuEntry - indicator - hideMargin} { *************** *** 1307,1313 **** menu .m1 .m1 add checkbutton -label macMenu-40.21 -hidemargin 1 .m1 invoke 0 ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} --- 1307,1313 ---- menu .m1 .m1 add checkbutton -label macMenu-40.21 -hidemargin 1 .m1 invoke 0 ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} *************** *** 1457,1463 **** catch {destroy .m1} menu .m1 .m1 add command -label "foo" ! set tearoff [tkTearOffMenu .m1] list [update idletasks] [destroy .m1] } {{} {}} test macMenu-42.2 {DrawMenuEntryLabel - drawing image} { --- 1457,1463 ---- catch {destroy .m1} menu .m1 .m1 add command -label "foo" ! set tearoff [tk::TearOffMenu .m1] list [update idletasks] [destroy .m1] } {{} {}} test macMenu-42.2 {DrawMenuEntryLabel - drawing image} { *************** *** 1466,1472 **** image create test image1 menu .m1 .m1 add command -image image1 ! set tearoff [tkTearOffMenu .m1] list [update idletasks] [destroy .m1] [image delete image1] } {{} {} {}} test macMenu-42.3 {DrawMenuEntryLabel - drawing select image} { --- 1466,1472 ---- image create test image1 menu .m1 .m1 add command -image image1 ! set tearoff [tk::TearOffMenu .m1] list [update idletasks] [destroy .m1] [image delete image1] } {{} {} {}} test macMenu-42.3 {DrawMenuEntryLabel - drawing select image} { *************** *** 1477,1511 **** menu .m1 .m1 add checkbutton -image image1 -selectimage image2 .m1 invoke 1 ! set tearoff [tkTearOffMenu .m1] list [update idletasks] [destroy .m1] [eval image delete [image names]] } {{} {} {}} test macMenu-42.4 {DrawMenuEntryLabel - drawing a bitmap} { catch {destroy .m1} menu .m1 .m1 add command -bitmap questhead ! set tearoff [tkTearOffMenu .m1] list [update idletasks] [destroy .m1] } {{} {}} test macMenu-42.5 {DrawMenuEntryLabel - drawing null label} { catch {destroy .m1} menu .m1 .m1 add command ! set tearoff [tkTearOffMenu .m1] list [update idletasks] [destroy .m1] } {{} {}} test macMenu-42.6 {DrawMenuEntryLabel - drawing real label} { catch {destroy .m1} menu .m1 .m1 add command -label "This is a long label" -underline 3 ! set tearoff [tkTearOffMenu .m1] list [update idletasks] [destroy .m1] } {{} {}} test macMenu-42.7 {DrawMenuEntryLabel - drawing disabled label} { catch {destroy .m1} menu .m1 -disabledforeground "" .m1 add command -label "This is a long label" -state disabled ! set tearoff [tkTearOffMenu .m1] list [update idletasks] [destroy .m1] } {{} {}} test macMenu-42.8 {DrawMenuEntryLabel - disabled images} { --- 1477,1511 ---- menu .m1 .m1 add checkbutton -image image1 -selectimage image2 .m1 invoke 1 ! set tearoff [tk::TearOffMenu .m1] list [update idletasks] [destroy .m1] [eval image delete [image names]] } {{} {} {}} test macMenu-42.4 {DrawMenuEntryLabel - drawing a bitmap} { catch {destroy .m1} menu .m1 .m1 add command -bitmap questhead ! set tearoff [tk::TearOffMenu .m1] list [update idletasks] [destroy .m1] } {{} {}} test macMenu-42.5 {DrawMenuEntryLabel - drawing null label} { catch {destroy .m1} menu .m1 .m1 add command ! set tearoff [tk::TearOffMenu .m1] list [update idletasks] [destroy .m1] } {{} {}} test macMenu-42.6 {DrawMenuEntryLabel - drawing real label} { catch {destroy .m1} menu .m1 .m1 add command -label "This is a long label" -underline 3 ! set tearoff [tk::TearOffMenu .m1] list [update idletasks] [destroy .m1] } {{} {}} test macMenu-42.7 {DrawMenuEntryLabel - drawing disabled label} { catch {destroy .m1} menu .m1 -disabledforeground "" .m1 add command -label "This is a long label" -state disabled ! set tearoff [tk::TearOffMenu .m1] list [update idletasks] [destroy .m1] } {{} {}} test macMenu-42.8 {DrawMenuEntryLabel - disabled images} { *************** *** 1514,1520 **** image create test image1 menu .m1 .m1 add command -image image1 -state disabled ! set tearoff [tkTearOffMenu .m1 100 100] list [update idletasks] [destroy .m1] [image delete image1] } {{} {} {}} --- 1514,1520 ---- image create test image1 menu .m1 .m1 add command -image image1 -state disabled ! set tearoff [tk::TearOffMenu .m1 100 100] list [update idletasks] [destroy .m1] [image delete image1] } {{} {} {}} *************** *** 1549,1562 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-44.2 {DrawMenuEntryBackground} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] $tearoff activate 0 list [update] [destroy .m1] } {{} {}} --- 1549,1562 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test macMenu-44.2 {DrawMenuEntryBackground} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] $tearoff activate 0 list [update] [destroy .m1] } {{} {}} Index: tests/menu.test =================================================================== RCS file: /cvsroot/tk/tests/menu.test,v retrieving revision 1.4 diff -c -r1.4 menu.test *** menu.test 2000/05/11 22:37:05 1.4 --- menu.test 2000/07/17 06:29:17 *************** *** 1066,1085 **** test menu-5.7 {DestroyMenuInstance - basic clones} { catch {destroy .m1} menu .m1 ! set tearoff [tkTearOffMenu .m1] list [catch {destroy $tearoff} msg] $msg [destroy .m1] } {0 {} {}} test menu-5.8 {DestroyMenuInstance - multiple clones} { catch {destroy .m1} menu .m1 ! set tearoff1 [tkTearOffMenu .m1] ! set tearoff2 [tkTearOffMenu .m1] list [catch {destroy $tearoff1} msg] $msg [destroy .m1] } {0 {} {}} test menu-5.9 {DestroyMenuInstace - master menu} { catch {destroy .m1} menu .m1 ! tkTearOffMenu .m1 list [catch {destroy .m1} msg] $msg } {0 {}} test menu-5.10 {DestroyMenuInstance - freeing entries} { --- 1066,1085 ---- test menu-5.7 {DestroyMenuInstance - basic clones} { catch {destroy .m1} menu .m1 ! set tearoff [tk::TearOffMenu .m1] list [catch {destroy $tearoff} msg] $msg [destroy .m1] } {0 {} {}} test menu-5.8 {DestroyMenuInstance - multiple clones} { catch {destroy .m1} menu .m1 ! set tearoff1 [tk::TearOffMenu .m1] ! set tearoff2 [tk::TearOffMenu .m1] list [catch {destroy $tearoff1} msg] $msg [destroy .m1] } {0 {} {}} test menu-5.9 {DestroyMenuInstace - master menu} { catch {destroy .m1} menu .m1 ! tk::TearOffMenu .m1 list [catch {destroy .m1} msg] $msg } {0 {}} test menu-5.10 {DestroyMenuInstance - freeing entries} { *************** *** 1105,1111 **** menu .m1 menu .m2 .m1 add cascade -menu .m2 ! set tearoff [tkTearOffMenu .m1 40 40] list [destroy .m2] [destroy .m1] } {{} {}} --- 1105,1111 ---- menu .m1 menu .m2 .m1 add cascade -menu .m2 ! set tearoff [tk::TearOffMenu .m1 40 40] list [destroy .m2] [destroy .m1] } {{} {}} *************** *** 1899,1905 **** catch {destroy .m2} menu .m1 menu .m2 ! set tearoff [tkTearOffMenu .m2] list [catch {.m2 add cascade -menu .m1} msg] $msg [$tearoff unpost] [catch {destroy .m1} msg2] $msg2 [catch {destroy .m2} msg3] $msg3 } {0 {} {} 0 {} 0 {}} test menu-16.17 {MenuAddOrInsert} { --- 1899,1905 ---- catch {destroy .m2} menu .m1 menu .m2 ! set tearoff [tk::TearOffMenu .m2] list [catch {.m2 add cascade -menu .m1} msg] $msg [$tearoff unpost] [catch {destroy .m1} msg2] $msg2 [catch {destroy .m2} msg3] $msg3 } {0 {} {} 0 {} 0 {}} test menu-16.17 {MenuAddOrInsert} { *************** *** 1908,1914 **** menu .m1 menu .container . configure -menu .container ! set tearoff [tkTearOffMenu .container] list [catch {.container add cascade -label "File" -menu .m1} msg] $msg [. configure -menu ""] [destroy .m1 .container] } {0 {} {} {}} test menu-16.18 {MenuAddOrInsert} { --- 1908,1914 ---- menu .m1 menu .container . configure -menu .container ! set tearoff [tk::TearOffMenu .container] list [catch {.container add cascade -label "File" -menu .m1} msg] $msg [. configure -menu ""] [destroy .m1 .container] } {0 {} {} {}} test menu-16.18 {MenuAddOrInsert} { Index: tests/menuDraw.test =================================================================== RCS file: /cvsroot/tk/tests/menuDraw.test,v retrieving revision 1.3 diff -c -r1.3 menuDraw.test *** menuDraw.test 1999/04/16 01:51:39 1.3 --- menuDraw.test 2000/07/17 06:29:20 *************** *** 168,174 **** catch {destroy .m1} menu .m1 .m1 add command -label "This is a long label" ! set tearoff [tkTearOffMenu .m1] update idletasks list [.m1 entryconfigure 1 -label "foo"] [destroy .m1] } {{} {}} --- 168,174 ---- catch {destroy .m1} menu .m1 .m1 add command -label "This is a long label" ! set tearoff [tk::TearOffMenu .m1] update idletasks list [.m1 entryconfigure 1 -label "foo"] [destroy .m1] } {{} {}} *************** *** 176,182 **** catch {destroy .m1} menu .m1 .m1 add command -label "This is a long label" ! set tearoff [tkTearOffMenu .m1] list [.m1 entryconfigure 1 -label "foo"] [destroy .m1] } {{} {}} --- 176,182 ---- catch {destroy .m1} menu .m1 .m1 add command -label "This is a long label" ! set tearoff [tk::TearOffMenu .m1] list [.m1 entryconfigure 1 -label "foo"] [destroy .m1] } {{} {}} *************** *** 196,209 **** menu .m1 set foo 0 .m1 add radiobutton -variable foo -label test ! tkTearOffMenu .m1 update idletasks list [set foo test] [destroy .m1] [unset foo] } {test {} {}} test menuDraw-9.2 {TkEventuallyRedrawMenu - whole menu} { catch {destroy .m1} menu .m1 ! list [catch {tkTearOffMenu .m1}] [destroy .m1] } {0 {}} # Don't know how to test when window has been deleted and ComputeMenuGeometry --- 196,209 ---- menu .m1 set foo 0 .m1 add radiobutton -variable foo -label test ! tk::TearOffMenu .m1 update idletasks list [set foo test] [destroy .m1] [unset foo] } {test {} {}} test menuDraw-9.2 {TkEventuallyRedrawMenu - whole menu} { catch {destroy .m1} menu .m1 ! list [catch {tk::TearOffMenu .m1}] [destroy .m1] } {0 {}} # Don't know how to test when window has been deleted and ComputeMenuGeometry *************** *** 244,250 **** menu .m1 .m1 add checkbutton -image image1 -selectimage image2 .m1 invoke 1 ! set tearoff [tkTearOffMenu .m1 40 40] update idletasks list [image delete image2] [destroy .m1] [eval image delete [image names]] } {{} {} {}} --- 244,250 ---- menu .m1 .m1 add checkbutton -image image1 -selectimage image2 .m1 invoke 1 ! set tearoff [tk::TearOffMenu .m1 40 40] update idletasks list [image delete image2] [destroy .m1] [eval image delete [image names]] } {{} {} {}} *************** *** 256,262 **** menu .m1 .m1 add checkbutton -image image1 -selectimage image2 .m1 invoke 1 ! set tearoff [tkTearOffMenu .m1 40 40] list [image delete image2] [destroy .m1] [eval image delete [image names]] } {{} {} {}} test menuDraw-11.3 {TkMenuSelectImageProc - entry not selected} { --- 256,262 ---- menu .m1 .m1 add checkbutton -image image1 -selectimage image2 .m1 invoke 1 ! set tearoff [tk::TearOffMenu .m1 40 40] list [image delete image2] [destroy .m1] [eval image delete [image names]] } {{} {} {}} test menuDraw-11.3 {TkMenuSelectImageProc - entry not selected} { *************** *** 266,272 **** image create test image2 menu .m1 .m1 add checkbutton -image image1 -selectimage image2 ! set tearoff [tkTearOffMenu .m1 40 40] update idletasks list [image delete image2] [destroy .m1] [eval image delete [image names]] } {{} {} {}} --- 266,272 ---- image create test image2 menu .m1 .m1 add checkbutton -image image1 -selectimage image2 ! set tearoff [tk::TearOffMenu .m1 40 40] update idletasks list [image delete image2] [destroy .m1] [eval image delete [image names]] } {{} {} {}} *************** *** 282,295 **** test menuDraw-12.2 {Display menu - no entries} { catch {destroy .m1} menu .m1 ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test menuDraw-12.3 {DisplayMenu - one entry} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test menuDraw-12.4 {DisplayMenu - two entries} { --- 282,295 ---- test menuDraw-12.2 {Display menu - no entries} { catch {destroy .m1} menu .m1 ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test menuDraw-12.3 {DisplayMenu - one entry} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test menuDraw-12.4 {DisplayMenu - two entries} { *************** *** 297,303 **** menu .m1 .m1 add command -label "one" .m1 add command -label "two" ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test menuDraw.12.5 {DisplayMenu - two columns - first bigger} { --- 297,303 ---- menu .m1 .m1 add command -label "one" .m1 add command -label "two" ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test menuDraw.12.5 {DisplayMenu - two columns - first bigger} { *************** *** 306,312 **** .m1 add command -label "one" .m1 add command -label "two" .m1 add command -label "three" -columnbreak 1 ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test menuDraw-12.5 {DisplayMenu - two column - second bigger} { --- 306,312 ---- .m1 add command -label "one" .m1 add command -label "two" .m1 add command -label "three" -columnbreak 1 ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test menuDraw-12.5 {DisplayMenu - two column - second bigger} { *************** *** 315,321 **** .m1 add command -label "one" .m1 add command -label "two" -columnbreak 1 .m1 add command -label "three" ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test menuDraw.12.7 {DisplayMenu - three columns} { --- 315,321 ---- .m1 add command -label "one" .m1 add command -label "two" -columnbreak 1 .m1 add command -label "three" ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test menuDraw.12.7 {DisplayMenu - three columns} { *************** *** 327,333 **** .m1 add command -label "four" .m1 add command -label "five" .m1 add command -label "six" ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test menuDraw-12.6 {Display menu - testing for extra space and menubars} {unixOnly} { --- 327,333 ---- .m1 add command -label "four" .m1 add command -label "five" .m1 add command -label "six" ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test menuDraw-12.6 {Display menu - testing for extra space and menubars} {unixOnly} { *************** *** 341,347 **** catch {destroy .m1} menu .m1 .m1 add cascade -label foo ! set tearoff [tkTearOffMenu .m1 40 40] wm geometry $tearoff 200x100 list [update] [destroy .m1] } {{} {}} --- 341,347 ---- catch {destroy .m1} menu .m1 .m1 add cascade -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] wm geometry $tearoff 200x100 list [update] [destroy .m1] } {{} {}} *************** *** 353,367 **** .m1 add command -label "one" menu .m2 .m2 add command -label "two" ! set tearoff1 [tkTearOffMenu .m1 40 40] ! set tearoff2 [tkTearOffMenu .m2 40 40] list [raise $tearoff2] [update] [destroy .m1] [destroy .m2] } {{} {} {} {}} test menuDraw-13.2 {TkMenuEventProc - ConfigureNotify} { catch {destroy .m1} menu .m1 .m1 add command -label "foo" ! set tearoff [tkTearOffMenu .m1 40 40] list [wm geometry $tearoff 200x100] [update] [destroy .m1] } {{} {} {}} test menuDraw-13.3 {TkMenuEventProc - ActivateNotify} {macOnly} { --- 353,367 ---- .m1 add command -label "one" menu .m2 .m2 add command -label "two" ! set tearoff1 [tk::TearOffMenu .m1 40 40] ! set tearoff2 [tk::TearOffMenu .m2 40 40] list [raise $tearoff2] [update] [destroy .m1] [destroy .m2] } {{} {} {} {}} test menuDraw-13.2 {TkMenuEventProc - ConfigureNotify} { catch {destroy .m1} menu .m1 .m1 add command -label "foo" ! set tearoff [tk::TearOffMenu .m1 40 40] list [wm geometry $tearoff 200x100] [update] [destroy .m1] } {{} {} {}} test menuDraw-13.3 {TkMenuEventProc - ActivateNotify} {macOnly} { *************** *** 369,375 **** toplevel .t2 -menu .t2.m1 menu .t2.m1 .t2.m1 add command -label foo ! tkTearOffMenu .t2.m1 40 40 list [catch {update} msg] $msg [destroy .t2] } {0 {} {}} # Testing deletes is hard, and I am going to do my best. Don't know how --- 369,375 ---- toplevel .t2 -menu .t2.m1 menu .t2.m1 .t2.m1 add command -label foo ! tk::TearOffMenu .t2.m1 40 40 list [catch {update} msg] $msg [destroy .t2] } {0 {} {}} # Testing deletes is hard, and I am going to do my best. Don't know how *************** *** 410,422 **** catch {destroy .m1} menu .m1 .m1 add command -label "foo" ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test menuDraw-15.2 {TkPostTearoffMenu - Deactivation} { catch {destroy .m1} menu .m1 .m1 add command -label "foo" -state active ! set tearoff [tkTearOffMenu .m1 40 40] list [$tearoff index active] [destroy .m1] } {none {}} test menuDraw-15.3 {TkPostTearoffMenu - post command} { --- 410,422 ---- catch {destroy .m1} menu .m1 .m1 add command -label "foo" ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test menuDraw-15.2 {TkPostTearoffMenu - Deactivation} { catch {destroy .m1} menu .m1 .m1 add command -label "foo" -state active ! set tearoff [tk::TearOffMenu .m1 40 40] list [$tearoff index active] [destroy .m1] } {none {}} test menuDraw-15.3 {TkPostTearoffMenu - post command} { *************** *** 424,450 **** catch {unset foo} menu .m1 -postcommand "set foo .m1" .m1 add command -label "foo" ! list [catch {tkTearOffMenu .m1 40 40}] [set foo] [unset foo] [destroy .m1] } {0 .m1 {} {}} test menuDraw-15.4 {TkPostTearoffMenu - post command deleting the menu} { catch {destroy .m1} menu .m1 -postcommand "destroy .m1" .m1 add command -label "foo" ! list [catch {tkTearOffMenu .m1 40 40} msg] $msg [winfo exists .m1] } {0 {} 0} test menuDraw-15.5 {TkPostTearoffMenu - tearoff at edge of screen} { catch {destroy .m1} menu .m1 .m1 add command -label "foo" set height [winfo screenheight .m1] ! list [catch {tkTearOffMenu .m1 40 $height}] [destroy .m1] } {0 {}} test menuDraw-15.6 {TkPostTearoffMenu - tearoff off right} { catch {destroy .m1} menu .m1 .m1 add command -label "foo" set width [winfo screenwidth .m1] ! list [catch {tkTearOffMenu .m1 $width 40}] [destroy .m1] } {0 {}} --- 424,450 ---- catch {unset foo} menu .m1 -postcommand "set foo .m1" .m1 add command -label "foo" ! list [catch {tk::TearOffMenu .m1 40 40}] [set foo] [unset foo] [destroy .m1] } {0 .m1 {} {}} test menuDraw-15.4 {TkPostTearoffMenu - post command deleting the menu} { catch {destroy .m1} menu .m1 -postcommand "destroy .m1" .m1 add command -label "foo" ! list [catch {tk::TearOffMenu .m1 40 40} msg] $msg [winfo exists .m1] } {0 {} 0} test menuDraw-15.5 {TkPostTearoffMenu - tearoff at edge of screen} { catch {destroy .m1} menu .m1 .m1 add command -label "foo" set height [winfo screenheight .m1] ! list [catch {tk::TearOffMenu .m1 40 $height}] [destroy .m1] } {0 {}} test menuDraw-15.6 {TkPostTearoffMenu - tearoff off right} { catch {destroy .m1} menu .m1 .m1 add command -label "foo" set width [winfo screenwidth .m1] ! list [catch {tk::TearOffMenu .m1 $width 40}] [destroy .m1] } {0 {}} *************** *** 455,461 **** .m1 add cascade -label test -menu .m2 menu .m2 .m2 add command -label "Hit ESCAPE to make this menu go away." ! set tearoff [tkTearOffMenu .m1 40 40] $tearoff postcascade 0 list [$tearoff postcascade 0] [destroy .m1] [destroy .m2] } {{} {} {}} --- 455,461 ---- .m1 add cascade -label test -menu .m2 menu .m2 .m2 add command -label "Hit ESCAPE to make this menu go away." ! set tearoff [tk::TearOffMenu .m1 40 40] $tearoff postcascade 0 list [$tearoff postcascade 0] [destroy .m1] [destroy .m2] } {{} {} {}} *************** *** 470,476 **** .m2 add command -label "two" menu .m3 .m3 add command -label "three" ! set tearoff [tkTearOffMenu .m1 40 40] $tearoff postcascade 0 list [$tearoff postcascade 1] [destroy .m1] [destroy .m2] [destroy .m3] } {{} {} {} {}} --- 470,476 ---- .m2 add command -label "two" menu .m3 .m3 add command -label "three" ! set tearoff [tk::TearOffMenu .m1 40 40] $tearoff postcascade 0 list [$tearoff postcascade 1] [destroy .m1] [destroy .m2] [destroy .m3] } {{} {} {} {}} *************** *** 484,490 **** catch {destroy .m1} menu .m1 .m1 add cascade -label test ! set tearoff [tkTearOffMenu .m1 40 40] list [$tearoff postcascade 0] [destroy .m1] } {{} {}} test menuDraw-16.5 {TkPostSubMenu} {unixOnly} { --- 484,490 ---- catch {destroy .m1} menu .m1 .m1 add cascade -label test ! set tearoff [tk::TearOffMenu .m1 40 40] list [$tearoff postcascade 0] [destroy .m1] } {{} {}} test menuDraw-16.5 {TkPostSubMenu} {unixOnly} { *************** *** 493,499 **** menu .m1 .m1 add cascade -label test -menu .m2 menu .m2 -postcommand "glorp" ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {$tearoff postcascade test} msg] $msg [destroy .m1] [destroy .m2] } {1 {invalid command name "glorp"} {} {}} test menuDraw-16.6 {TkPostSubMenu} {pcOnly userInteraction} { --- 493,499 ---- menu .m1 .m1 add cascade -label test -menu .m2 menu .m2 -postcommand "glorp" ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {$tearoff postcascade test} msg] $msg [destroy .m1] [destroy .m2] } {1 {invalid command name "glorp"} {} {}} test menuDraw-16.6 {TkPostSubMenu} {pcOnly userInteraction} { *************** *** 503,509 **** .m1 add cascade -label test -menu .m2 menu .m2 .m2 add command -label "Hit ESCAPE to get rid of this menu" ! set tearoff [tkTearOffMenu .m1 40 40] list [$tearoff postcascade 0] [destroy .m1] [destroy .m2] } {{} {} {}} --- 503,509 ---- .m1 add cascade -label test -menu .m2 menu .m2 .m2 add command -label "Hit ESCAPE to get rid of this menu" ! set tearoff [tk::TearOffMenu .m1 40 40] list [$tearoff postcascade 0] [destroy .m1] [destroy .m2] } {{} {} {}} *************** *** 529,535 **** .m1 add cascade -label test -menu .m2 menu .m2 .m2 add command -label "Hit ESCAPE to make this menu go away" ! set tearoff [tkTearOffMenu .m1 40 40] list [$tearoff postcascade 0] [destroy .m1] [destroy .m2] } {{} {} {}} --- 529,535 ---- .m1 add cascade -label test -menu .m2 menu .m2 .m2 add command -label "Hit ESCAPE to make this menu go away" ! set tearoff [tk::TearOffMenu .m1 40 40] list [$tearoff postcascade 0] [destroy .m1] [destroy .m2] } {{} {} {}} Index: tests/msgbox.test =================================================================== RCS file: /cvsroot/tk/tests/msgbox.test,v retrieving revision 1.4 diff -c -r1.4 msgbox.test *** msgbox.test 2000/04/18 02:18:34 1.4 --- msgbox.test 2000/07/17 06:29:21 *************** *** 72,78 **** list [catch {tk_messageBox -parent foo.bar} msg] $msg } {1 {bad window path name "foo.bar"}} ! if {[info commands tkMessageBox] == ""} { set isNative 1 } else { set isNative 0 --- 72,78 ---- list [catch {tk_messageBox -parent foo.bar} msg] $msg } {1 {bad window path name "foo.bar"}} ! if {[info commands tk::MessageBox] == ""} { set isNative 1 } else { set isNative 0 Index: tests/text.test =================================================================== RCS file: /cvsroot/tk/tests/text.test,v retrieving revision 1.10 diff -c -r1.10 text.test *** text.test 2000/02/03 17:29:58 1.10 --- text.test 2000/07/17 06:29:30 *************** *** 964,970 **** test text-20.36 {TextSearchCmd procedure, regexp finds empty lines} { # Test for fix of bug #1643 .t insert end "\n" ! tkTextSetCursor .t 4.0 .t search -forward -regexp {^$} insert end } {4.0} --- 964,970 ---- test text-20.36 {TextSearchCmd procedure, regexp finds empty lines} { # Test for fix of bug #1643 .t insert end "\n" ! tk::TextSetCursor .t 4.0 .t search -forward -regexp {^$} insert end } {4.0} *************** *** 1309,1315 **** .t insert end "line 3\n" .t insert end "line 4\n" .t insert end "line 5\n" ! tkTextSetCursor .t 3.0 .t search -backward -regexp "\$" insert 1.0 } {2.6} --- 1309,1315 ---- .t insert end "line 3\n" .t insert end "line 4\n" .t insert end "line 5\n" ! tk::TextSetCursor .t 3.0 .t search -backward -regexp "\$" insert 1.0 } {2.6} Index: tests/textDisp.test =================================================================== RCS file: /cvsroot/tk/tests/textDisp.test,v retrieving revision 1.4 diff -c -r1.4 textDisp.test *** textDisp.test 1999/12/14 06:53:14 1.4 --- textDisp.test 2000/07/17 06:29:47 *************** *** 432,438 **** .t delete 2.0 2.end .t insert 2.0 "New Line 2" update ! list [.t bbox 1.0] [.t bbox 2.0] [.t bbox 3.0] $tk_textRelayout } {{5 5 7 13} {5 18 7 13} {5 31 7 13} 2.0} test textDisp-4.2 {UpdateDisplayInfo, re-use tail of text line} {fonts} { .t delete 1.0 end --- 432,438 ---- .t delete 2.0 2.end .t insert 2.0 "New Line 2" update ! list [.t bbox 1.0] [.t bbox 2.0] [.t bbox 3.0] $tk::textRelayout } {{5 5 7 13} {5 18 7 13} {5 31 7 13} 2.0} test textDisp-4.2 {UpdateDisplayInfo, re-use tail of text line} {fonts} { .t delete 1.0 end *************** *** 442,448 **** .t delete 2.2 .t insert 2.0 X update ! list [.t bbox 2.0] [.t bbox x] [.t bbox 3.0] $tk_textRelayout } {{5 18 7 13} {12 31 7 13} {5 44 7 13} {2.0 2.20}} test textDisp-4.3 {UpdateDisplayInfo, tail of text line shifts} {fonts} { .t delete 1.0 end --- 442,448 ---- .t delete 2.2 .t insert 2.0 X update ! list [.t bbox 2.0] [.t bbox x] [.t bbox 3.0] $tk::textRelayout } {{5 18 7 13} {12 31 7 13} {5 44 7 13} {2.0 2.20}} test textDisp-4.3 {UpdateDisplayInfo, tail of text line shifts} {fonts} { .t delete 1.0 end *************** *** 451,457 **** .t mark set x 2.21 .t delete 2.2 update ! list [.t bbox 2.0] [.t bbox x] [.t bbox 3.0] $tk_textRelayout } {{5 18 7 13} {5 31 7 13} {5 44 7 13} {2.0 2.20}} .t mark unset x test textDisp-4.4 {UpdateDisplayInfo, wrap-mode "none"} {fonts} { --- 451,457 ---- .t mark set x 2.21 .t delete 2.2 update ! list [.t bbox 2.0] [.t bbox x] [.t bbox 3.0] $tk::textRelayout } {{5 18 7 13} {5 31 7 13} {5 44 7 13} {2.0 2.20}} .t mark unset x test textDisp-4.4 {UpdateDisplayInfo, wrap-mode "none"} {fonts} { *************** *** 459,465 **** .t delete 1.0 end .t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3" update ! list [.t bbox 2.0] [.t bbox 2.25] [.t bbox 3.0] $tk_textRelayout } {{5 18 7 13} {} {5 31 7 13} {1.0 2.0 3.0}} test textDisp-4.5 {UpdateDisplayInfo, tiny window} {fonts} { wm geom . 103x$height --- 459,465 ---- .t delete 1.0 end .t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3" update ! list [.t bbox 2.0] [.t bbox 2.25] [.t bbox 3.0] $tk::textRelayout } {{5 18 7 13} {} {5 31 7 13} {1.0 2.0 3.0}} test textDisp-4.5 {UpdateDisplayInfo, tiny window} {fonts} { wm geom . 103x$height *************** *** 468,474 **** .t delete 1.0 end .t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3" update ! list [.t bbox 2.0] [.t bbox 2.1] [.t bbox 3.0] $tk_textRelayout } {{5 18 1 13} {} {5 31 1 13} {1.0 2.0 3.0}} test textDisp-4.6 {UpdateDisplayInfo, tiny window} { # This test was failing on Windows because the title bar on . --- 468,474 ---- .t delete 1.0 end .t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3" update ! list [.t bbox 2.0] [.t bbox 2.1] [.t bbox 3.0] $tk::textRelayout } {{5 18 1 13} {} {5 31 1 13} {1.0 2.0 3.0}} test textDisp-4.6 {UpdateDisplayInfo, tiny window} { # This test was failing on Windows because the title bar on . *************** *** 489,495 **** .t delete 1.0 end .t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3" update ! set x [list [.t bbox 1.0] [.t bbox 2.0] $tk_textRelayout] wm overrideredirect . 0 update set x --- 489,495 ---- .t delete 1.0 end .t insert end "Line 1\nLine 2 is so long that it wraps around\nLine 3" update ! set x [list [.t bbox 1.0] [.t bbox 2.0] $tk::textRelayout] wm overrideredirect . 0 update set x *************** *** 515,521 **** update .t yview 16.0 update ! set x [list [.t index @0,0] $tk_textRelayout $tk_textRedraw] wm overrideredirect . 0 update set x --- 515,521 ---- update .t yview 16.0 update ! set x [list [.t index @0,0] $tk::textRelayout $tk::textRedraw] wm overrideredirect . 0 update set x *************** *** 527,533 **** update .t delete 5.0 14.0 update ! set x [list [.t index @0,0] $tk_textRelayout $tk_textRedraw] } {1.0 {5.0 4.0 3.0 2.0 1.0} {1.0 2.0 3.0 4.0 5.0 eof}} test textDisp-4.9 {UpdateDisplayInfo, filling in extra vertical space} {fonts} { .t delete 1.0 end --- 527,533 ---- update .t delete 5.0 14.0 update ! set x [list [.t index @0,0] $tk::textRelayout $tk::textRedraw] } {1.0 {5.0 4.0 3.0 2.0 1.0} {1.0 2.0 3.0 4.0 5.0 eof}} test textDisp-4.9 {UpdateDisplayInfo, filling in extra vertical space} {fonts} { .t delete 1.0 end *************** *** 544,550 **** update .t delete 13.0 end update ! list [.t index @0,0] $tk_textRelayout $tk_textRedraw } {5.0 {12.0 7.0 6.40 6.20 6.0 5.0} {5.0 6.0 6.20 6.40 7.0 12.0}} test textDisp-4.11 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end --- 544,550 ---- update .t delete 13.0 end update ! list [.t index @0,0] $tk::textRelayout $tk::textRedraw } {5.0 {12.0 7.0 6.40 6.20 6.0 5.0} {5.0 6.0 6.20 6.40 7.0 12.0}} test textDisp-4.11 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end *************** *** 553,559 **** update .t delete 14.0 end update ! list [.t index @0,0] $tk_textRelayout $tk_textRedraw } {6.40 {13.0 7.0 6.80 6.60 6.40} {6.40 6.60 6.80 7.0 13.0}} test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end --- 553,559 ---- update .t delete 14.0 end update ! list [.t index @0,0] $tk::textRelayout $tk::textRedraw } {6.40 {13.0 7.0 6.80 6.60 6.40} {6.40 6.60 6.80 7.0 13.0}} test textDisp-4.12 {UpdateDisplayInfo, filling in extra vertical space} { .t delete 1.0 end *************** *** 581,587 **** update .t yview scroll 3 units update ! list $tk_textRelayout $tk_textRedraw } {{11.0 12.0 13.0} {4.0 10.0 11.0 12.0 13.0}} test textDisp-4.14 {UpdateDisplayInfo, special handling for top/bottom lines} { .t tag remove x 1.0 end --- 581,587 ---- update .t yview scroll 3 units update ! list $tk::textRelayout $tk::textRedraw } {{11.0 12.0 13.0} {4.0 10.0 11.0 12.0 13.0}} test textDisp-4.14 {UpdateDisplayInfo, special handling for top/bottom lines} { .t tag remove x 1.0 end *************** *** 589,595 **** update .t yview scroll 3 units update ! list $tk_textRelayout $tk_textRedraw } {{11.0 12.0 13.0} {11.0 12.0 13.0}} test textDisp-4.15 {UpdateDisplayInfo, special handling for top/bottom lines} { .t tag add x 1.0 end --- 589,595 ---- update .t yview scroll 3 units update ! list $tk::textRelayout $tk::textRedraw } {{11.0 12.0 13.0} {11.0 12.0 13.0}} test textDisp-4.15 {UpdateDisplayInfo, special handling for top/bottom lines} { .t tag add x 1.0 end *************** *** 597,603 **** update .t yview scroll -2 units update ! list $tk_textRelayout $tk_textRedraw } {{2.0 3.0} {2.0 3.0 4.0 11.0}} test textDisp-4.16 {UpdateDisplayInfo, special handling for top/bottom lines} { .t tag remove x 1.0 end --- 597,603 ---- update .t yview scroll -2 units update ! list $tk::textRelayout $tk::textRedraw } {{2.0 3.0} {2.0 3.0 4.0 11.0}} test textDisp-4.16 {UpdateDisplayInfo, special handling for top/bottom lines} { .t tag remove x 1.0 end *************** *** 605,611 **** update .t yview scroll -2 units update ! list $tk_textRelayout $tk_textRedraw } {{2.0 3.0} {2.0 3.0}} test textDisp-4.17 {UpdateDisplayInfo, horizontal scrolling} {fonts} { .t configure -wrap none --- 605,611 ---- update .t yview scroll -2 units update ! list $tk::textRelayout $tk::textRedraw } {{2.0 3.0} {2.0 3.0}} test textDisp-4.17 {UpdateDisplayInfo, horizontal scrolling} {fonts} { .t configure -wrap none *************** *** 615,621 **** update .t xview scroll 3 units update ! list $tk_textRelayout $tk_textRedraw [.t bbox 2.0] [.t bbox 2.5] \ [.t bbox 2.23] } {{} {1.0 2.0 3.0 4.0} {} {17 16 7 13} {}} test textDisp-4.18 {UpdateDisplayInfo, horizontal scrolling} {fonts} { --- 615,621 ---- update .t xview scroll 3 units update ! list $tk::textRelayout $tk::textRedraw [.t bbox 2.0] [.t bbox 2.5] \ [.t bbox 2.23] } {{} {1.0 2.0 3.0 4.0} {} {17 16 7 13} {}} test textDisp-4.18 {UpdateDisplayInfo, horizontal scrolling} {fonts} { *************** *** 626,632 **** update .t xview scroll 100 units update ! list $tk_textRelayout $tk_textRedraw [.t bbox 2.25] } {{} {1.0 2.0 3.0 4.0} {10 16 7 13}} test textDisp-4.19 {UpdateDisplayInfo, horizontal scrolling} {fonts} { .t configure -wrap none --- 626,632 ---- update .t xview scroll 100 units update ! list $tk::textRelayout $tk::textRedraw [.t bbox 2.25] } {{} {1.0 2.0 3.0 4.0} {10 16 7 13}} test textDisp-4.19 {UpdateDisplayInfo, horizontal scrolling} {fonts} { .t configure -wrap none *************** *** 637,643 **** .t xview moveto 0 .t xview scroll -10 units update ! list $tk_textRelayout $tk_textRedraw [.t bbox 2.5] } {{} {1.0 2.0 3.0 4.0} {38 16 7 13}} test textDisp-4.20 {UpdateDisplayInfo, horizontal scrolling} {fonts} { .t configure -wrap none --- 637,643 ---- .t xview moveto 0 .t xview scroll -10 units update ! list $tk::textRelayout $tk::textRedraw [.t bbox 2.5] } {{} {1.0 2.0 3.0 4.0} {38 16 7 13}} test textDisp-4.20 {UpdateDisplayInfo, horizontal scrolling} {fonts} { .t configure -wrap none *************** *** 649,655 **** update .t delete 2.30 2.44 update ! list $tk_textRelayout $tk_textRedraw [.t bbox 2.25] } {2.0 {1.0 2.0 3.0 4.0} {108 16 7 13}} test textDisp-4.21 {UpdateDisplayInfo, horizontal scrolling} {fonts} { .t configure -wrap none --- 649,655 ---- update .t delete 2.30 2.44 update ! list $tk::textRelayout $tk::textRedraw [.t bbox 2.25] } {2.0 {1.0 2.0 3.0 4.0} {108 16 7 13}} test textDisp-4.21 {UpdateDisplayInfo, horizontal scrolling} {fonts} { .t configure -wrap none *************** *** 660,666 **** update .t xview moveto .6 update ! list $tk_textRelayout $tk_textRedraw } {{} {}} test textDisp-4.22 {UpdateDisplayInfo, no horizontal scrolling except for -wrap none} {fonts} { .t configure -wrap none --- 660,666 ---- update .t xview moveto .6 update ! list $tk::textRelayout $tk::textRedraw } {{} {}} test textDisp-4.22 {UpdateDisplayInfo, no horizontal scrolling except for -wrap none} {fonts} { .t configure -wrap none *************** *** 726,732 **** update .t delete 2.0 3.0 update ! list $tk_textRelayout $tk_textRedraw } {{2.0 10.0} {2.0 10.0}} test textDisp-6.2 {scrolling in DisplayText, scroll down} { .t delete 1.0 end --- 726,732 ---- update .t delete 2.0 3.0 update ! list $tk::textRelayout $tk::textRedraw } {{2.0 10.0} {2.0 10.0}} test textDisp-6.2 {scrolling in DisplayText, scroll down} { .t delete 1.0 end *************** *** 737,743 **** update .t insert 2.0 "New Line 2\n" update ! list $tk_textRelayout $tk_textRedraw } {{2.0 3.0} {2.0 3.0}} test textDisp-6.3 {scrolling in DisplayText, multiple scrolls} { .t configure -wrap char --- 737,743 ---- update .t insert 2.0 "New Line 2\n" update ! list $tk::textRelayout $tk::textRedraw } {{2.0 3.0} {2.0 3.0}} test textDisp-6.3 {scrolling in DisplayText, multiple scrolls} { .t configure -wrap char *************** *** 750,756 **** .t insert 2.end "is so long that it wraps" .t insert 4.end "is so long that it wraps" update ! list $tk_textRelayout $tk_textRedraw } {{2.0 2.20 4.0 4.20} {2.0 2.20 4.0 4.20}} test textDisp-6.4 {scrolling in DisplayText, scrolls interfere} { .t configure -wrap char --- 750,756 ---- .t insert 2.end "is so long that it wraps" .t insert 4.end "is so long that it wraps" update ! list $tk::textRelayout $tk::textRedraw } {{2.0 2.20 4.0 4.20} {2.0 2.20 4.0 4.20}} test textDisp-6.4 {scrolling in DisplayText, scrolls interfere} { .t configure -wrap char *************** *** 763,769 **** .t insert 2.end "is so long that it wraps around, not once but three times" .t insert 4.end "is so long that it wraps" update ! list $tk_textRelayout $tk_textRedraw } {{2.0 2.20 2.40 2.60 4.0 4.20} {2.0 2.20 2.40 2.60 4.0 4.20 6.0}} test textDisp-6.5 {scrolling in DisplayText, scroll source obscured} {nonPortable} { .t configure -wrap char --- 763,769 ---- .t insert 2.end "is so long that it wraps around, not once but three times" .t insert 4.end "is so long that it wraps" update ! list $tk::textRelayout $tk::textRedraw } {{2.0 2.20 2.40 2.60 4.0 4.20} {2.0 2.20 2.40 2.60 4.0 4.20 6.0}} test textDisp-6.5 {scrolling in DisplayText, scroll source obscured} {nonPortable} { .t configure -wrap char *************** *** 778,784 **** .t delete 1.6 1.end update destroy .f2 ! list $tk_textRelayout $tk_textRedraw } {{1.0 9.0 10.0} {1.0 4.0 5.0 9.0 10.0}} test textDisp-6.6 {scrolling in DisplayText, Expose events after scroll} {unixOnly nonPortable} { # this test depends on all of the expose events being handled at once --- 778,784 ---- .t delete 1.6 1.end update destroy .f2 ! list $tk::textRelayout $tk::textRedraw } {{1.0 9.0 10.0} {1.0 4.0 5.0 9.0 10.0}} test textDisp-6.6 {scrolling in DisplayText, Expose events after scroll} {unixOnly nonPortable} { # this test depends on all of the expose events being handled at once *************** *** 795,801 **** .t delete 1.6 1.end destroy .f2 update ! list $tk_textRelayout $tk_textRedraw } {{1.0 9.0 10.0} {borders 1.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0}} .t configure -bd 0 test textDisp-6.7 {DisplayText, vertical scrollbar updates} { --- 795,801 ---- .t delete 1.6 1.end destroy .f2 update ! list $tk::textRelayout $tk::textRedraw } {{1.0 9.0 10.0} {borders 1.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0}} .t configure -bd 0 test textDisp-6.7 {DisplayText, vertical scrollbar updates} { *************** *** 845,851 **** update destroy .f2 update ! list $tk_textRelayout $tk_textRedraw } {{} {1.40 2.0 3.0 4.0 5.0 6.0}} test textDisp-7.2 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 --- 845,851 ---- update destroy .f2 update ! list $tk::textRelayout $tk::textRedraw } {{} {1.40 2.0 3.0 4.0 5.0 6.0}} test textDisp-7.2 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 *************** *** 853,859 **** update destroy .f2 update ! list $tk_textRelayout $tk_textRedraw } {{} {borders 1.0 1.20 1.40 2.0 3.0}} test textDisp-7.3 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 --- 853,859 ---- update destroy .f2 update ! list $tk::textRelayout $tk::textRedraw } {{} {borders 1.0 1.20 1.40 2.0 3.0}} test textDisp-7.3 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 *************** *** 861,867 **** update destroy .f2 update ! list $tk_textRelayout $tk_textRedraw } {{} {borders 4.0 5.0 6.0 7.0 8.0}} test textDisp-7.4 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 --- 861,867 ---- update destroy .f2 update ! list $tk::textRelayout $tk::textRedraw } {{} {borders 4.0 5.0 6.0 7.0 8.0}} test textDisp-7.4 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 *************** *** 870,876 **** update destroy .f2 update ! list $tk_textRelayout $tk_textRedraw } {{} {borders 1.0 1.20}} test textDisp-7.5 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 --- 870,876 ---- update destroy .f2 update ! list $tk::textRelayout $tk::textRedraw } {{} {borders 1.0 1.20}} test textDisp-7.5 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 *************** *** 879,885 **** update destroy .f2 update ! list $tk_textRelayout $tk_textRedraw } {{} {borders 7.0 8.0}} test textDisp-7.6 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 --- 879,885 ---- update destroy .f2 update ! list $tk::textRelayout $tk::textRedraw } {{} {borders 7.0 8.0}} test textDisp-7.6 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 *************** *** 888,894 **** update destroy .f2 update ! list $tk_textRelayout $tk_textRedraw } {{} {borders 3.0 4.0 5.0}} test textDisp-7.7 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 --- 888,894 ---- update destroy .f2 update ! list $tk::textRelayout $tk::textRedraw } {{} {borders 3.0 4.0 5.0}} test textDisp-7.7 {TkTextRedrawRegion} {nonPortable} { frame .f2 -bg #ff0000 *************** *** 897,903 **** update destroy .f2 update ! list $tk_textRelayout $tk_textRedraw } {{} {borders 3.0 4.0 5.0}} test textDisp-7.8 {TkTextRedrawRegion} {nonPortable} { .t delete 1.0 end --- 897,903 ---- update destroy .f2 update ! list $tk::textRelayout $tk::textRedraw } {{} {borders 3.0 4.0 5.0}} test textDisp-7.8 {TkTextRedrawRegion} {nonPortable} { .t delete 1.0 end *************** *** 908,914 **** update destroy .f2 update ! list $tk_textRelayout $tk_textRedraw } {{} {borders 4.0 5.0 6.0 7.0 eof}} .t configure -bd 0 --- 908,914 ---- update destroy .f2 update ! list $tk::textRelayout $tk::textRedraw } {{} {borders 4.0 5.0 6.0 7.0 eof}} .t configure -bd 0 *************** *** 922,928 **** update .t delete 2.36 2.38 update ! list $tk_textRelayout $tk_textRedraw [.t bbox 2.32] } {{2.0 2.18 2.38} {2.0 2.18 2.38} {101 29 7 13}} .t configure -wrap char test textDisp-8.2 {TkTextChanged, redisplay whole lines} { --- 922,928 ---- update .t delete 2.36 2.38 update ! list $tk::textRelayout $tk::textRedraw [.t bbox 2.32] } {{2.0 2.18 2.38} {2.0 2.18 2.38} {101 29 7 13}} .t configure -wrap char test textDisp-8.2 {TkTextChanged, redisplay whole lines} { *************** *** 934,940 **** update .t insert 1.2 xx update ! list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.3 {TkTextChanged} { .t delete 1.0 end --- 934,940 ---- update .t insert 1.2 xx update ! list $tk::textRelayout $tk::textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.3 {TkTextChanged} { .t delete 1.0 end *************** *** 945,951 **** update .t insert 2.0 xx update ! list $tk_textRelayout $tk_textRedraw } {2.0 2.0} test textDisp-8.4 {TkTextChanged} { .t delete 1.0 end --- 945,951 ---- update .t insert 2.0 xx update ! list $tk::textRelayout $tk::textRedraw } {2.0 2.0} test textDisp-8.4 {TkTextChanged} { .t delete 1.0 end *************** *** 956,962 **** update .t delete 1.5 update ! list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.5 {TkTextChanged} { .t delete 1.0 end --- 956,962 ---- update .t delete 1.5 update ! list $tk::textRelayout $tk::textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.5 {TkTextChanged} { .t delete 1.0 end *************** *** 967,973 **** update .t delete 1.40 1.44 update ! list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.6 {TkTextChanged} { .t delete 1.0 end --- 967,973 ---- update .t delete 1.40 1.44 update ! list $tk::textRelayout $tk::textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.6 {TkTextChanged} { .t delete 1.0 end *************** *** 978,984 **** update .t delete 1.41 1.44 update ! list $tk_textRelayout $tk_textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.7 {TkTextChanged} { .t delete 1.0 end --- 978,984 ---- update .t delete 1.41 1.44 update ! list $tk::textRelayout $tk::textRedraw } {{1.0 1.20 1.40} {1.0 1.20 1.40}} test textDisp-8.7 {TkTextChanged} { .t delete 1.0 end *************** *** 989,995 **** update .t delete 1.2 1.end update ! list $tk_textRelayout $tk_textRedraw } {{1.0 9.0 10.0} {1.0 9.0 10.0}} test textDisp-8.8 {TkTextChanged} { .t delete 1.0 end --- 989,995 ---- update .t delete 1.2 1.end update ! list $tk::textRelayout $tk::textRedraw } {{1.0 9.0 10.0} {1.0 9.0 10.0}} test textDisp-8.8 {TkTextChanged} { .t delete 1.0 end *************** *** 1000,1006 **** update .t delete 2.2 update ! list $tk_textRelayout $tk_textRedraw } {2.0 2.0} test textDisp-8.9 {TkTextChanged} { .t delete 1.0 end --- 1000,1006 ---- update .t delete 2.2 update ! list $tk::textRelayout $tk::textRedraw } {2.0 2.0} test textDisp-8.9 {TkTextChanged} { .t delete 1.0 end *************** *** 1011,1017 **** update .t delete 2.0 3.0 update ! list $tk_textRelayout $tk_textRedraw } {{2.0 8.0} {2.0 8.0}} test textDisp-8.10 {TkTextChanged} { .t configure -wrap char --- 1011,1017 ---- update .t delete 2.0 3.0 update ! list $tk::textRelayout $tk::textRedraw } {{2.0 8.0} {2.0 8.0}} test textDisp-8.10 {TkTextChanged} { .t configure -wrap char *************** *** 1021,1027 **** update .t delete 2.19 update ! set tk_textRedraw } {2.0 2.20 eof} test textDisp-8.11 {TkTextChanged, scrollbar notification when changes are off-screen} { .t delete 1.0 end --- 1021,1027 ---- update .t delete 2.19 update ! set tk::textRedraw } {2.0 2.20 eof} test textDisp-8.11 {TkTextChanged, scrollbar notification when changes are off-screen} { .t delete 1.0 end *************** *** 1042,1048 **** update .t tag add big 2.2 2.4 update ! list $tk_textRelayout $tk_textRedraw } {{2.0 2.18} {2.0 2.18}} test textDisp-9.2 {TkTextRedrawTag} {fonts} { .t configure -wrap char --- 1042,1048 ---- update .t tag add big 2.2 2.4 update ! list $tk::textRelayout $tk::textRedraw } {{2.0 2.18} {2.0 2.18}} test textDisp-9.2 {TkTextRedrawTag} {fonts} { .t configure -wrap char *************** *** 1051,1057 **** update .t tag add big 1.2 2.4 update ! list $tk_textRelayout $tk_textRedraw } {{1.0 2.0 2.17} {1.0 2.0 2.17}} test textDisp-9.3 {TkTextRedrawTag} { .t configure -wrap char --- 1051,1057 ---- update .t tag add big 1.2 2.4 update ! list $tk::textRelayout $tk::textRedraw } {{1.0 2.0 2.17} {1.0 2.0 2.17}} test textDisp-9.3 {TkTextRedrawTag} { .t configure -wrap char *************** *** 1061,1067 **** .t tag add big 2.2 2.4 .t tag remove big 1.0 end update ! list $tk_textRelayout $tk_textRedraw } {2.0 2.0} test textDisp-9.4 {TkTextRedrawTag} { .t configure -wrap char --- 1061,1067 ---- .t tag add big 2.2 2.4 .t tag remove big 1.0 end update ! list $tk::textRelayout $tk::textRedraw } {2.0 2.0} test textDisp-9.4 {TkTextRedrawTag} { .t configure -wrap char *************** *** 1071,1077 **** .t tag add big 2.2 2.20 .t tag remove big 1.0 end update ! list $tk_textRelayout $tk_textRedraw } {2.0 2.0} test textDisp-9.5 {TkTextRedrawTag} { .t configure -wrap char --- 1071,1077 ---- .t tag add big 2.2 2.20 .t tag remove big 1.0 end update ! list $tk::textRelayout $tk::textRedraw } {2.0 2.0} test textDisp-9.5 {TkTextRedrawTag} { .t configure -wrap char *************** *** 1081,1087 **** .t tag add big 2.2 2.end .t tag remove big 1.0 end update ! list $tk_textRelayout $tk_textRedraw } {{2.0 2.20} {2.0 2.20}} test textDisp-9.6 {TkTextRedrawTag} { .t configure -wrap char --- 1081,1087 ---- .t tag add big 2.2 2.end .t tag remove big 1.0 end update ! list $tk::textRelayout $tk::textRedraw } {{2.0 2.20} {2.0 2.20}} test textDisp-9.6 {TkTextRedrawTag} { .t configure -wrap char *************** *** 1091,1097 **** .t tag add big 2.2 3.5 .t tag remove big 1.0 end update ! list $tk_textRelayout $tk_textRedraw } {{2.0 2.20 3.0} {2.0 2.20 3.0}} test textDisp-9.7 {TkTextRedrawTag} { .t configure -wrap char --- 1091,1097 ---- .t tag add big 2.2 3.5 .t tag remove big 1.0 end update ! list $tk::textRelayout $tk::textRedraw } {{2.0 2.20 3.0} {2.0 2.20 3.0}} test textDisp-9.7 {TkTextRedrawTag} { .t configure -wrap char *************** *** 1101,1107 **** update .t tag remove big 2.19 update ! set tk_textRedraw } {2.0 2.20 eof} test textDisp-9.8 {TkTextRedrawTag} {fonts} { .t configure -wrap char --- 1101,1107 ---- update .t tag remove big 2.19 update ! set tk::textRedraw } {2.0 2.20 eof} test textDisp-9.8 {TkTextRedrawTag} {fonts} { .t configure -wrap char *************** *** 1111,1117 **** update .t tag add big 2.0 2.5 update ! set tk_textRedraw } {2.0 2.17} test textDisp-9.9 {TkTextRedrawTag} {fonts} { .t configure -wrap char --- 1111,1117 ---- update .t tag add big 2.0 2.5 update ! set tk::textRedraw } {2.0 2.17} test textDisp-9.9 {TkTextRedrawTag} {fonts} { .t configure -wrap char *************** *** 1121,1127 **** update .t tag add big 1.5 2.5 update ! set tk_textRedraw } {2.0 2.17} test textDisp-9.10 {TkTextRedrawTag} { .t configure -wrap char --- 1121,1127 ---- update .t tag add big 1.5 2.5 update ! set tk::textRedraw } {2.0 2.17} test textDisp-9.10 {TkTextRedrawTag} { .t configure -wrap char *************** *** 1129,1138 **** .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" .t tag add big 1.0 2.0 update ! set tk_textRedraw {none} .t tag add big 1.3 1.5 update ! set tk_textRedraw } {none} test textDisp-9.11 {TkTextRedrawTag} { .t configure -wrap char --- 1129,1138 ---- .t insert 1.0 "Line 1\nLine 2 is long enough to wrap\nLine 3 is also long enough to wrap\nLine 4" .t tag add big 1.0 2.0 update ! set tk::textRedraw {none} .t tag add big 1.3 1.5 update ! set tk::textRedraw } {none} test textDisp-9.11 {TkTextRedrawTag} { .t configure -wrap char *************** *** 1142,1148 **** update .t tag add big 1.0 2.0 update ! set tk_textRedraw } {} test textDisp-10.1 {TkTextRelayoutWindow} { --- 1142,1148 ---- update .t tag add big 1.0 2.0 update ! set tk::textRedraw } {} test textDisp-10.1 {TkTextRelayoutWindow} { *************** *** 1152,1158 **** update .t configure -bg black update ! list $tk_textRelayout $tk_textRedraw } {{1.0 2.0 2.20 3.0 3.20 4.0} {borders 1.0 2.0 2.20 3.0 3.20 4.0 eof}} .t configure -bg [lindex [.t configure -bg] 3] test textDisp-10.2 {TkTextRelayoutWindow} { --- 1152,1158 ---- update .t configure -bg black update ! list $tk::textRelayout $tk::textRedraw } {{1.0 2.0 2.20 3.0 3.20 4.0} {borders 1.0 2.0 2.20 3.0 3.20 4.0 eof}} .t configure -bg [lindex [.t configure -bg] 3] test textDisp-10.2 {TkTextRelayoutWindow} { *************** *** 1185,1270 **** update .t yview 32.0 update ! list [.t index @0,0] $tk_textRedraw } {32.0 {40.0 41.0}} test textDisp-11.3 {TkTextSetYView} { .t yview 30.0 update .t yview 28.0 update ! list [.t index @0,0] $tk_textRedraw } {28.0 {28.0 29.0}} test textDisp-11.4 {TkTextSetYView} { .t yview 30.0 update .t yview 31.4 update ! list [.t index @0,0] $tk_textRedraw } {31.0 40.0} test textDisp-11.5 {TkTextSetYView} { .t yview 30.0 update ! set tk_textRedraw {} .t yview -pickplace 31.0 update ! list [.t index @0,0] $tk_textRedraw } {30.0 {}} test textDisp-11.6 {TkTextSetYView} { .t yview 30.0 update ! set tk_textRedraw {} .t yview -pickplace 28.0 update ! list [.t index @0,0] $tk_textRedraw } {28.0 {28.0 29.0}} test textDisp-11.7 {TkTextSetYView} { .t yview 30.0 update ! set tk_textRedraw {} .t yview -pickplace 26.0 update ! list [.t index @0,0] $tk_textRedraw } {22.0 {22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0}} test textDisp-11.8 {TkTextSetYView} { .t yview 30.0 update ! set tk_textRedraw {} .t yview -pickplace 41.0 update ! list [.t index @0,0] $tk_textRedraw } {32.0 {40.0 41.0}} test textDisp-11.9 {TkTextSetYView} { .t yview 30.0 update ! set tk_textRedraw {} .t yview -pickplace 43.0 update ! list [.t index @0,0] $tk_textRedraw } {39.0 {40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0}} test textDisp-11.10 {TkTextSetYView} { .t yview 30.0 update ! set tk_textRedraw {} .t yview 10000.0 update ! list [.t index @0,0] $tk_textRedraw } {191.0 {191.0 192.0 193.0 194.0 195.0 196.0 197.0 198.0 199.0 200.0}} test textDisp-11.11 {TkTextSetYView} { .t yview 195.0 update ! set tk_textRedraw {} .t yview 197.0 update ! list [.t index @0,0] $tk_textRedraw } {191.0 {191.0 192.0 193.0 194.0 195.0 196.0}} test textDisp-11.12 {TkTextSetYView, wrapped line is off-screen} { .t insert 10.0 "Long line with enough text to wrap\n" .t yview 1.0 update ! set tk_textRedraw {} .t see 10.30 update ! list [.t index @0,0] $tk_textRedraw } {2.0 10.20} .t delete 10.0 11.0 test textDisp-11.13 {TkTestSetYView, partially-visible last line} { --- 1185,1270 ---- update .t yview 32.0 update ! list [.t index @0,0] $tk::textRedraw } {32.0 {40.0 41.0}} test textDisp-11.3 {TkTextSetYView} { .t yview 30.0 update .t yview 28.0 update ! list [.t index @0,0] $tk::textRedraw } {28.0 {28.0 29.0}} test textDisp-11.4 {TkTextSetYView} { .t yview 30.0 update .t yview 31.4 update ! list [.t index @0,0] $tk::textRedraw } {31.0 40.0} test textDisp-11.5 {TkTextSetYView} { .t yview 30.0 update ! set tk::textRedraw {} .t yview -pickplace 31.0 update ! list [.t index @0,0] $tk::textRedraw } {30.0 {}} test textDisp-11.6 {TkTextSetYView} { .t yview 30.0 update ! set tk::textRedraw {} .t yview -pickplace 28.0 update ! list [.t index @0,0] $tk::textRedraw } {28.0 {28.0 29.0}} test textDisp-11.7 {TkTextSetYView} { .t yview 30.0 update ! set tk::textRedraw {} .t yview -pickplace 26.0 update ! list [.t index @0,0] $tk::textRedraw } {22.0 {22.0 23.0 24.0 25.0 26.0 27.0 28.0 29.0}} test textDisp-11.8 {TkTextSetYView} { .t yview 30.0 update ! set tk::textRedraw {} .t yview -pickplace 41.0 update ! list [.t index @0,0] $tk::textRedraw } {32.0 {40.0 41.0}} test textDisp-11.9 {TkTextSetYView} { .t yview 30.0 update ! set tk::textRedraw {} .t yview -pickplace 43.0 update ! list [.t index @0,0] $tk::textRedraw } {39.0 {40.0 41.0 42.0 43.0 44.0 45.0 46.0 47.0 48.0}} test textDisp-11.10 {TkTextSetYView} { .t yview 30.0 update ! set tk::textRedraw {} .t yview 10000.0 update ! list [.t index @0,0] $tk::textRedraw } {191.0 {191.0 192.0 193.0 194.0 195.0 196.0 197.0 198.0 199.0 200.0}} test textDisp-11.11 {TkTextSetYView} { .t yview 195.0 update ! set tk::textRedraw {} .t yview 197.0 update ! list [.t index @0,0] $tk::textRedraw } {191.0 {191.0 192.0 193.0 194.0 195.0 196.0}} test textDisp-11.12 {TkTextSetYView, wrapped line is off-screen} { .t insert 10.0 "Long line with enough text to wrap\n" .t yview 1.0 update ! set tk::textRedraw {} .t see 10.30 update ! list [.t index @0,0] $tk::textRedraw } {2.0 10.20} .t delete 10.0 11.0 test textDisp-11.13 {TkTestSetYView, partially-visible last line} { *************** *** 1283,1292 **** update .top.t yview 1.0 update ! set tk_textRedraw {} .top.t see 5.0 update ! list [.top.t index @0,0] $tk_textRedraw } {2.0 {5.0 6.0}} catch {destroy .top} toplevel .top --- 1283,1292 ---- update .top.t yview 1.0 update ! set tk::textRedraw {} .top.t see 5.0 update ! list [.top.t index @0,0] $tk::textRedraw } {2.0 {5.0 6.0}} catch {destroy .top} toplevel .top Index: tests/unixMenu.test =================================================================== RCS file: /cvsroot/tk/tests/unixMenu.test,v retrieving revision 1.4 diff -c -r1.4 unixMenu.test *** unixMenu.test 1999/05/25 20:40:54 1.4 --- unixMenu.test 2000/07/17 06:29:54 *************** *** 88,100 **** catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo -indicatoron 0 ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-8.2 {GetMenuIndicatorGeometry - not checkbutton or radio} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-8.3 {GetMenuIndicatorGeometry - checkbutton image} { catch {destroy .m1} --- 88,100 ---- catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo -indicatoron 0 ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-8.2 {GetMenuIndicatorGeometry - not checkbutton or radio} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-8.3 {GetMenuIndicatorGeometry - checkbutton image} { catch {destroy .m1} *************** *** 103,123 **** image create test image1 .m1 add checkbutton -image image1 -label foo .m1 invoke foo ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] [image delete image1] } {0 {} {}} test unixMenu-8.4 {GetMenuIndicatorGeometry - checkbutton bitmap} { catch {destroy .m1} menu .m1 .m1 add checkbutton -bitmap questhead -label foo .m1 invoke foo ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-8.5 {GetMenuIndicatorGeometry - checkbutton} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo .m1 invoke foo ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-8.6 {GetMenuIndicatorGeometry - radiobutton image} { catch {destroy .m1} --- 103,123 ---- image create test image1 .m1 add checkbutton -image image1 -label foo .m1 invoke foo ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] [image delete image1] } {0 {} {}} test unixMenu-8.4 {GetMenuIndicatorGeometry - checkbutton bitmap} { catch {destroy .m1} menu .m1 .m1 add checkbutton -bitmap questhead -label foo .m1 invoke foo ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-8.5 {GetMenuIndicatorGeometry - checkbutton} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo .m1 invoke foo ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-8.6 {GetMenuIndicatorGeometry - radiobutton image} { catch {destroy .m1} *************** *** 126,172 **** image create test image1 .m1 add radiobutton -image image1 -label foo .m1 invoke foo ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] [image delete image1] } {0 {} {}} test unixMenu-8.7 {GetMenuIndicatorGeometry - radiobutton bitmap} { catch {destroy .m1} menu .m1 .m1 add radiobutton -bitmap questhead -label foo .m1 invoke foo ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-8.8 {GetMenuIndicatorGeometry - radiobutton} { catch {destroy .m1} menu .m1 .m1 add radiobutton -label foo .m1 invoke foo ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-8.9 {GetMenuIndicatorGeometry - hideMargin} { catch {destroy .m1} menu .m1 .m1 add radiobutton -label foo -hidemargin 1 .m1 invoke foo ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-9.1 {GetMenuAccelGeometry - cascade entry} { catch {destroy .m1} menu .m1 .m1 add cascade -label foo ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-9.2 {GetMenuAccelGeometry - non-null label} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Ctrl+S" ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-9.3 {GetMenuAccelGeometry - null label} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-10.1 {DrawMenuEntryBackground - active menubar} { --- 126,172 ---- image create test image1 .m1 add radiobutton -image image1 -label foo .m1 invoke foo ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] [image delete image1] } {0 {} {}} test unixMenu-8.7 {GetMenuIndicatorGeometry - radiobutton bitmap} { catch {destroy .m1} menu .m1 .m1 add radiobutton -bitmap questhead -label foo .m1 invoke foo ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-8.8 {GetMenuIndicatorGeometry - radiobutton} { catch {destroy .m1} menu .m1 .m1 add radiobutton -label foo .m1 invoke foo ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-8.9 {GetMenuIndicatorGeometry - hideMargin} { catch {destroy .m1} menu .m1 .m1 add radiobutton -label foo -hidemargin 1 .m1 invoke foo ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-9.1 {GetMenuAccelGeometry - cascade entry} { catch {destroy .m1} menu .m1 .m1 add cascade -label foo ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-9.2 {GetMenuAccelGeometry - non-null label} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Ctrl+S" ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-9.3 {GetMenuAccelGeometry - null label} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-10.1 {DrawMenuEntryBackground - active menubar} { *************** *** 181,187 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] $tearoff activate 0 list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} --- 181,187 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] $tearoff activate 0 list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} *************** *** 189,195 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} --- 189,195 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} *************** *** 205,225 **** catch {destroy .m1} menu .m1 .m1 add cascade -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test unixMenu-11.3 {DrawMenuEntryAccelerator - normal entry} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Ctrl+U" ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test unixMenu-11.4 {DrawMenuEntryAccelerator - null entry} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} --- 205,225 ---- catch {destroy .m1} menu .m1 .m1 add cascade -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test unixMenu-11.3 {DrawMenuEntryAccelerator - normal entry} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Ctrl+U" ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test unixMenu-11.4 {DrawMenuEntryAccelerator - null entry} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} *************** *** 227,247 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test unixMenu-12.2 {DrawMenuEntryIndicator - checkbutton - indicator off} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo -indicatoron 0 ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test unixMenu-12.3 {DrawMenuEntryIndicator - checkbutton - not selected} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test unixMenu-12.4 {DrawMenuEntryIndicator - checkbutton - selected} { --- 227,247 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test unixMenu-12.2 {DrawMenuEntryIndicator - checkbutton - indicator off} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo -indicatoron 0 ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test unixMenu-12.3 {DrawMenuEntryIndicator - checkbutton - not selected} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test unixMenu-12.4 {DrawMenuEntryIndicator - checkbutton - selected} { *************** *** 249,269 **** menu .m1 .m1 add checkbutton -label foo .m1 invoke 1 ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test unixMenu-12.5 {DrawMenuEntryIndicator - radiobutton - indicator off} { catch {destroy .m1} menu .m1 .m1 add radiobutton -label foo -indicatoron 0 ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test unixMenu-12.6 {DrawMenuEntryIndicator - radiobutton - not selected} { catch {destroy .m1} menu .m1 .m1 add radiobutton -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test unixMenu-12.7 {DrawMenuEntryIndicator - radiobutton - selected} { --- 249,269 ---- menu .m1 .m1 add checkbutton -label foo .m1 invoke 1 ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test unixMenu-12.5 {DrawMenuEntryIndicator - radiobutton - indicator off} { catch {destroy .m1} menu .m1 .m1 add radiobutton -label foo -indicatoron 0 ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test unixMenu-12.6 {DrawMenuEntryIndicator - radiobutton - not selected} { catch {destroy .m1} menu .m1 .m1 add radiobutton -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} test unixMenu-12.7 {DrawMenuEntryIndicator - radiobutton - selected} { *************** *** 271,277 **** menu .m1 .m1 add radiobutton -label foo .m1 invoke 1 ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} --- 271,277 ---- menu .m1 .m1 add radiobutton -label foo .m1 invoke 1 ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} *************** *** 286,292 **** catch {destroy .m1} menu .m1 .m1 add separator ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} --- 286,292 ---- catch {destroy .m1} menu .m1 .m1 add separator ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} *************** *** 294,300 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} --- 294,300 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} *************** *** 309,315 **** catch {destroy .m1} menu .m1 .m1 add command -label foo -underline 0 ! set tearoff [tkTearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} --- 309,315 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo -underline 0 ! set tearoff [tk::TearOffMenu .m1 40 40] list [catch {update} msg] $msg [destroy .m1] } {0 {} {}} *************** *** 317,330 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-17.1 {GetMenuSeparatorGeometry} { catch {destroy .m1} menu .m1 .m1 add separator ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-18.1 {GetTearoffEntryGeometry} { --- 317,330 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-17.1 {GetMenuSeparatorGeometry} { catch {destroy .m1} menu .m1 .m1 add separator ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test unixMenu-18.1 {GetTearoffEntryGeometry} { *************** *** 334,340 **** .mb.m add command -label test pack .mb raise . ! list [catch {tkMbPost .mb} msg] $msg [tkMenuUnpost .mb.m] [destroy .mb] } {0 {} {} {}} # Don't know how to reproduce the case where the tkwin has been deleted. --- 334,340 ---- .mb.m add command -label test pack .mb raise . ! list [catch {tk::MbPost .mb} msg] $msg [tk::MenuUnpost .mb.m] [destroy .mb] } {0 {} {} {}} # Don't know how to reproduce the case where the tkwin has been deleted. *************** *** 624,630 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} --- 624,630 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} *************** *** 632,638 **** catch {destroy .m1} menu .m1 .m1 add command -label foo -activeforeground red ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} --- 632,638 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo -activeforeground red ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} *************** *** 641,647 **** menu .m1 set tk_strictMotif 1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] [set tk_strictMotif 0] } {{} {} 0} --- 641,647 ---- menu .m1 set tk_strictMotif 1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] [set tk_strictMotif 0] } {{} {} 0} *************** *** 649,683 **** catch {destroy .m1} menu .m1 -disabledforeground blue .m1 add command -label foo -state disabled -background red ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} { catch {destroy .m1} menu .m1 -disabledforeground blue .m1 add command -label foo -state disabled ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} { catch {destroy .m1} menu .m1 -disabledforeground "" .m1 add command -label foo -state disabled ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.7 {TkpDrawMenuEntry - gc for normal - custom entry} { catch {destroy .m1} menu .m1 .m1 add command -label foo -foreground red ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.8 {TkpDrawMenuEntry - gc for normal} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.9 {TkpDrawMenuEntry - gc for indicator - custom entry} { --- 649,683 ---- catch {destroy .m1} menu .m1 -disabledforeground blue .m1 add command -label foo -state disabled -background red ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} { catch {destroy .m1} menu .m1 -disabledforeground blue .m1 add command -label foo -state disabled ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} { catch {destroy .m1} menu .m1 -disabledforeground "" .m1 add command -label foo -state disabled ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.7 {TkpDrawMenuEntry - gc for normal - custom entry} { catch {destroy .m1} menu .m1 .m1 add command -label foo -foreground red ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.8 {TkpDrawMenuEntry - gc for normal} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.9 {TkpDrawMenuEntry - gc for indicator - custom entry} { *************** *** 685,691 **** menu .m1 .m1 add checkbutton -label foo -selectcolor orange .m1 invoke 1 ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.10 {TkpDrawMenuEntry - gc for indicator} { --- 685,691 ---- menu .m1 .m1 add checkbutton -label foo -selectcolor orange .m1 invoke 1 ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.10 {TkpDrawMenuEntry - gc for indicator} { *************** *** 693,706 **** menu .m1 .m1 add checkbutton -label foo .m1 invoke 1 ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.11 {TkpDrawMenuEntry - border - custom entry} { catch {destroy .m1} menu .m1 .m1 add command -label foo -activebackground green ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} --- 693,706 ---- menu .m1 .m1 add checkbutton -label foo .m1 invoke 1 ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.11 {TkpDrawMenuEntry - border - custom entry} { catch {destroy .m1} menu .m1 .m1 add command -label foo -activebackground green ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} *************** *** 708,714 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} --- 708,714 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} *************** *** 717,723 **** set tk_strictMotif 1 menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] [set tk_strictMotif 0] } {{} {} 0} --- 717,723 ---- set tk_strictMotif 1 menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] [set tk_strictMotif 0] } {{} {} 0} *************** *** 725,731 **** catch {destroy .m1} menu .m1 .m1 add command -label foo -activeforeground yellow ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} --- 725,731 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo -activeforeground yellow ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} *************** *** 733,739 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} --- 733,739 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} *************** *** 741,768 **** catch {destroy .m1} menu .m1 .m1 add command -label foo -font "Helvectica 72" ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.17 {TkpDrawMenuEntry - font} { catch {destroy .m1} menu .m1 -font "Courier 72" .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.18 {TkpDrawMenuEntry - separator} { catch {destroy .m1} menu .m1 .m1 add separator ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.19 {TkpDrawMenuEntry - standard} { catch {destroy .mb} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.20 {TkpDrawMenuEntry - disabled cascade item} { --- 741,768 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo -font "Helvectica 72" ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.17 {TkpDrawMenuEntry - font} { catch {destroy .m1} menu .m1 -font "Courier 72" .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.18 {TkpDrawMenuEntry - separator} { catch {destroy .m1} menu .m1 .m1 add separator ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.19 {TkpDrawMenuEntry - standard} { catch {destroy .mb} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.20 {TkpDrawMenuEntry - disabled cascade item} { *************** *** 772,778 **** menu .m1.file .m1.file add command -label foo .m1 entryconfigure File -state disabled ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.21 {TkpDrawMenuEntry - indicator} { --- 772,778 ---- menu .m1.file .m1.file add command -label foo .m1 entryconfigure File -state disabled ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.21 {TkpDrawMenuEntry - indicator} { *************** *** 780,786 **** menu .m1 .m1 add checkbutton -label Foo .m1 invoke Foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.22 {TkpDrawMenuEntry - hide margin} { --- 780,786 ---- menu .m1 .m1 add checkbutton -label Foo .m1 invoke Foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test unixMenu-23.22 {TkpDrawMenuEntry - hide margin} { *************** *** 788,794 **** menu .m1 .m1 add checkbutton -label Foo -hidemargin 1 .m1 invoke Foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} --- 788,794 ---- menu .m1 .m1 add checkbutton -label Foo -hidemargin 1 .m1 invoke Foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} *************** *** 849,856 **** menu .mb.m .mb.m add command -label test pack .mb ! catch {tkMbPost .mb} ! list [update] [tkMenuUnpost .mb.m] [destroy .mb] } {{} {} {}} test unixMenu-25.6 {TkpComputeStandardMenuGeometry - standard label geometry} { catch {destroy .m1} --- 849,856 ---- menu .mb.m .mb.m add command -label test pack .mb ! catch {tk::MbPost .mb} ! list [update] [tk::MenuUnpost .mb.m] [destroy .mb] } {{} {} {}} test unixMenu-25.6 {TkpComputeStandardMenuGeometry - standard label geometry} { catch {destroy .m1} Index: tests/winMenu.test =================================================================== RCS file: /cvsroot/tk/tests/winMenu.test,v retrieving revision 1.3 diff -c -r1.3 winMenu.test *** winMenu.test 1999/04/16 01:51:43 1.3 --- winMenu.test 2000/07/17 06:30:00 *************** *** 322,328 **** menu .mb.menu .mb.menu add command -label "winMenu-8.4 - Hit ESCAPE." pack .mb ! list [tkMbPost .mb] [destroy .m1] } {{} {}} test winMenu-8.5 {TkpPostMenu - update not pending} {pcOnly userInteraction} { catch {destroy .m1} --- 322,328 ---- menu .mb.menu .mb.menu add command -label "winMenu-8.4 - Hit ESCAPE." pack .mb ! list [tk::MbPost .mb] [destroy .m1] } {{} {}} test winMenu-8.5 {TkpPostMenu - update not pending} {pcOnly userInteraction} { catch {destroy .m1} *************** *** 440,471 **** catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test winMenu-14.2 {GetMenuIndicatorGeometry} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo -hidemargin 1 ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test winMenu-15.1 {GetMenuAccelGeometry} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add cascade -label foo -accel Ctrl+U ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test winMenu-15.2 {GetMenuAccelGeometry} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test winMenu-15.3 {GetMenuAccelGeometry} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Ctrl+U" ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test winMenu-16.1 {GetTearoffEntryGeometry} {pcOnly userInteraction} { --- 440,471 ---- catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test winMenu-14.2 {GetMenuIndicatorGeometry} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo -hidemargin 1 ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test winMenu-15.1 {GetMenuAccelGeometry} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add cascade -label foo -accel Ctrl+U ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test winMenu-15.2 {GetMenuAccelGeometry} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test winMenu-15.3 {GetMenuAccelGeometry} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Ctrl+U" ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} test winMenu-16.1 {GetTearoffEntryGeometry} {pcOnly userInteraction} { *************** *** 479,485 **** catch {destroy .m1} menu .m1 .m1 add separator ! list [catch {tkTearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} # Currently, the only callers to DrawWindowsSystemBitmap want things --- 479,485 ---- catch {destroy .m1} menu .m1 .m1 add separator ! list [catch {tk::TearOffMenu .m1 40 40}] [destroy .m1] } {0 {}} # Currently, the only callers to DrawWindowsSystemBitmap want things *************** *** 489,502 **** menu .m1 .m1 add checkbutton -label foo .m1 invoke foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-18.2 {DrawWindowsSystemBitmap - right aligned} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add cascade -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} --- 489,502 ---- menu .m1 .m1 add checkbutton -label foo .m1 invoke foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-18.2 {DrawWindowsSystemBitmap - right aligned} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add cascade -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} *************** *** 505,518 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-19.2 {DrawMenuEntryIndicator - not selected} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-19.3 {DrawMenuEntryIndicator - checkbutton} {pcOnly} { --- 505,518 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-19.2 {DrawMenuEntryIndicator - not selected} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add checkbutton -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-19.3 {DrawMenuEntryIndicator - checkbutton} {pcOnly} { *************** *** 520,526 **** menu .m1 .m1 add checkbutton -label foo .m1 invoke foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-19.4 {DrawMenuEntryIndicator - radiobutton} {pcOnly} { --- 520,526 ---- menu .m1 .m1 add checkbutton -label foo .m1 invoke foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-19.4 {DrawMenuEntryIndicator - radiobutton} {pcOnly} { *************** *** 528,534 **** menu .m1 .m1 add radiobutton -label foo .m1 invoke foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-19.5 {DrawMenuEntryIndicator - disabled} {pcOnly} { --- 528,534 ---- menu .m1 .m1 add radiobutton -label foo .m1 invoke foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-19.5 {DrawMenuEntryIndicator - disabled} {pcOnly} { *************** *** 537,543 **** .m1 add checkbutton -label foo .m1 invoke foo .m1 entryconfigure foo -state disabled ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-19.6 {DrawMenuEntryIndicator - indicator not on} {pcOnly} { --- 537,543 ---- .m1 add checkbutton -label foo .m1 invoke foo .m1 entryconfigure foo -state disabled ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-19.6 {DrawMenuEntryIndicator - indicator not on} {pcOnly} { *************** *** 545,551 **** menu .m1 .m1 add checkbutton -label foo -indicatoron 0 .m1 invoke foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} --- 545,551 ---- menu .m1 .m1 add checkbutton -label foo -indicatoron 0 .m1 invoke foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} *************** *** 553,566 **** catch {destroy .m1} menu .m1 -disabledforeground red .m1 add command -label foo -accel "Ctrl+U" -state disabled ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-20.2 {DrawMenuEntryAccelerator - normal text} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Ctrl+U" ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-20.3 {DrawMenuEntryAccelerator - disabled, no disabledforeground} \ --- 553,566 ---- catch {destroy .m1} menu .m1 -disabledforeground red .m1 add command -label foo -accel "Ctrl+U" -state disabled ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-20.2 {DrawMenuEntryAccelerator - normal text} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add command -label foo -accel "Ctrl+U" ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-20.3 {DrawMenuEntryAccelerator - disabled, no disabledforeground} \ *************** *** 568,581 **** catch {destroy .m1} menu .m1 -disabledforeground "" .m1 add command -label foo -accel "Ctrl+U" -state disabled ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-20.4 {DrawMenuEntryAccelerator - cascade, drawArrow true} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add cascade -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-20.5 {DrawMenuEntryAccelerator - cascade, drawArrow false} \ --- 568,581 ---- catch {destroy .m1} menu .m1 -disabledforeground "" .m1 add command -label foo -accel "Ctrl+U" -state disabled ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-20.4 {DrawMenuEntryAccelerator - cascade, drawArrow true} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add cascade -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-20.5 {DrawMenuEntryAccelerator - cascade, drawArrow false} \ *************** *** 590,596 **** catch {destroy .m1} menu .m1 .m1 add separator ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} --- 590,596 ---- catch {destroy .m1} menu .m1 .m1 add separator ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} *************** *** 598,604 **** catch {destroy .m1} menu .m1 .m1 add command -label foo -underline 0 ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} --- 598,604 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo -underline 0 ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} *************** *** 611,631 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-25.2 {DrawMenuEntryLabel - disabled with fg} {pcOnly} { catch {destroy .m1} menu .m1 -disabledforeground red .m1 add command -label foo -state disabled ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-25.3 {DrawMenuEntryLabel - disabled with no fg} {pcOnly} { catch {destroy .m1} menu .m1 -disabledforeground "" .m1 add command -label foo -state disabled ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} --- 611,631 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-25.2 {DrawMenuEntryLabel - disabled with fg} {pcOnly} { catch {destroy .m1} menu .m1 -disabledforeground red .m1 add command -label foo -state disabled ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-25.3 {DrawMenuEntryLabel - disabled with no fg} {pcOnly} { catch {destroy .m1} menu .m1 -disabledforeground "" .m1 add command -label foo -state disabled ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} *************** *** 662,668 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} --- 662,668 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} *************** *** 671,677 **** catch {destroy .m1} menu .m1 .m1 add command -label foo -activeforeground red ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} --- 671,677 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo -activeforeground red ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} *************** *** 680,686 **** menu .m1 set tk_strictMotif 1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] [set tk_strictMotif 0] } {{} {} 0} --- 680,686 ---- menu .m1 set tk_strictMotif 1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] [set tk_strictMotif 0] } {{} {} 0} *************** *** 690,724 **** catch {destroy .m1} menu .m1 -disabledforeground blue .m1 add command -label foo -state disabled -background red ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} {pcOnly} { catch {destroy .m1} menu .m1 -disabledforeground blue .m1 add command -label foo -state disabled ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} {pcOnly} { catch {destroy .m1} menu .m1 -disabledforeground "" .m1 add command -label foo -state disabled ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.7 {TkpDrawMenuEntry - gc for normal - custom entry} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add command -label foo -foreground red ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.8 {TkpDrawMenuEntry - gc for normal} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.9 {TkpDrawMenuEntry - gc for indicator - custom entry} {pcOnly} { --- 690,724 ---- catch {destroy .m1} menu .m1 -disabledforeground blue .m1 add command -label foo -state disabled -background red ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.5 {TkpDrawMenuEntry - gc for disabled with disabledFg} {pcOnly} { catch {destroy .m1} menu .m1 -disabledforeground blue .m1 add command -label foo -state disabled ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.6 {TkpDrawMenuEntry - gc for disabled - no disabledFg} {pcOnly} { catch {destroy .m1} menu .m1 -disabledforeground "" .m1 add command -label foo -state disabled ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.7 {TkpDrawMenuEntry - gc for normal - custom entry} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add command -label foo -foreground red ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.8 {TkpDrawMenuEntry - gc for normal} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.9 {TkpDrawMenuEntry - gc for indicator - custom entry} {pcOnly} { *************** *** 726,732 **** menu .m1 .m1 add checkbutton -label foo -selectcolor orange .m1 invoke 1 ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.10 {TkpDrawMenuEntry - gc for indicator} {pcOnly} { --- 726,732 ---- menu .m1 .m1 add checkbutton -label foo -selectcolor orange .m1 invoke 1 ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.10 {TkpDrawMenuEntry - gc for indicator} {pcOnly} { *************** *** 734,747 **** menu .m1 .m1 add checkbutton -label foo .m1 invoke 1 ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.11 {TkpDrawMenuEntry - border - custom entry} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add command -label foo -activebackground green ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} --- 734,747 ---- menu .m1 .m1 add checkbutton -label foo .m1 invoke 1 ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.11 {TkpDrawMenuEntry - border - custom entry} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add command -label foo -activebackground green ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} *************** *** 749,755 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} --- 749,755 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} *************** *** 758,764 **** set tk_strictMotif 1 menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] [set tk_strictMotif 0] } {{} {} 0} --- 758,764 ---- set tk_strictMotif 1 menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] [set tk_strictMotif 0] } {{} {} 0} *************** *** 766,772 **** catch {destroy .m1} menu .m1 .m1 add command -label foo -activeforeground yellow ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} --- 766,772 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo -activeforeground yellow ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} *************** *** 774,780 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} --- 774,780 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] .m1 entryconfigure 1 -state active list [update] [destroy .m1] } {{} {}} *************** *** 782,809 **** catch {destroy .m1} menu .m1 .m1 add command -label foo -font "Helvectica 72" ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.17 {TkpDrawMenuEntry - font} {pcOnly} { catch {destroy .m1} menu .m1 -font "Courier 72" .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.18 {TkpDrawMenuEntry - separator} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add separator ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.19 {TkpDrawMenuEntry - standard} {pcOnly} { catch {destroy .mb} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.20 {TkpDrawMenuEntry - disabled cascade item} {pcOnly} { --- 782,809 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo -font "Helvectica 72" ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.17 {TkpDrawMenuEntry - font} {pcOnly} { catch {destroy .m1} menu .m1 -font "Courier 72" .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.18 {TkpDrawMenuEntry - separator} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add separator ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.19 {TkpDrawMenuEntry - standard} {pcOnly} { catch {destroy .mb} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.20 {TkpDrawMenuEntry - disabled cascade item} {pcOnly} { *************** *** 813,819 **** menu .m1.file .m1.file add command -label foo .m1 entryconfigure File -state disabled ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.21 {TkpDrawMenuEntry - indicator} {pcOnly} { --- 813,819 ---- menu .m1.file .m1.file add command -label foo .m1 entryconfigure File -state disabled ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.21 {TkpDrawMenuEntry - indicator} {pcOnly} { *************** *** 821,827 **** menu .m1 .m1 add checkbutton -label winMenu-31.20 .m1 invoke winMenu-31.20 ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.22 {TkpDrawMenuEntry - indicator} {pcOnly} { --- 821,827 ---- menu .m1 .m1 add checkbutton -label winMenu-31.20 .m1 invoke winMenu-31.20 ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-29.22 {TkpDrawMenuEntry - indicator} {pcOnly} { *************** *** 829,835 **** menu .m1 .m1 add checkbutton -label winMenu-31.21 -hidemargin 1 .m1 invoke winMenu-31.21 ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} --- 829,835 ---- menu .m1 .m1 add checkbutton -label winMenu-31.21 -hidemargin 1 .m1 invoke winMenu-31.21 ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} *************** *** 864,877 **** catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-31.2 {DrawMenuEntryBackground} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tkTearOffMenu .m1 40 40] $tearoff activate 0 list [update] [destroy .m1] } {{} {}} --- 864,877 ---- catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] list [update] [destroy .m1] } {{} {}} test winMenu-31.2 {DrawMenuEntryBackground} {pcOnly} { catch {destroy .m1} menu .m1 .m1 add command -label foo ! set tearoff [tk::TearOffMenu .m1 40 40] $tearoff activate 0 list [update] [destroy .m1] } {{} {}} *************** *** 906,912 **** menu .mb.m .mb.m add command -label test pack .mb ! catch {tkMbPost .mb} list [update] [destroy .mb] } {{} {}} test winMenu-32.6 {TkpComputeStandardMenuGeometry - standard label geometry} \ --- 906,912 ---- menu .mb.m .mb.m add command -label test pack .mb ! catch {tk::MbPost .mb} list [update] [destroy .mb] } {{} {}} test winMenu-32.6 {TkpComputeStandardMenuGeometry - standard label geometry} \ Index: tests/xmfbox.test =================================================================== RCS file: /cvsroot/tk/tests/xmfbox.test,v retrieving revision 1.4 diff -c -r1.4 xmfbox.test *** xmfbox.test 2000/03/24 23:13:19 1.4 --- xmfbox.test 2000/07/17 06:30:01 *************** *** 59,140 **** catch {destroy .foo} } ! test xmfbox-1.1 {tkMotifFDialog_Create, -parent switch} {unixOnly} { catch {unset foo} ! set x [tkMotifFDialog_Create foo open {-parent .}] catch {destroy $x} set x } .foo ! test xmfbox-1.2 {tkMotifFDialog_Create, -parent switch} {unixOnly} { catch {unset foo} toplevel .bar wm geometry .bar +0+0 ! set x [tkMotifFDialog_Create foo open {-parent .bar}] catch {destroy $x} catch {destroy .bar} set x } .bar.foo ! test xmfbox-2.1 {tkMotifFDialog_InterpFilter, ~ in dir names} {unixOnly} { cleanup file mkdir ./~nosuchuser1 ! set x [tkMotifFDialog_Create foo open {}] $::tk::dialog::file::foo(fEnt) delete 0 end $::tk::dialog::file::foo(fEnt) insert 0 [pwd]/~nosuchuser1 ! set kk [tkMotifFDialog_InterpFilter $x] } [list $testPWD/~nosuchuser1 *] ! test xmfbox-2.2 {tkMotifFDialog_InterpFilter, ~ in file names} {unixOnly} { cleanup close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}] ! set x [tkMotifFDialog_Create foo open {}] $::tk::dialog::file::foo(fEnt) delete 0 end $::tk::dialog::file::foo(fEnt) insert 0 [pwd]/~nosuchuser1 ! set kk [tkMotifFDialog_InterpFilter $x] } [list $testPWD ./~nosuchuser1] ! test xmfbox-2.3 {tkMotifFDialog_Update, ~ in file names} {unixOnly} { cleanup close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}] ! set x [tkMotifFDialog_Create foo open {}] $::tk::dialog::file::foo(fEnt) delete 0 end $::tk::dialog::file::foo(fEnt) insert 0 [pwd]/~nosuchuser1 ! tkMotifFDialog_InterpFilter $x ! tkMotifFDialog_Update $x $::tk::dialog::file::foo(fList) get end } ~nosuchuser1 ! test xmfbox-2.4 {tkMotifFDialog_LoadFile, ~ in file names} {unixOnly} { cleanup close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}] ! set x [tkMotifFDialog_Create foo open {}] set i [lsearch [$::tk::dialog::file::foo(fList) get 0 end] ~nosuchuser1] expr {$i >= 0} } 1 ! test xmfbox-2.5 {tkMotifFDialog_BrowseFList, ~ in file names} {unixOnly} { cleanup close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}] ! set x [tkMotifFDialog_Create foo open {}] set i [lsearch [$::tk::dialog::file::foo(fList) get 0 end] ~nosuchuser1] $::tk::dialog::file::foo(fList) selection clear 0 end $::tk::dialog::file::foo(fList) selection set $i ! tkMotifFDialog_BrowseFList $x $::tk::dialog::file::foo(sEnt) get } $testPWD/~nosuchuser1 ! test xmfbox-2.5 {tkMotifFDialog_ActivateFList, ~ in file names} {unixOnly} { cleanup close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}] ! set x [tkMotifFDialog_Create foo open {}] set i [lsearch [$::tk::dialog::file::foo(fList) get 0 end] ~nosuchuser1] $::tk::dialog::file::foo(fList) selection clear 0 end $::tk::dialog::file::foo(fList) selection set $i ! tkMotifFDialog_BrowseFList $x ! tkMotifFDialog_ActivateFList $x list $::tk::dialog::file::foo(selectPath) \ ! $::tk::dialog::file::foo(selectFile) $tkPriv(selectFilePath) } [list $testPWD ~nosuchuser1 $testPWD/~nosuchuser1] # cleanup --- 59,140 ---- catch {destroy .foo} } ! test xmfbox-1.1 {tk::MotifFDialog_Create, -parent switch} {unixOnly} { catch {unset foo} ! set x [tk::MotifFDialog_Create foo open {-parent .}] catch {destroy $x} set x } .foo ! test xmfbox-1.2 {tk::MotifFDialog_Create, -parent switch} {unixOnly} { catch {unset foo} toplevel .bar wm geometry .bar +0+0 ! set x [tk::MotifFDialog_Create foo open {-parent .bar}] catch {destroy $x} catch {destroy .bar} set x } .bar.foo ! test xmfbox-2.1 {tk::MotifFDialog_InterpFilter, ~ in dir names} {unixOnly} { cleanup file mkdir ./~nosuchuser1 ! set x [tk::MotifFDialog_Create foo open {}] $::tk::dialog::file::foo(fEnt) delete 0 end $::tk::dialog::file::foo(fEnt) insert 0 [pwd]/~nosuchuser1 ! set kk [tk::MotifFDialog_InterpFilter $x] } [list $testPWD/~nosuchuser1 *] ! test xmfbox-2.2 {tk::MotifFDialog_InterpFilter, ~ in file names} {unixOnly} { cleanup close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}] ! set x [tk::MotifFDialog_Create foo open {}] $::tk::dialog::file::foo(fEnt) delete 0 end $::tk::dialog::file::foo(fEnt) insert 0 [pwd]/~nosuchuser1 ! set kk [tk::MotifFDialog_InterpFilter $x] } [list $testPWD ./~nosuchuser1] ! test xmfbox-2.3 {tk::MotifFDialog_Update, ~ in file names} {unixOnly} { cleanup close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}] ! set x [tk::MotifFDialog_Create foo open {}] $::tk::dialog::file::foo(fEnt) delete 0 end $::tk::dialog::file::foo(fEnt) insert 0 [pwd]/~nosuchuser1 ! tk::MotifFDialog_InterpFilter $x ! tk::MotifFDialog_Update $x $::tk::dialog::file::foo(fList) get end } ~nosuchuser1 ! test xmfbox-2.4 {tk::MotifFDialog_LoadFile, ~ in file names} {unixOnly} { cleanup close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}] ! set x [tk::MotifFDialog_Create foo open {}] set i [lsearch [$::tk::dialog::file::foo(fList) get 0 end] ~nosuchuser1] expr {$i >= 0} } 1 ! test xmfbox-2.5 {tk::MotifFDialog_BrowseFList, ~ in file names} {unixOnly} { cleanup close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}] ! set x [tk::MotifFDialog_Create foo open {}] set i [lsearch [$::tk::dialog::file::foo(fList) get 0 end] ~nosuchuser1] $::tk::dialog::file::foo(fList) selection clear 0 end $::tk::dialog::file::foo(fList) selection set $i ! tk::MotifFDialog_BrowseFList $x $::tk::dialog::file::foo(sEnt) get } $testPWD/~nosuchuser1 ! test xmfbox-2.5 {tk::MotifFDialog_ActivateFList, ~ in file names} {unixOnly} { cleanup close [open ./~nosuchuser1 {CREAT TRUNC WRONLY}] ! set x [tk::MotifFDialog_Create foo open {}] set i [lsearch [$::tk::dialog::file::foo(fList) get 0 end] ~nosuchuser1] $::tk::dialog::file::foo(fList) selection clear 0 end $::tk::dialog::file::foo(fList) selection set $i ! tk::MotifFDialog_BrowseFList $x ! tk::MotifFDialog_ActivateFList $x list $::tk::dialog::file::foo(selectPath) \ ! $::tk::dialog::file::foo(selectFile) $tk::Priv(selectFilePath) } [list $testPWD ~nosuchuser1 $testPWD/~nosuchuser1] # cleanup Index: unix/tkUnixDialog.c =================================================================== RCS file: /cvsroot/tk/unix/tkUnixDialog.c,v retrieving revision 1.2 diff -c -r1.2 tkUnixDialog.c *** tkUnixDialog.c 1998/09/14 18:23:55 1.2 --- tkUnixDialog.c 2000/07/17 06:30:02 *************** *** 103,109 **** int argc; /* Number of arguments. */ char **argv; /* Argument strings. */ { ! return EvalArgv(interp, "tkColorDialog", argc, argv); } /* --- 103,109 ---- int argc; /* Number of arguments. */ char **argv; /* Argument strings. */ { ! return EvalArgv(interp, "tk::ColorDialog", argc, argv); } /* *************** *** 137,145 **** Tk_Window tkwin = (Tk_Window)clientData; if (Tk_StrictMotif(tkwin)) { ! return EvalArgv(interp, "tkMotifFDialog", argc, argv); } else { ! return EvalArgv(interp, "tkFDialog", argc, argv); } } --- 137,145 ---- Tk_Window tkwin = (Tk_Window)clientData; if (Tk_StrictMotif(tkwin)) { ! return EvalArgv(interp, "tk::MotifFDialog", argc, argv); } else { ! return EvalArgv(interp, "tk::FDialog", argc, argv); } } *************** *** 170,178 **** Tk_Window tkwin = (Tk_Window)clientData; if (Tk_StrictMotif(tkwin)) { ! return EvalArgv(interp, "tkMotifFDialog", argc, argv); } else { ! return EvalArgv(interp, "tkFDialog", argc, argv); } } --- 170,178 ---- Tk_Window tkwin = (Tk_Window)clientData; if (Tk_StrictMotif(tkwin)) { ! return EvalArgv(interp, "tk::MotifFDialog", argc, argv); } else { ! return EvalArgv(interp, "tk::FDialog", argc, argv); } } *************** *** 202,207 **** int argc; /* Number of arguments. */ char **argv; /* Argument strings. */ { ! return EvalArgv(interp, "tkMessageBox", argc, argv); } --- 202,207 ---- int argc; /* Number of arguments. */ char **argv; /* Argument strings. */ { ! return EvalArgv(interp, "tk::MessageBox", argc, argv); }