From 66304f744b14ffc5eb42724284c279e91de9444d Mon Sep 17 00:00:00 2001 From: culler Date: Thu, 22 Apr 2021 13:02:15 +0000 Subject: Remove BEGIN_DRAWING_OR_REDRAW which does not work. --- macosx/ttkMacOSXTheme.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index c4e1f33..8379812 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -42,15 +42,6 @@ return; \ } \ -#define BEGIN_DRAWING_OR_REDRAW(d) { \ - TkMacOSXDrawingContext dc; \ - if (!TkMacOSXSetupDrawingContext((d), NULL, &dc)) { \ - NSView *view = TkMacOSXGetNSViewForDrawable(d); \ - while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {} \ - [(TKContentView *)view addTkDirtyRect:[view bounds]]; \ - return; \ - } \ - #define END_DRAWING \ TkMacOSXRestoreDrawingContext(&dc);} @@ -1614,7 +1605,7 @@ static void TabElementDraw( .position = Ttk_StateTableLookup(TabPositionTable, state), }; - BEGIN_DRAWING_OR_REDRAW(d) + BEGIN_DRAWING(d) if (TkMacOSXInDarkMode(tkwin)) { DrawDarkTab(bounds, state, dc.context); } else { @@ -2806,7 +2797,7 @@ static void FillElementDraw( NSColorSpace *deviceRGB = [NSColorSpace deviceRGBColorSpace]; NSColor *bgColor; CGFloat fill[4]; - BEGIN_DRAWING_OR_REDRAW(d) + BEGIN_DRAWING(d) GetBackgroundColor(dc.context, tkwin, 0, fill); bgColor = [NSColor colorWithColorSpace: deviceRGB components: fill count: 4]; -- cgit v0.12 From 019923f12e5ac43053840de0701390146ae57907 Mon Sep 17 00:00:00 2001 From: culler Date: Thu, 22 Apr 2021 17:07:28 +0000 Subject: Remove unneeded portBounds field from TkMacOSXDrawingContext; add more graphics debugging tools. --- macosx/tkMacOSXDraw.c | 53 +++++++++++++++++++++++++++++++++++++----------- macosx/tkMacOSXFont.c | 2 +- macosx/tkMacOSXPrivate.h | 1 - macosx/tkMacOSXRegion.c | 2 +- macosx/ttkMacOSXTheme.c | 2 ++ 5 files changed, 45 insertions(+), 15 deletions(-) diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index bf6a4a7..aa7523a 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -27,6 +27,7 @@ #ifdef TK_MAC_DEBUG #define TK_MAC_DEBUG_DRAWING #define TK_MAC_DEBUG_IMAGE_DRAWING +#define TK_MAC_DEBUG_CG #endif */ @@ -1266,6 +1267,11 @@ TkMacOSXSetupDrawingContext( TKContentView *view = nil; TkMacOSXDrawingContext dc = {}; +#ifdef TK_MAC_DEBUG_CG + fprintf(stderr, "TkMacOSXSetupDrawingContext: %s\n", + macDraw->winPtr ? Tk_PathName(macDraw->winPtr) : "None"); +#endif + /* * If the drawable is not a pixmap, get the associated NSView. */ @@ -1296,13 +1302,10 @@ TkMacOSXSetupDrawingContext( */ dc.context = TkMacOSXGetCGContextForDrawable(d); - if (dc.context) { - dc.portBounds = CGContextGetClipBoundingBox(dc.context); - } else { + if (!dc.context) { NSRect drawingBounds, currentBounds; dc.view = view; dc.context = GET_CGCONTEXT; - dc.portBounds = NSRectToCGRect([view bounds]); if (dc.clipRgn) { CGRect clipBounds; CGAffineTransform t = { .a = 1, .b = 0, .c = 0, .d = -1, .tx = 0, @@ -1358,11 +1361,14 @@ TkMacOSXSetupDrawingContext( .a = 1, .b = 0, .c = 0, .d = -1, .tx = 0, - .ty = dc.portBounds.size.height + .ty = [view bounds].size.height }; - dc.portBounds.origin.x += macDraw->xOff; - dc.portBounds.origin.y += macDraw->yOff; +#ifdef TK_MAC_DEBUG_CG + fprintf(stderr, "TkMacOSXSetupDrawingContext: pushing GState for %s\n", + macDraw->winPtr ? Tk_PathName(macDraw->winPtr) : "None"); +#endif + CGContextSaveGState(dc.context); CGContextSetTextDrawingMode(dc.context, kCGTextFill); CGContextConcatCTM(dc.context, t); @@ -1388,11 +1394,26 @@ TkMacOSXSetupDrawingContext( */ ChkErr(HIShapeReplacePathInCGContext, dc.clipRgn, dc.context); + +#ifdef TK_MAC_DEBUG_CG + fprintf(stderr, "Setting complex clip for %s to:\n", + macDraw->winPtr ? Tk_PathName(macDraw->winPtr) : "None"); + TkMacOSXPrintRectsInRegion(dc.clipRgn); +#endif + CGContextEOClip(dc.context); - } - else { + } else { CGRect r; HIShapeGetBounds(dc.clipRgn, &r); + +#ifdef TK_MAC_DEBUG_CG + fprintf(stderr, "Current clip BBox is %s\n", + NSStringFromRect(CGContextGetClipBoundingBox(GET_CGCONTEXT)).UTF8String); + fprintf(stderr, "Setting clip for %s to rect %s:\n", + macDraw->winPtr ? Tk_PathName(macDraw->winPtr) : "None", + NSStringFromRect(r).UTF8String); +#endif + CGContextClipToRect(dc.context, r); } } @@ -1413,8 +1434,8 @@ TkMacOSXSetupDrawingContext( TkMacOSXSetColorInContext(gc, gc->foreground, dc.context); if (view) { - CGContextSetPatternPhase(dc.context, - CGSizeMake(dc.portBounds.size.width, dc.portBounds.size.height)); + NSSize size = [view bounds].size; + CGContextSetPatternPhase(dc.context, size); } if (gc->function != GXcopy) { TkMacOSXDbgMsg("Logical functions other than GXcopy are " @@ -1491,13 +1512,21 @@ TkMacOSXRestoreDrawingContext( if (dcPtr->context) { CGContextSynchronize(dcPtr->context); CGContextRestoreGState(dcPtr->context); + +#ifdef TK_MAC_DEBUG_CG + fprintf(stderr, "TkMacOSXRestoreDrawingContext: popped GState\n"); +#endif + } if (dcPtr->clipRgn) { CFRelease(dcPtr->clipRgn); + dcPtr->clipRgn = NULL; } + #ifdef TK_MAC_DEBUG bzero(dcPtr, sizeof(TkMacOSXDrawingContext)); -#endif /* TK_MAC_DEBUG */ +#endif + } /* diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index 2a28f73..8189bdb 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -1217,7 +1217,7 @@ TkpDrawAngledCharsInContext( (CFAttributedStringRef)attributedString); textX += (CGFloat) macWin->xOff; textY += (CGFloat) macWin->yOff; - height = drawingContext.portBounds.size.height; + height = [drawingContext.view bounds].size.height; textY = height - textY; t = CGAffineTransformMake(1.0, 0.0, 0.0, -1.0, 0.0, height); if (angle != 0.0) { diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 0bd46c6..29e7c53 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -203,7 +203,6 @@ typedef struct TkMacOSXDrawingContext { CGContextRef context; NSView *view; HIShapeRef clipRgn; - CGRect portBounds; } TkMacOSXDrawingContext; /* diff --git a/macosx/tkMacOSXRegion.c b/macosx/tkMacOSXRegion.c index 3c168f1..fbb41cb 100644 --- a/macosx/tkMacOSXRegion.c +++ b/macosx/tkMacOSXRegion.c @@ -575,7 +575,7 @@ rectPrinter( void *ref) { if (rect) { - printf(" %s\n", NSStringFromRect(*rect).UTF8String); + fprintf(stderr, " %s\n", NSStringFromRect(*rect).UTF8String); } return noErr; } diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index 8379812..6b1aff6 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -555,6 +555,8 @@ static void SolidFillRoundedRectangle( CGContextSetFillColorWithColor(context, CGCOLOR(color)); CGContextBeginPath(context); CGContextAddPath(context, path); + fprintf(stderr, "Filling rounded rectangle at %s\n", + NSStringFromRect(bounds).UTF8String); CGContextFillPath(context); CFRelease(path); } -- cgit v0.12 From 64594c2a80336e1a00dc711942a4ed5fb5dd0e98 Mon Sep 17 00:00:00 2001 From: culler Date: Thu, 22 Apr 2021 19:21:00 +0000 Subject: Make debug printing conditional in ttkMacOSXTheme.c --- macosx/ttkMacOSXTheme.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/macosx/ttkMacOSXTheme.c b/macosx/ttkMacOSXTheme.c index 6b1aff6..ce098f4 100644 --- a/macosx/ttkMacOSXTheme.c +++ b/macosx/ttkMacOSXTheme.c @@ -555,8 +555,10 @@ static void SolidFillRoundedRectangle( CGContextSetFillColorWithColor(context, CGCOLOR(color)); CGContextBeginPath(context); CGContextAddPath(context, path); +#ifdef TK_MAC_DEBUG_CG fprintf(stderr, "Filling rounded rectangle at %s\n", NSStringFromRect(bounds).UTF8String); +#endif CGContextFillPath(context); CFRelease(path); } -- cgit v0.12 From e3f627385b02a29326439ffe0159930466944f6a Mon Sep 17 00:00:00 2001 From: culler Date: Sat, 24 Apr 2021 19:47:30 +0000 Subject: Possibly a genuine fix - use an explicit CALayer for the TKContentView. --- macosx/tkMacOSXNotify.c | 7 ++++--- macosx/tkMacOSXPrivate.h | 1 + macosx/tkMacOSXWindowEvent.c | 32 ++++++++++++++++++++++++++++++++ unix/configure | 2 +- unix/configure.in | 2 +- 5 files changed, 39 insertions(+), 5 deletions(-) diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index f32fa76..0438525 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -340,8 +340,9 @@ TkMacOSXNotifyExitHandler( * for all views that need display before it returns. We call it with * deQueue=NO so that it will not change anything on the AppKit event * queue, because we only want the side effect that it runs drawRect. The - * only time when any NSViews have the needsDisplay property set to YES - * is during execution of this function. + * only times when any NSViews have the needsDisplay property set to YES + * are during execution of this function or in the addDirtyRect method + * of TKContentView. * * The reason for running this function as an idle task is to try to * arrange that all widgets will be fully configured before they are @@ -377,7 +378,7 @@ TkMacOSXDrawAllViews( if (dirtyCount) { continue; } - [view setNeedsDisplayInRect:[view tkDirtyRect]]; + [[view layer] setNeedsDisplayInRect:[view tkDirtyRect]]; } } else { [window displayIfNeeded]; diff --git a/macosx/tkMacOSXPrivate.h b/macosx/tkMacOSXPrivate.h index 29e7c53..be2264f 100644 --- a/macosx/tkMacOSXPrivate.h +++ b/macosx/tkMacOSXPrivate.h @@ -27,6 +27,7 @@ #define TextStyle MacTextStyle #import #import +#import #ifndef NO_CARBON_H #import #endif diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 0075fb8..b6b58d8 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -915,11 +915,43 @@ ConfigureRestrictProc( @implementation TKContentView(TKWindowEvent) +- (id)initWithFrame:(NSRect)frame +{ + self = [super initWithFrame:frame]; + if (self) { + /* + * The layer must exist before we set wantsLayer to YES. + */ + + self.layer = [CALayer layer]; + self.wantsLayer = YES; + self.layerContentsRedrawPolicy = NSViewLayerContentsRedrawOnSetNeedsDisplay; + + /* + * Nothing gets drawn at all if the layer does not have a delegate. + * Currently, we do not implement any methods of the delegate, however. + */ + + self.layer.delegate = (id) self; + } + return self; +} + +/* + * We will just use drawRect. + */ + +- (BOOL) wantsUpdateLayer +{ + return NO; +} + - (void) addTkDirtyRect: (NSRect) rect { _tkNeedsDisplay = YES; _tkDirtyRect = NSUnionRect(_tkDirtyRect, rect); [NSApp setNeedsToDraw:YES]; + [self setNeedsDisplay:YES]; } - (void) clearTkDirtyRect diff --git a/unix/configure b/unix/configure index 45c215e..691d43b 100755 --- a/unix/configure +++ b/unix/configure @@ -9385,7 +9385,7 @@ cat >>confdefs.h <<\_ACEOF #define MAC_OSX_TK 1 _ACEOF - LIBS="$LIBS -framework Cocoa -framework Carbon -framework IOKit" + LIBS="$LIBS -framework Cocoa -framework Carbon -framework IOKit -framework QuartzCore" EXTRA_CC_SWITCHES='-std=gnu99 -x objective-c' TK_WINDOWINGSYSTEM=AQUA if test -n "${enable_symbols}" -a "${enable_symbols}" != no; then diff --git a/unix/configure.in b/unix/configure.in index 78dd688..9720b91 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -354,7 +354,7 @@ fi if test $tk_aqua = yes; then AC_DEFINE(MAC_OSX_TK, 1, [Are we building TkAqua?]) - LIBS="$LIBS -framework Cocoa -framework Carbon -framework IOKit" + LIBS="$LIBS -framework Cocoa -framework Carbon -framework IOKit -framework QuartzCore" EXTRA_CC_SWITCHES='-std=gnu99 -x objective-c' TK_WINDOWINGSYSTEM=AQUA if test -n "${enable_symbols}" -a "${enable_symbols}" != no; then -- cgit v0.12 From 55bde88d25c729979dd328b7084bcb6ee2498255 Mon Sep 17 00:00:00 2001 From: culler Date: Sun, 25 Apr 2021 14:00:35 +0000 Subject: Bonus! Use the new CALayer to make XCopyArea work again! --- macosx/tkMacOSXImage.c | 66 +++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c index 69967af..1dc4613 100644 --- a/macosx/tkMacOSXImage.c +++ b/macosx/tkMacOSXImage.c @@ -528,50 +528,44 @@ CreateCGImageFromDrawableRect( { MacDrawable *mac_drawable = (MacDrawable *)drawable; CGContextRef cg_context = NULL; - CGImageRef cg_image = NULL, result = NULL; - NSBitmapImageRep *bitmapRep = nil; - NSView *view = nil; + CGRect image_rect = CGRectMake(x, y, width, height); + CGImageRef cg_image = nil, result = nil; if (mac_drawable->flags & TK_IS_PIXMAP) { - /* - * This MacDrawable is a bitmap, so its view is NULL. - */ - - CGRect image_rect = CGRectMake(x, y, width, height); - cg_context = TkMacOSXGetCGContextForDrawable(drawable); cg_image = CGBitmapContextCreateImage((CGContextRef) cg_context); if (cg_image) { result = CGImageCreateWithImageInRect(cg_image, image_rect); CGImageRelease(cg_image); } - } else if (TkMacOSXGetNSViewForDrawable(mac_drawable) != nil) { - - /* - * Convert Tk top-left to NSView bottom-left coordinates. - */ - - int view_height = [view bounds].size.height; - NSRect view_rect = NSMakeRect(x + mac_drawable->xOff, - view_height - height - y - mac_drawable->yOff, - width, height); - - /* - * Attempt to copy from the view to a bitmapImageRep. If the view does - * not have a valid CGContext, doing this will silently corrupt memory - * and make a big mess. So, in that case, we just return NULL. - */ - - if (view == [NSView focusView]) { - bitmapRep = [view bitmapImageRepForCachingDisplayInRect: view_rect]; - [view cacheDisplayInRect:view_rect toBitmapImageRep:bitmapRep]; - result = [bitmapRep CGImage]; - CFRelease(bitmapRep); - } else { - TkMacOSXDbgMsg("No CGContext - cannot copy from screen to bitmap."); - result = NULL; - } } else { - TkMacOSXDbgMsg("Invalid source drawable"); + NSView *view = TkMacOSXGetNSViewForDrawable(mac_drawable); + if (view == nil) { + TkMacOSXDbgMsg("Invalid source drawable"); + return nil; + } + NSSize size = view.frame.size; + NSUInteger width = size.width, height = size.height; + NSUInteger bytesPerPixel = 4, + bytesPerRow = bytesPerPixel * width, + bitsPerComponent = 8; + unsigned char *rawData = malloc(height * bytesPerRow); + if (rawData) { + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + cg_context = CGBitmapContextCreate(rawData, width, height, + bitsPerComponent, bytesPerRow, colorSpace, + kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); + CFRelease(colorSpace); + if (cg_context) { + [view.layer renderInContext:cg_context]; + cg_image = CGBitmapContextCreateImage(cg_context); + CGContextRelease(cg_context); + } + free(rawData); + } + if (cg_image) { + result = CGImageCreateWithImageInRect(cg_image, image_rect); + CGImageRelease(cg_image); + } } return result; } -- cgit v0.12 From 8822888c8757a09d5a6322d1458512095ac1f2f0 Mon Sep 17 00:00:00 2001 From: culler Date: Sun, 25 Apr 2021 14:28:16 +0000 Subject: Add calls to update idletasks in scale-20.7 and scale-20.8. --- tests/scale.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/scale.test b/tests/scale.test index 34f2cd9..d7f3a75 100644 --- a/tests/scale.test +++ b/tests/scale.test @@ -1522,6 +1522,7 @@ test scale-20.7 {Bug [2262543fff] - Scale widget unexpectedly fires command call } -body { scale .s -from 1 -to 50 -command {set commandedVar} pack .s + update idletasks .s set 10 set timeout [after 500 {set $commandedVar "timeout"}] vwait commandedVar ; # -command callback shall fire @@ -1538,6 +1539,7 @@ test scale-20.8 {Bug [2262543fff] - Scale widget unexpectedly fires command call } -body { scale .s -from 1 -to 50 -variable scaleVar -command {set commandedVar} pack .s + update idletasks .s set 10 set timeout [after 500 {set $commandedVar "timeout"}] vwait commandedVar ; # -command callback shall fire -- cgit v0.12 From 79f3f632a93e76d6d696ae190b69c030f3bc3821 Mon Sep 17 00:00:00 2001 From: culler Date: Sun, 25 Apr 2021 15:36:39 +0000 Subject: Using the CALayer changes some timings -- make some small adjustments to a few tests to avoid sporadic timing-related failures. --- tests/entry.test | 1 + tests/font.test | 6 +++--- tests/textWind.test | 10 +++++++--- tests/unixEmbed.test | 1 + 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/entry.test b/tests/entry.test index ef70a9e..a72d36a 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -2968,6 +2968,7 @@ test entry-17.2 {EntryUpdateScrollbar procedure} -body { test entry-17.3 {EntryUpdateScrollbar procedure} -body { entry .e -width 10 -xscrollcommand scroll -font {Courier -12} pack .e + update idletasks set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] .e insert 0 abcdefghijklmnopqrs .e xview 6 diff --git a/tests/font.test b/tests/font.test index 6995a7b..5af2dbb 100644 --- a/tests/font.test +++ b/tests/font.test @@ -523,16 +523,16 @@ test font-12.2 {UpdateDependantFonts procedure: pings the widgets} -setup { destroy .t.f catch {font delete xyz} pack [label .t.f] - update + update idletasks } -body { font create xyz -family times -size 20 .t.f config -font xyz -text "abcd" -padx 0 -bd 0 -highlightthickness 0 set a1 [font measure xyz "abcd"] - update + update idletasks set b1 [winfo reqwidth .t.f] font configure xyz -family helvetica -size 20 set a2 [font measure xyz "abcd"] - update + update idletasks set b2 [winfo reqwidth .t.f] expr {$a1==$b1 && $a2==$b2} } -cleanup { diff --git a/tests/textWind.test b/tests/textWind.test index a11a418..11f8eb8 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -1526,13 +1526,15 @@ test textWind-17.9 {peer widget window configuration} -setup { destroy .t .tt } -body { pack [text .t] + update idletasks .t delete 1.0 end .t insert 1.0 "Some sample text" toplevel .tt pack [.t peer create .tt.t] + update idletasks .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue] - update ; update .tt.t window configure 1.2 -window [frame .tt.t.f -width 10 -height 20 -bg red] + update idletasks list [.t window configure 1.2 -window] [.tt.t window configure 1.2 -window] } -cleanup { destroy .tt .t @@ -1542,20 +1544,22 @@ test textWind-17.10 {peer widget window configuration} -setup { destroy .t .tt } -body { pack [text .t] + update idletasks .t delete 1.0 end .t insert 1.0 "Some sample text" toplevel .tt pack [.t peer create .tt.t] + update idletasks .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue] .tt.t window create 1.2 -window [frame .tt.t.f -width 25 -height 20 -bg blue] - update ; update + update idletasks .t window configure 1.2 -create \ {destroy %W.f ; frame %W.f -width 50 -height 7 -bg red} .tt.t window configure 1.2 -window {} .t window configure 1.2 -window {} set res [list [.t window configure 1.2 -window] \ [.tt.t window configure 1.2 -window]] - update + update idletasks lappend res [.t window configure 1.2 -window] \ [.tt.t window configure 1.2 -window] } -cleanup { diff --git a/tests/unixEmbed.test b/tests/unixEmbed.test index bb7edc5..d5f6ee3 100644 --- a/tests/unixEmbed.test +++ b/tests/unixEmbed.test @@ -1301,6 +1301,7 @@ test unixEmbed-11.2 {mouse coordinates in embedded toplevels} -constraints { wm geometry .main 200x400+100+100 update idletasks focus -force .main + after 100 set x [expr {[winfo x .main ] + [winfo x .main.b] + 40}] set y [expr {[winfo y .main ] + [winfo y .main.b] + 38}] lappend result [winfo containing $x $y] -- cgit v0.12 From 971268f241db43b649dd2387e352ec171b3e2703 Mon Sep 17 00:00:00 2001 From: culler Date: Sun, 25 Apr 2021 15:53:47 +0000 Subject: Use the release method instead of CFRelease for NSBitmapImageRep objects. --- macosx/tkMacOSXImage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c index 1dc4613..8160303 100644 --- a/macosx/tkMacOSXImage.c +++ b/macosx/tkMacOSXImage.c @@ -670,11 +670,11 @@ XGetImage( || bytes_per_row < 4 * width || size != bytes_per_row * height) { TkMacOSXDbgMsg("XGetImage: Unrecognized bitmap format"); - CFRelease(bitmapRep); + [bitmapRep release]; return NULL; } memcpy(bitmap, (char *)[bitmapRep bitmapData], size); - CFRelease(bitmapRep); + [bitmapRep release]; /* * When Apple extracts a bitmap from an NSView, it may be in either -- cgit v0.12 From 312349dd711ba2bb4341ec16cc1b476351d6cbb9 Mon Sep 17 00:00:00 2001 From: culler Date: Sun, 25 Apr 2021 22:03:02 +0000 Subject: Fix the flip transform for pixmaps. This makes bitmap buttons work again. --- macosx/tkMacOSXDraw.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index aa7523a..f642bda 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -1266,6 +1266,7 @@ TkMacOSXSetupDrawingContext( Bool canDraw = true; TKContentView *view = nil; TkMacOSXDrawingContext dc = {}; + CGFloat drawingHeight; #ifdef TK_MAC_DEBUG_CG fprintf(stderr, "TkMacOSXSetupDrawingContext: %s\n", @@ -1357,11 +1358,13 @@ TkMacOSXSetupDrawingContext( * Finish configuring the drawing context. */ + drawingHeight = view ? [view bounds].size.height : + CGContextGetClipBoundingBox(dc.context).size.height; CGAffineTransform t = { .a = 1, .b = 0, .c = 0, .d = -1, .tx = 0, - .ty = [view bounds].size.height + .ty = drawingHeight }; #ifdef TK_MAC_DEBUG_CG -- cgit v0.12 From 45e129155eee3c174598146404e28b0cbdc02e5c Mon Sep 17 00:00:00 2001 From: culler Date: Sun, 25 Apr 2021 22:48:28 +0000 Subject: Code cleanup. Thanks to Christopher Chavez for the careful review. --- macosx/tkMacOSXImage.c | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c index 8160303..6f55171 100644 --- a/macosx/tkMacOSXImage.c +++ b/macosx/tkMacOSXImage.c @@ -529,44 +529,42 @@ CreateCGImageFromDrawableRect( MacDrawable *mac_drawable = (MacDrawable *)drawable; CGContextRef cg_context = NULL; CGRect image_rect = CGRectMake(x, y, width, height); - CGImageRef cg_image = nil, result = nil; + CGImageRef cg_image = NULL, result = NULL; + unsigned char *imageData = NULL; if (mac_drawable->flags & TK_IS_PIXMAP) { cg_context = TkMacOSXGetCGContextForDrawable(drawable); - cg_image = CGBitmapContextCreateImage((CGContextRef) cg_context); - if (cg_image) { - result = CGImageCreateWithImageInRect(cg_image, image_rect); - CGImageRelease(cg_image); + if (cg_context) { + cg_image = CGBitmapContextCreateImage((CGContextRef) cg_context); + CFRelease(cg_context); } } else { NSView *view = TkMacOSXGetNSViewForDrawable(mac_drawable); if (view == nil) { TkMacOSXDbgMsg("Invalid source drawable"); - return nil; + return NULL; } NSSize size = view.frame.size; NSUInteger width = size.width, height = size.height; NSUInteger bytesPerPixel = 4, bytesPerRow = bytesPerPixel * width, bitsPerComponent = 8; - unsigned char *rawData = malloc(height * bytesPerRow); - if (rawData) { - CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); - cg_context = CGBitmapContextCreate(rawData, width, height, - bitsPerComponent, bytesPerRow, colorSpace, - kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); - CFRelease(colorSpace); - if (cg_context) { - [view.layer renderInContext:cg_context]; - cg_image = CGBitmapContextCreateImage(cg_context); - CGContextRelease(cg_context); - } - free(rawData); - } - if (cg_image) { - result = CGImageCreateWithImageInRect(cg_image, image_rect); - CGImageRelease(cg_image); - } + imageData = ckalloc(height * bytesPerRow); + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + cg_context = CGBitmapContextCreate(imageData, width, height, + bitsPerComponent, bytesPerRow, colorSpace, + kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); + CFRelease(colorSpace); + [view.layer renderInContext:cg_context]; + } + if (cg_context) { + cg_image = CGBitmapContextCreateImage(cg_context); + CGContextRelease(cg_context); + } + if (cg_image) { + result = CGImageCreateWithImageInRect(cg_image, image_rect); + CGImageRelease(cg_image); } + ckfree(imageData); return result; } -- cgit v0.12 From 2b4875f9a8a916fa7fc7c821b0a73d668ec35cdf Mon Sep 17 00:00:00 2001 From: culler Date: Sun, 25 Apr 2021 22:50:14 +0000 Subject: One more bit of code cleanup. --- macosx/tkMacOSXDraw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macosx/tkMacOSXDraw.c b/macosx/tkMacOSXDraw.c index f642bda..d5396eb 100644 --- a/macosx/tkMacOSXDraw.c +++ b/macosx/tkMacOSXDraw.c @@ -1437,7 +1437,7 @@ TkMacOSXSetupDrawingContext( TkMacOSXSetColorInContext(gc, gc->foreground, dc.context); if (view) { - NSSize size = [view bounds].size; + CGSize size = NSSizeToCGSize([view bounds].size); CGContextSetPatternPhase(dc.context, size); } if (gc->function != GXcopy) { -- cgit v0.12 From 81a7dbc90f3961dc72cc728dc321d7e488e4d4c1 Mon Sep 17 00:00:00 2001 From: culler Date: Mon, 26 Apr 2021 01:29:54 +0000 Subject: Set the CALayer's contentsGravity property so that programmatic resizes look better. --- macosx/tkMacOSXWindowEvent.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index b6b58d8..fe8a983 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -926,6 +926,8 @@ ConfigureRestrictProc( self.layer = [CALayer layer]; self.wantsLayer = YES; self.layerContentsRedrawPolicy = NSViewLayerContentsRedrawOnSetNeedsDisplay; + self.layer.contentsGravity = self.layer.contentsAreFlipped ? + kCAGravityTopLeft : kCAGravityBottomLeft; /* * Nothing gets drawn at all if the layer does not have a delegate. -- cgit v0.12 From 5548b9384faa00a2bb51f6b6f1cb9533eeaf246c Mon Sep 17 00:00:00 2001 From: culler Date: Tue, 27 Apr 2021 19:35:45 +0000 Subject: Try to avoid the rare crash in Tk_MacOSXGetTkWindow which has been seen at exit a few times. --- macosx/tkMacOSXWm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 4f073d8..77f7b09 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -5535,12 +5535,15 @@ Tk_MacOSXGetTkWindow( void *w) { Window window = None; - TkDisplay *dispPtr = TkGetDisplayList(); if ([(NSWindow *)w respondsToSelector: @selector (tkWindow)]) { window = [(TKWindow *)w tkWindow]; } - return (window != None ? - Tk_IdToWindow(dispPtr->display, window) : NULL); + if (window) { + TkDisplay *dispPtr = TkGetDisplayList(); + return Tk_IdToWindow(dispPtr->display, window); + } else { + return NULL; + } } /* -- cgit v0.12 From 3387e9ef1780a37d84b726bbde72b62624730325 Mon Sep 17 00:00:00 2001 From: culler Date: Tue, 27 Apr 2021 20:04:35 +0000 Subject: Adjust textWind-17.10 --- tests/textWind.test | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/tests/textWind.test b/tests/textWind.test index 11f8eb8..1329790 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -1526,15 +1526,13 @@ test textWind-17.9 {peer widget window configuration} -setup { destroy .t .tt } -body { pack [text .t] - update idletasks .t delete 1.0 end .t insert 1.0 "Some sample text" toplevel .tt pack [.t peer create .tt.t] - update idletasks .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue] + update ; update .tt.t window configure 1.2 -window [frame .tt.t.f -width 10 -height 20 -bg red] - update idletasks list [.t window configure 1.2 -window] [.tt.t window configure 1.2 -window] } -cleanup { destroy .tt .t @@ -1543,28 +1541,34 @@ test textWind-17.9 {peer widget window configuration} -setup { test textWind-17.10 {peer widget window configuration} -setup { destroy .t .tt } -body { + set res {} pack [text .t] - update idletasks .t delete 1.0 end .t insert 1.0 "Some sample text" toplevel .tt pack [.t peer create .tt.t] update idletasks .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue] + update idletasks + # There should be a window in the main widget but not in the peer. + lappend res [.t window configure 1.2 -window] + lappend res [.tt.t window configure 1.2 -window] .tt.t window create 1.2 -window [frame .tt.t.f -width 25 -height 20 -bg blue] update idletasks - .t window configure 1.2 -create \ - {destroy %W.f ; frame %W.f -width 50 -height 7 -bg red} - .tt.t window configure 1.2 -window {} + .t window configure 1.2 -create {destroy %W.f ; frame %W.f -width 50 -height 7 -bg red} + update idletasks + # The main widget should not have changed. + lappend res [.t window configure 1.2 -window] .t window configure 1.2 -window {} - set res [list [.t window configure 1.2 -window] \ - [.tt.t window configure 1.2 -window]] + .tt.t window configure 1.2 -window {} update idletasks - lappend res [.t window configure 1.2 -window] \ - [.tt.t window configure 1.2 -window] + # Nothing should have changed. + lappend res [.t window configure 1.2 -window] + lappend res [.tt.t window configure 1.2 -window] } -cleanup { destroy .tt .t -} -result {{-window {} {} {} {}} {-window {} {} {} {}} {-window {} {} {} .t.f} {-window {} {} {} .tt.t.f}} +} -result {{-window {} {} {} .t.f} {-window {} {} {} {}} {-window {} {} {} .t.f}\ +{-window {} {} {} .t.f} {-window {} {} {} .tt.t.f}} test textWind-18.1 {embedded window deletion triggered by a script bound to } -setup { catch {destroy .t .f .f2} -- cgit v0.12 From 6fd4f7c98005a936911716e9a595df8a6e93739e Mon Sep 17 00:00:00 2001 From: culler Date: Wed, 28 Apr 2021 04:10:45 +0000 Subject: Remove extra release of CGContext --- macosx/tkMacOSXImage.c | 1 - 1 file changed, 1 deletion(-) diff --git a/macosx/tkMacOSXImage.c b/macosx/tkMacOSXImage.c index 6f55171..de19f2b 100644 --- a/macosx/tkMacOSXImage.c +++ b/macosx/tkMacOSXImage.c @@ -535,7 +535,6 @@ CreateCGImageFromDrawableRect( cg_context = TkMacOSXGetCGContextForDrawable(drawable); if (cg_context) { cg_image = CGBitmapContextCreateImage((CGContextRef) cg_context); - CFRelease(cg_context); } } else { NSView *view = TkMacOSXGetNSViewForDrawable(mac_drawable); -- cgit v0.12 From 4d1967bac73880c706d9c1c5b11388e97a695faa Mon Sep 17 00:00:00 2001 From: culler Date: Wed, 28 Apr 2021 15:56:04 +0000 Subject: Deal with new test failures revealed by changing the order of the tests. --- macosx/tkMacOSXWm.c | 9 ++++++++- tests/bind.test | 5 +++++ tests/ttk/spinbox.test | 10 +++++++--- tests/ttk/validate.test | 33 +++++++++++++++++++++------------ 4 files changed, 41 insertions(+), 16 deletions(-) diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 77f7b09..e4f08a6 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -6445,6 +6445,12 @@ TkpWmSetState( macWin = TkMacOSXGetNSWindowForDrawable(winPtr->window); + /* + * Make sure windows are updated before the state change. + */ + + while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)) {}; + if (state == WithdrawnState) { Tk_UnmapWindow((Tk_Window)winPtr); } else if (state == IconicState) { @@ -6465,8 +6471,9 @@ TkpWmSetState( [macWin orderFront:NSApp]; TkMacOSXZoomToplevel(macWin, state == NormalState ? inZoomIn : inZoomOut); } + /* - * Make sure windows are updated after the state change. + * Make sure windows are updated after the state change too. */ while (Tcl_DoOneEvent(TCL_IDLE_EVENTS)){} diff --git a/tests/bind.test b/tests/bind.test index 7a075fe..f653f3e 100644 --- a/tests/bind.test +++ b/tests/bind.test @@ -1052,6 +1052,7 @@ test bind-13.45 {Tk_BindEvent procedure: error in script} -setup { test bind-15.1 {MatchPatterns procedure, ignoring type mismatches} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f + update idletasks focus -force .t.f update } -body { @@ -1068,6 +1069,7 @@ test bind-15.1 {MatchPatterns procedure, ignoring type mismatches} -setup { test bind-15.2 {MatchPatterns procedure, ignoring type mismatches} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f + update idletasks focus -force .t.f update } -body { @@ -1479,6 +1481,7 @@ test bind-15.26 {MatchPatterns procedure, reject a virtual event} -setup { test bind-15.27 {MatchPatterns procedure, conflict resolution} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f + update idletasks focus -force .t.f update } -body { @@ -1493,6 +1496,7 @@ test bind-15.27 {MatchPatterns procedure, conflict resolution} -setup { test bind-15.28 {MatchPatterns procedure, conflict resolution} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f + update idletasks focus -force .t.f update } -body { @@ -1507,6 +1511,7 @@ test bind-15.28 {MatchPatterns procedure, conflict resolution} -setup { test bind-15.29 {MatchPatterns procedure, conflict resolution} -setup { frame .t.f -class Test -width 150 -height 100 pack .t.f + update idletasks focus -force .t.f update } -body { diff --git a/tests/ttk/spinbox.test b/tests/ttk/spinbox.test index cd3b2ce..8656d9d 100644 --- a/tests/ttk/spinbox.test +++ b/tests/ttk/spinbox.test @@ -138,14 +138,18 @@ test spinbox-1.8.3 "option -validate" -setup { } -returnCodes error -result {bad validate "bogus": must be all, key, focus, focusin, focusout, or none} test spinbox-1.8.4 "-validate option: " -setup { - set ::spinbox_test {} ttk::spinbox .sb -from 0 -to 100 + set ::spinbox_test {} } -body { - .sb configure -validate all -validatecommand {lappend ::spinbox_test %P} + .sb configure -validate all -validatecommand {set ::spinbox_test %P} pack .sb + update idletasks .sb set 50 focus -force .sb - after 500 {set ::spinbox_wait 1} ; vwait ::spinbox_wait + set ::spinbox_wait 0 + set timer [after 100 {set ::spinbox_wait 1}] + vwait ::spinbox_wait + after cancel $timer set ::spinbox_test } -cleanup { destroy .sb diff --git a/tests/ttk/validate.test b/tests/ttk/validate.test index 5430903..61e7c2c 100644 --- a/tests/ttk/validate.test +++ b/tests/ttk/validate.test @@ -78,54 +78,63 @@ test validate-1.7 {entry widget validation - vmode focus} -body { } -result {} test validate-1.8 {entry widget validation - vmode focus} -body { + set ::vVals {} + set timer [after 300 lappend ::vVals timeout] focus -force .e - # update necessary to process FocusIn event - update + vwait ::vVals + after cancel $timer set ::vVals } -result {.e -1 -1 abcd abcd {} focus focusin} test validate-1.9 {entry widget validation - vmode focus} -body { + set ::vVals {} + set timer [after 300 lappend ::vVals timeout] focus -force . - # update necessary to process FocusOut event - update + vwait ::vVals + after cancel $timer set ::vVals } -result {.e -1 -1 abcd abcd {} focus focusout} .e configure -validate all test validate-1.10 {entry widget validation - vmode all} -body { + set ::vVals {} + set timer [after 300 lappend ::vVals timeout] focus -force .e - # update necessary to process FocusIn event - update + vwait ::vVals + after cancel $timer set ::vVals } -result {.e -1 -1 abcd abcd {} all focusin} test validate-1.11 {entry widget validation} -body { + set ::vVals {} + set timer [after 300 lappend ::vVals timeout] focus -force . - # update necessary to process FocusOut event - update + vwait ::vVals + after cancel $timer set ::vVals } -result {.e -1 -1 abcd abcd {} all focusout} .e configure -validate focusin test validate-1.12 {entry widget validation} -body { + set ::vVals {} + set timer [after 300 lappend ::vVals timeout] focus -force .e - # update necessary to process FocusIn event - update + vwait ::vVals + after cancel $timer set ::vVals } -result {.e -1 -1 abcd abcd {} focusin focusin} test validate-1.13 {entry widget validation} -body { set ::vVals {} focus -force . - # update necessary to process FocusOut event update set ::vVals } -result {} .e configure -validate focuso test validate-1.14 {entry widget validation} -body { + set ::vVals {} focus -force .e - # update necessary to process FocusIn event update set ::vVals } -result {} -- cgit v0.12 From 18c3f4d712b9916fd2746ba7060593e8b01f8e87 Mon Sep 17 00:00:00 2001 From: culler Date: Thu, 29 Apr 2021 14:40:13 +0000 Subject: Synchonize the needsDisplay for the NSView and its backing layer. --- macosx/tkMacOSXNotify.c | 1 + macosx/tkMacOSXWindowEvent.c | 1 + 2 files changed, 2 insertions(+) diff --git a/macosx/tkMacOSXNotify.c b/macosx/tkMacOSXNotify.c index 0438525..208d846 100644 --- a/macosx/tkMacOSXNotify.c +++ b/macosx/tkMacOSXNotify.c @@ -379,6 +379,7 @@ TkMacOSXDrawAllViews( continue; } [[view layer] setNeedsDisplayInRect:[view tkDirtyRect]]; + [view setNeedsDisplay:YES]; } } else { [window displayIfNeeded]; diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index fe8a983..f7a160a 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -954,6 +954,7 @@ ConfigureRestrictProc( _tkDirtyRect = NSUnionRect(_tkDirtyRect, rect); [NSApp setNeedsToDraw:YES]; [self setNeedsDisplay:YES]; + [[self layer] setNeedsDisplay]; } - (void) clearTkDirtyRect -- cgit v0.12 From 5d7033d0846109740b2bff177df2ff01a1e655ca Mon Sep 17 00:00:00 2001 From: marc_culler Date: Thu, 29 Apr 2021 16:24:46 +0000 Subject: Add a call to [window display] after creating a new window. This makes the tests work in High Sierra. --- macosx/tkMacOSXWm.c | 1 + tests/entry.test | 454 ++++++++++++++++++++++++++-------------------------- tests/scale.test | 9 +- 3 files changed, 234 insertions(+), 230 deletions(-) diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index e4f08a6..e039072 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -6274,6 +6274,7 @@ TkMacOSXMakeRealWindowExist( Tk_ChangeWindowAttributes((Tk_Window)winPtr, CWOverrideRedirect, &atts); ApplyContainerOverrideChanges(winPtr, NULL); } + [window display]; } /* diff --git a/tests/entry.test b/tests/entry.test index a72d36a..d67980a 100644 --- a/tests/entry.test +++ b/tests/entry.test @@ -47,7 +47,7 @@ set cy [font metrics {Courier -12} -linespace] test entry-1.1 {configuration option: "background" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -background #ff0000 @@ -57,7 +57,7 @@ test entry-1.1 {configuration option: "background" for entry} -setup { } -result {#ff0000} test entry-1.2 {configuration option: "background" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -background non-existent @@ -67,7 +67,7 @@ test entry-1.2 {configuration option: "background" for entry} -setup { test entry-1.3 {configuration option: "bd" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -bd 4 @@ -77,7 +77,7 @@ test entry-1.3 {configuration option: "bd" for entry} -setup { } -result 4 test entry-1.4 {configuration option: "bd" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -bd badValue @@ -87,7 +87,7 @@ test entry-1.4 {configuration option: "bd" for entry} -setup { test entry-1.5 {configuration option: "bg" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -bg #ff0000 @@ -97,7 +97,7 @@ test entry-1.5 {configuration option: "bg" for entry} -setup { } -result {#ff0000} test entry-1.6 {configuration option: "bg" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -bg non-existent @@ -107,7 +107,7 @@ test entry-1.6 {configuration option: "bg" for entry} -setup { test entry-1.7 {configuration option: "borderwidth" for entry} -setup { entry .e -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -borderwidth 1.3 @@ -117,7 +117,7 @@ test entry-1.7 {configuration option: "borderwidth" for entry} -setup { } -result 1 test entry-1.8 {configuration option: "borderwidth" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -borderwidth badValue @@ -127,7 +127,7 @@ test entry-1.8 {configuration option: "borderwidth" for entry} -setup { test entry-1.9 {configuration option: "cursor" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -cursor arrow @@ -137,7 +137,7 @@ test entry-1.9 {configuration option: "cursor" for entry} -setup { } -result {arrow} test entry-1.10 {configuration option: "cursor" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -cursor badValue @@ -147,7 +147,7 @@ test entry-1.10 {configuration option: "cursor" for entry} -setup { test entry-1.11 {configuration option: "disabledbackground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -disabledbackground green @@ -157,7 +157,7 @@ test entry-1.11 {configuration option: "disabledbackground" for entry} -setup { } -result {green} test entry-1.12 {configuration option: "disabledbackground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -disabledbackground non-existent @@ -167,7 +167,7 @@ test entry-1.12 {configuration option: "disabledbackground" for entry} -setup { test entry-1.13 {configuration option: "disabledforeground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -disabledforeground blue @@ -177,7 +177,7 @@ test entry-1.13 {configuration option: "disabledforeground" for entry} -setup { } -result {blue} test entry-1.14 {configuration option: "disabledforeground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -disabledforeground non-existent @@ -187,7 +187,7 @@ test entry-1.14 {configuration option: "disabledforeground" for entry} -setup { test entry-1.15 {configuration option: "exportselection" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -exportselection yes @@ -197,7 +197,7 @@ test entry-1.15 {configuration option: "exportselection" for entry} -setup { } -result 1 test entry-1.16 {configuration option: "exportselection" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -exportselection xyzzy @@ -207,7 +207,7 @@ test entry-1.16 {configuration option: "exportselection" for entry} -setup { test entry-1.17 {configuration option: "fg" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -fg #110022 @@ -217,7 +217,7 @@ test entry-1.17 {configuration option: "fg" for entry} -setup { } -result {#110022} test entry-1.18 {configuration option: "fg" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -fg non-existent @@ -227,7 +227,7 @@ test entry-1.18 {configuration option: "fg" for entry} -setup { test entry-1.19 {configuration option: "font" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { .e configure -font {Helvetica -12} @@ -237,7 +237,7 @@ test entry-1.19 {configuration option: "font" for entry} -setup { } -result {Helvetica -12} test entry-1.20 {configuration option: "font" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { .e configure -font {} @@ -247,7 +247,7 @@ test entry-1.20 {configuration option: "font" for entry} -setup { test entry-1.21 {configuration option: "foreground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -foreground #110022 @@ -257,7 +257,7 @@ test entry-1.21 {configuration option: "foreground" for entry} -setup { } -result {#110022} test entry-1.22 {configuration option: "foreground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -foreground non-existent @@ -267,7 +267,7 @@ test entry-1.22 {configuration option: "foreground" for entry} -setup { test entry-1.23 {configuration option: "highlightbackground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -highlightbackground #110022 @@ -277,7 +277,7 @@ test entry-1.23 {configuration option: "highlightbackground" for entry} -setup { } -result {#110022} test entry-1.24 {configuration option: "highlightbackground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -highlightbackground non-existent @@ -287,7 +287,7 @@ test entry-1.24 {configuration option: "highlightbackground" for entry} -setup { test entry-1.25 {configuration option: "highlightcolor" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -highlightcolor #110022 @@ -297,7 +297,7 @@ test entry-1.25 {configuration option: "highlightcolor" for entry} -setup { } -result {#110022} test entry-1.26 {configuration option: "highlightcolor" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -highlightcolor non-existent @@ -307,7 +307,7 @@ test entry-1.26 {configuration option: "highlightcolor" for entry} -setup { test entry-1.27 {configuration option: "highlightthickness" for entry} -setup { entry .e -borderwidth 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -highlightthickness 6 @@ -317,7 +317,7 @@ test entry-1.27 {configuration option: "highlightthickness" for entry} -setup { } -result 6 test entry-1.28 {configuration option: "highlightthickness" for entry} -setup { entry .e -borderwidth 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -highlightthickness -2 @@ -327,7 +327,7 @@ test entry-1.28 {configuration option: "highlightthickness" for entry} -setup { } -result 0 test entry-1.29 {configuration option: "highlightthickness" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -highlightthickness badValue @@ -337,7 +337,7 @@ test entry-1.29 {configuration option: "highlightthickness" for entry} -setup { test entry-1.30 {configuration option: "insertbackground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -insertbackground #110022 @@ -347,7 +347,7 @@ test entry-1.30 {configuration option: "insertbackground" for entry} -setup { } -result {#110022} test entry-1.31 {configuration option: "insertbackground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -insertbackground non-existent @@ -357,7 +357,7 @@ test entry-1.31 {configuration option: "insertbackground" for entry} -setup { test entry-1.32 {configuration option: "insertborderwidth" for entry} -setup { entry .e -borderwidth 2 -insertwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -insertborderwidth 1.3 @@ -367,7 +367,7 @@ test entry-1.32 {configuration option: "insertborderwidth" for entry} -setup { } -result 1 test entry-1.33 {configuration option: "insertborderwidth" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -insertborderwidth 2.6x @@ -377,7 +377,7 @@ test entry-1.33 {configuration option: "insertborderwidth" for entry} -setup { test entry-1.34 {configuration option: "insertofftime" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -insertofftime 100 @@ -387,7 +387,7 @@ test entry-1.34 {configuration option: "insertofftime" for entry} -setup { } -result 100 test entry-1.35 {configuration option: "insertofftime" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -insertofftime 3.2 @@ -397,7 +397,7 @@ test entry-1.35 {configuration option: "insertofftime" for entry} -setup { test entry-1.36 {configuration option: "insertontime" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -insertontime 100 @@ -407,7 +407,7 @@ test entry-1.36 {configuration option: "insertontime" for entry} -setup { } -result 100 test entry-1.37 {configuration option: "insertontime" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -insertontime 3.2 @@ -417,7 +417,7 @@ test entry-1.37 {configuration option: "insertontime" for entry} -setup { test entry-1.38 {configuration option: "invalidcommand" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -invalidcommand "any string" @@ -428,7 +428,7 @@ test entry-1.38 {configuration option: "invalidcommand" for entry} -setup { test entry-1.39 {configuration option: "invcmd" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -invcmd "any string" @@ -439,7 +439,7 @@ test entry-1.39 {configuration option: "invcmd" for entry} -setup { test entry-1.40 {configuration option: "justify" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -justify right @@ -449,7 +449,7 @@ test entry-1.40 {configuration option: "justify" for entry} -setup { } -result {right} test entry-1.41 {configuration option: "justify" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -justify bogus @@ -459,7 +459,7 @@ test entry-1.41 {configuration option: "justify" for entry} -setup { test entry-1.42 {configuration option: "readonlybackground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -readonlybackground green @@ -469,7 +469,7 @@ test entry-1.42 {configuration option: "readonlybackground" for entry} -setup { } -result {green} test entry-1.43 {configuration option: "readonlybackground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -readonlybackground non-existent @@ -479,7 +479,7 @@ test entry-1.43 {configuration option: "readonlybackground" for entry} -setup { test entry-1.44 {configuration option: "relief" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -relief flat @@ -490,7 +490,7 @@ test entry-1.44 {configuration option: "relief" for entry} -setup { test entry-1.45 {configuration option: "selectbackground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -selectbackground #110022 @@ -500,7 +500,7 @@ test entry-1.45 {configuration option: "selectbackground" for entry} -setup { } -result {#110022} test entry-1.46 {configuration option: "selectbackground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -selectbackground non-existent @@ -510,7 +510,7 @@ test entry-1.46 {configuration option: "selectbackground" for entry} -setup { test entry-1.47 {configuration option: "selectborderwidth" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -selectborderwidth 1.3 @@ -520,7 +520,7 @@ test entry-1.47 {configuration option: "selectborderwidth" for entry} -setup { } -result 1 test entry-1.48 {configuration option: "selectborderwidth" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -selectborderwidth badValue @@ -530,7 +530,7 @@ test entry-1.48 {configuration option: "selectborderwidth" for entry} -setup { test entry-1.49 {configuration option: "selectforeground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -selectforeground #110022 @@ -540,7 +540,7 @@ test entry-1.49 {configuration option: "selectforeground" for entry} -setup { } -result {#110022} test entry-1.50 {configuration option: "selectforeground" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -selectforeground non-existent @@ -550,7 +550,7 @@ test entry-1.50 {configuration option: "selectforeground" for entry} -setup { test entry-1.51 {configuration option: "show" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -show * @@ -561,7 +561,7 @@ test entry-1.51 {configuration option: "show" for entry} -setup { test entry-1.52 {configuration option: "state" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -state n @@ -571,7 +571,7 @@ test entry-1.52 {configuration option: "state" for entry} -setup { } -result {normal} test entry-1.53 {configuration option: "state" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -state bogus @@ -581,7 +581,7 @@ test entry-1.53 {configuration option: "state" for entry} -setup { test entry-1.54 {configuration option: "takefocus" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -takefocus "any string" @@ -592,7 +592,7 @@ test entry-1.54 {configuration option: "takefocus" for entry} -setup { test entry-1.55 {configuration option: "textvariable" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -textvariable i @@ -603,7 +603,7 @@ test entry-1.55 {configuration option: "textvariable" for entry} -setup { test entry-1.56 {configuration option: "width" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -width 402 @@ -613,7 +613,7 @@ test entry-1.56 {configuration option: "width" for entry} -setup { } -result 402 test entry-1.57 {configuration option: "width" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -width 3p @@ -623,7 +623,7 @@ test entry-1.57 {configuration option: "width" for entry} -setup { test entry-1.58 {configuration option: "xscrollcommand" for entry} -setup { entry .e -borderwidth 2 -highlightthickness 2 -font {Helvetica -12 bold} - pack .e + pack .e ; update idletasks update } -body { .e configure -xscrollcommand {Some command} @@ -642,7 +642,7 @@ test entry-2.2 {Tk_EntryCmd procedure} -body { } -returnCodes error -result {bad window path name "gorp"} test entry-2.3 {Tk_EntryCmd procedure} -body { entry .e - pack .e + pack .e ; update idletasks update list [winfo exists .e] [winfo class .e] [info commands .e] } -cleanup { @@ -668,7 +668,7 @@ test entry-2.5 {Tk_EntryCmd procedure} -body { test entry-3.1 {EntryWidgetCmd procedure} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e @@ -677,7 +677,7 @@ test entry-3.1 {EntryWidgetCmd procedure} -setup { } -returnCodes error -result {wrong # args: should be ".e option ?arg ...?"} test entry-3.2 {EntryWidgetCmd procedure, "bbox" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { .e bbox @@ -686,7 +686,7 @@ test entry-3.2 {EntryWidgetCmd procedure, "bbox" widget command} -setup { } -returnCodes error -result {wrong # args: should be ".e bbox index"} test entry-3.3 {EntryWidgetCmd procedure, "bbox" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { .e bbox a b @@ -695,7 +695,7 @@ test entry-3.3 {EntryWidgetCmd procedure, "bbox" widget command} -setup { } -returnCodes error -result {wrong # args: should be ".e bbox index"} test entry-3.4 {EntryWidgetCmd procedure, "bbox" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e bbox bogus @@ -704,7 +704,7 @@ test entry-3.4 {EntryWidgetCmd procedure, "bbox" widget command} -setup { } -returnCodes error -result {bad entry index "bogus"} test entry-3.5 {EntryWidgetCmd procedure, "bbox" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { .e bbox 0 @@ -719,7 +719,7 @@ test entry-3.6 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { fonts } -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { # Tcl_UtfAtIndex(): no utf chars @@ -732,7 +732,7 @@ test entry-3.7 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { fonts } -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { # Tcl_UtfAtIndex(): utf at end @@ -745,7 +745,7 @@ test entry-3.8 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { fonts } -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { # Tcl_UtfAtIndex(): utf before index @@ -756,7 +756,7 @@ test entry-3.8 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { } -result {31 5 7 13} test entry-3.9 {EntryWidgetCmd procedure, "bbox" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { # Tcl_UtfAtIndex(): no chars @@ -768,7 +768,7 @@ test entry-3.10 {EntryWidgetCmd procedure, "bbox" widget command} -constraints { fonts } -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { .e insert 0 "abcdefghij\u4e4eklmnop" @@ -807,7 +807,7 @@ test entry-3.14 {EntryWidgetCmd procedure, "cget" widget command} -setup { } -result 4 test entry-3.15 {EntryWidgetCmd procedure, "configure" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { llength [.e configure] @@ -860,7 +860,7 @@ test entry-3.21 {EntryWidgetCmd procedure, "delete" widget command} -setup { } -returnCodes error -result {bad entry index "bar"} test entry-3.22 {EntryWidgetCmd procedure, "delete" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e insert end "01234567890" @@ -880,7 +880,7 @@ test entry-3.23 {EntryWidgetCmd procedure, "delete" widget command} -setup { } -result 0123457890 test entry-3.24 {EntryWidgetCmd procedure, "delete" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update set x {} } -body { @@ -901,7 +901,7 @@ test entry-3.24 {EntryWidgetCmd procedure, "delete" widget command} -setup { } -result [list "01234\u4e4e7890" "0123457890" "012345\u4e4e890"] test entry-3.25 {EntryWidgetCmd procedure, "delete" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e insert end "01234567890" @@ -912,7 +912,7 @@ test entry-3.25 {EntryWidgetCmd procedure, "delete" widget command} -setup { } -result 01234567890 test entry-3.26 {EntryWidgetCmd procedure, "delete" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e insert end "01234567890" @@ -925,7 +925,7 @@ test entry-3.26 {EntryWidgetCmd procedure, "delete" widget command} -setup { } -result 01234567890 test entry-3.26a {EntryWidgetCmd procedure, "delete" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e insert end "01234567890" @@ -989,7 +989,7 @@ test entry-3.33 {EntryWidgetCmd procedure, "index" widget command} -setup { } -returnCodes error -result {bad entry index "foo"} test entry-3.34 {EntryWidgetCmd procedure, "index" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e index 0 @@ -998,7 +998,7 @@ test entry-3.34 {EntryWidgetCmd procedure, "index" widget command} -setup { } -returnCodes {ok} -match glob -result {*} test entry-3.35 {EntryWidgetCmd procedure, "index" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { # UTF @@ -1030,7 +1030,7 @@ test entry-3.38 {EntryWidgetCmd procedure, "insert" widget command} -setup { } -returnCodes error -result {bad entry index "foo"} test entry-3.39 {EntryWidgetCmd procedure, "insert" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e insert end "01234567890" @@ -1041,7 +1041,7 @@ test entry-3.39 {EntryWidgetCmd procedure, "insert" widget command} -setup { } -result {012xxx34567890} test entry-3.40 {EntryWidgetCmd procedure, "insert" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e insert end "01234567890" @@ -1054,7 +1054,7 @@ test entry-3.40 {EntryWidgetCmd procedure, "insert" widget command} -setup { } -result 01234567890 test entry-3.40a {EntryWidgetCmd procedure, "insert" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e insert end "01234567890" @@ -1074,7 +1074,7 @@ test entry-3.41 {EntryWidgetCmd procedure, "insert" widget command} -setup { } -returnCodes error -result {wrong # args: should be ".e insert index text"} test entry-3.42 {EntryWidgetCmd procedure, "scan" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e scan a @@ -1083,7 +1083,7 @@ test entry-3.42 {EntryWidgetCmd procedure, "scan" widget command} -setup { } -returnCodes error -result {wrong # args: should be ".e scan mark|dragto x"} test entry-3.43 {EntryWidgetCmd procedure, "scan" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e scan a b c @@ -1092,7 +1092,7 @@ test entry-3.43 {EntryWidgetCmd procedure, "scan" widget command} -setup { } -returnCodes error -result {wrong # args: should be ".e scan mark|dragto x"} test entry-3.44 {EntryWidgetCmd procedure, "scan" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e scan foobar 20 @@ -1101,7 +1101,7 @@ test entry-3.44 {EntryWidgetCmd procedure, "scan" widget command} -setup { } -returnCodes error -result {bad scan option "foobar": must be mark or dragto} test entry-3.45 {EntryWidgetCmd procedure, "scan" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e scan mark 20.1 @@ -1114,7 +1114,7 @@ test entry-3.46 {EntryWidgetCmd procedure, "scan" widget command} -constraints { fonts } -setup { entry .e -font {Helvetica -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { .e insert end "This is quite a long string, in fact a " @@ -1161,7 +1161,7 @@ test entry-3.50 {EntryWidgetCmd procedure, "select clear" widget command} -setup } -returnCodes error -result {PRIMARY selection doesn't exist or form "STRING" not defined} test entry-3.50.1 {EntryWidgetCmd procedure, "select clear" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e insert end "0123456789" @@ -1184,7 +1184,7 @@ test entry-3.51 {EntryWidgetCmd procedure, "selection present" widget command} - } -returnCodes error -result {wrong # args: should be ".e selection present"} test entry-3.52 {EntryWidgetCmd procedure, "selection present" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e insert end 0123456789 @@ -1196,7 +1196,7 @@ test entry-3.52 {EntryWidgetCmd procedure, "selection present" widget command} - } -result 1 test entry-3.53 {EntryWidgetCmd procedure, "selection present" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e insert end 0123456789 @@ -1209,7 +1209,7 @@ test entry-3.53 {EntryWidgetCmd procedure, "selection present" widget command} - } -result 1 test entry-3.54 {EntryWidgetCmd procedure, "selection present" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e insert end 0123456789 @@ -1236,7 +1236,7 @@ test entry-3.56 {EntryWidgetCmd procedure, "selection adjust" widget command} -s } -returnCodes error -result {wrong # args: should be ".e selection adjust index"} test entry-3.57 {EntryWidgetCmd procedure, "selection adjust" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e insert end "0123456789" @@ -1250,7 +1250,7 @@ test entry-3.57 {EntryWidgetCmd procedure, "selection adjust" widget command} -s } -result 123 test entry-3.58 {EntryWidgetCmd procedure, "selection adjust" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e insert end "0123456789" @@ -1297,7 +1297,7 @@ test entry-3.62 {EntryWidgetCmd procedure, "selection range" widget command} -se } -returnCodes error -result {selection isn't in widget .e} test entry-3.63 {EntryWidgetCmd procedure, "selection range" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e insert end 0123456789 @@ -1310,7 +1310,7 @@ test entry-3.63 {EntryWidgetCmd procedure, "selection range" widget command} -se } -result {2 9 3} test entry-3.64 {EntryWidgetCmd procedure, "selection" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e insert end 0123456789 @@ -1324,7 +1324,7 @@ test entry-3.64 {EntryWidgetCmd procedure, "selection" widget command} -setup { } -result {0 10} test entry-3.64a {EntryWidgetCmd procedure, "selection" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e insert end 0123456789 @@ -1338,7 +1338,7 @@ test entry-3.64a {EntryWidgetCmd procedure, "selection" widget command} -setup { } -result {2 4} test entry-3.64b {EntryWidgetCmd procedure, "selection to" widget command} -setup { entry .e - pack .e + pack .e ; update idletasks update .e insert end "This is quite a long text string, so long that it " .e insert end "runs off the end of the window quite a bit." @@ -1350,7 +1350,7 @@ test entry-3.64b {EntryWidgetCmd procedure, "selection to" widget command} -setu test entry-3.65 {EntryWidgetCmd procedure, "xview" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { .e insert end "This is quite a long text string, so long that it " @@ -1362,7 +1362,7 @@ test entry-3.65 {EntryWidgetCmd procedure, "xview" widget command} -setup { } -result {0.0537634 0.2688172} test entry-3.66 {EntryWidgetCmd procedure, "xview" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { .e xview gorp @@ -1371,7 +1371,7 @@ test entry-3.66 {EntryWidgetCmd procedure, "xview" widget command} -setup { } -returnCodes error -result {bad entry index "gorp"} test entry-3.67 {EntryWidgetCmd procedure, "xview" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { .e insert end "This is quite a long text string, so long that it " @@ -1385,7 +1385,7 @@ test entry-3.67 {EntryWidgetCmd procedure, "xview" widget command} -setup { } -result {0.107527 0.322581} test entry-3.68 {EntryWidgetCmd procedure, "xview" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { .e xview moveto foo bar @@ -1394,7 +1394,7 @@ test entry-3.68 {EntryWidgetCmd procedure, "xview" widget command} -setup { } -returnCodes error -result {wrong # args: should be ".e xview moveto fraction"} test entry-3.69 {EntryWidgetCmd procedure, "xview" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { .e xview moveto foo @@ -1403,7 +1403,7 @@ test entry-3.69 {EntryWidgetCmd procedure, "xview" widget command} -setup { } -returnCodes error -result {expected floating-point number but got "foo"} test entry-3.70 {EntryWidgetCmd procedure, "xview" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { .e insert end "This is quite a long text string, so long that it " @@ -1415,7 +1415,7 @@ test entry-3.70 {EntryWidgetCmd procedure, "xview" widget command} -setup { } -result {0.505376 0.720430} test entry-3.71 {EntryWidgetCmd procedure, "xview" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { .e insert end "This is quite a long text string, so long that it " @@ -1426,7 +1426,7 @@ test entry-3.71 {EntryWidgetCmd procedure, "xview" widget command} -setup { } -returnCodes error -result {wrong # args: should be ".e xview scroll number units|pages"} test entry-3.72 {EntryWidgetCmd procedure, "xview" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { .e insert end "This is quite a long text string, so long that it " .e insert end "runs off the end of the window quite a bit." @@ -1437,7 +1437,7 @@ test entry-3.72 {EntryWidgetCmd procedure, "xview" widget command} -setup { } -returnCodes error -result {expected integer but got "gorp"} test entry-3.73 {EntryWidgetCmd procedure, "xview" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { .e insert end "This is quite a long text string, so long that it " .e insert end "runs off the end of the window quite a bit." @@ -1450,7 +1450,7 @@ test entry-3.73 {EntryWidgetCmd procedure, "xview" widget command} -setup { } -result {0.193548 0.408602} test entry-3.74 {EntryWidgetCmd procedure, "xview" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { .e insert end "This is quite a long text string, so long that it " @@ -1464,7 +1464,7 @@ test entry-3.74 {EntryWidgetCmd procedure, "xview" widget command} -setup { } -result {0.397849 0.612903} test entry-3.75 {EntryWidgetCmd procedure, "xview" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { .e insert end "This is quite a long text string, so long that it " .e insert end "runs off the end of the window quite a bit." @@ -1478,7 +1478,7 @@ test entry-3.75 {EntryWidgetCmd procedure, "xview" widget command} -setup { } -result 32 test entry-3.76 {EntryWidgetCmd procedure, "xview" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { .e insert end "This is quite a long text string, so long that it " .e insert end "runs off the end of the window quite a bit." @@ -1492,7 +1492,7 @@ test entry-3.76 {EntryWidgetCmd procedure, "xview" widget command} -setup { } -result 29 test entry-3.77 {EntryWidgetCmd procedure, "xview" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { .e insert end "This is quite a long text string, so long that it " .e insert end "runs off the end of the window quite a bit." @@ -1503,7 +1503,7 @@ test entry-3.77 {EntryWidgetCmd procedure, "xview" widget command} -setup { } -returnCodes error -result {bad argument "foobars": must be units or pages} test entry-3.78 {EntryWidgetCmd procedure, "xview" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { .e insert end "This is quite a long text string, so long that it " .e insert end "runs off the end of the window quite a bit." @@ -1514,7 +1514,7 @@ test entry-3.78 {EntryWidgetCmd procedure, "xview" widget command} -setup { } -returnCodes error -result {unknown option "eat": must be moveto or scroll} test entry-3.79 {EntryWidgetCmd procedure, "xview" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { .e insert end "This is quite a long text string, so long that it " @@ -1528,7 +1528,7 @@ test entry-3.79 {EntryWidgetCmd procedure, "xview" widget command} -setup { } -result 0 test entry-3.80 {EntryWidgetCmd procedure, "xview" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { .e insert end "This is quite a long text string, so long that it " .e insert end "runs off the end of the window quite a bit." @@ -1540,7 +1540,7 @@ test entry-3.80 {EntryWidgetCmd procedure, "xview" widget command} -setup { } -result 73 test entry-3.86 {EntryWidgetCmd procedure, "xview" widget command} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { .e insert end "This is quite a long text string, so long that it " .e insert end "runs off the end of the window quite a bit." @@ -1562,7 +1562,7 @@ test entry-3.86 {EntryWidgetCmd procedure, "xview" widget command} -setup { test entry-3.82 {EntryWidgetCmd procedure} -setup { entry .e -font {Courier -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks update } -body { .e gorp @@ -1576,7 +1576,7 @@ test entry-3.82 {EntryWidgetCmd procedure} -setup { test entry-4.1 {DestroyEntry procedure} -body { entry .e -textvariable x -show * - pack .e + pack .e ; update idletasks .e insert end "Sample text" update destroy .e @@ -1631,7 +1631,7 @@ test entry-5.5 {ConfigureEntry procedure} -setup { .e2 insert end "This is some sample text" .e1 configure -exportselection false .e1 insert end "0123456789" - pack .e1 .e2 + pack .e1 .e2 ; update idletasks .e2 select from 0 .e2 select to 10 lappend x [selection get] @@ -1646,7 +1646,7 @@ test entry-5.5 {ConfigureEntry procedure} -setup { } -result {{This is so} {This is so} 1234} test entry-5.6 {ConfigureEntry procedure} -setup { entry .e - pack .e + pack .e ; update idletasks } -body { .e insert end "0123456789" .e select from 1 @@ -1658,7 +1658,7 @@ test entry-5.6 {ConfigureEntry procedure} -setup { } -returnCodes error -result {PRIMARY selection doesn't exist or form "STRING" not defined} test entry-5.6.1 {ConfigureEntry procedure} -setup { entry .e - pack .e + pack .e ; update idletasks } -body { .e insert end "0123456789" .e select from 1 @@ -1672,7 +1672,7 @@ test entry-5.6.1 {ConfigureEntry procedure} -setup { test entry-5.7 {ConfigureEntry procedure} -setup { entry .e -font {Helvetica -12} -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { .e configure -font {Courier -12} -width 4 -xscrollcommand scroll .e insert end "01234567890" @@ -1691,7 +1691,7 @@ test entry-5.8 {ConfigureEntry procedure} -constraints { fonts failsOnXQuarz } -setup { entry .e -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { .e configure -width 0 -font {Helvetica -12} .e insert end "0123" @@ -1706,7 +1706,7 @@ test entry-5.9 {ConfigureEntry procedure} -constraints { fonts } -setup { entry .e -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { .e configure -font {Courier -12} -bd 2 -relief raised .e insert end "0123" @@ -1719,7 +1719,7 @@ test entry-5.10 {ConfigureEntry procedure} -constraints { fonts } -setup { entry .e -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { .e configure -font {Courier -12} -bd 2 -relief flat .e insert end "0123" @@ -1730,7 +1730,7 @@ test entry-5.10 {ConfigureEntry procedure} -constraints { } -result {0 0 1 1} test entry-5.11 {ConfigureEntry procedure} -setup { entry .e -borderwidth 2 -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { # If "0" in selected font had 0 width, caused divide-by-zero error. .e configure -font {{open look glyph}} @@ -1746,7 +1746,7 @@ test entry-6.1 {EntryComputeGeometry procedure} -constraints { fonts } -setup { entry .e - pack .e + pack .e ; update idletasks } -body { .e configure -font {Courier -12} -bd 2 -relief raised -width 20 \ -highlightthickness 3 @@ -1760,7 +1760,7 @@ test entry-6.2 {EntryComputeGeometry procedure} -constraints { fonts } -setup { entry .e - pack .e + pack .e ; update idletasks } -body { .e configure -font {Courier -12} -bd 2 -relief raised -width 20 \ -justify center -highlightthickness 3 @@ -1774,7 +1774,7 @@ test entry-6.3 {EntryComputeGeometry procedure} -constraints { fonts } -setup { entry .e - pack .e + pack .e ; update idletasks } -body { .e configure -font {Courier -12} -bd 2 -relief raised -width 20 \ -justify right -highlightthickness 3 @@ -1786,7 +1786,7 @@ test entry-6.3 {EntryComputeGeometry procedure} -constraints { } -result {3 4} test entry-6.4 {EntryComputeGeometry procedure} -setup { entry .e - pack .e + pack .e ; update idletasks } -body { .e configure -font {Courier -12} -bd 2 -relief raised -width 5 .e insert end "01234567890" @@ -1798,7 +1798,7 @@ test entry-6.4 {EntryComputeGeometry procedure} -setup { } -result 6 test entry-6.5 {EntryComputeGeometry procedure} -setup { entry .e -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { .e configure -font {Courier -12} -bd 2 -relief raised -width 5 .e insert end "01234567890" @@ -1812,7 +1812,7 @@ test entry-6.6 {EntryComputeGeometry procedure} -constraints { fonts } -setup { entry .e -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { .e configure -font {Courier -12} -bd 2 -relief raised -width 10 .e insert end "01234\t67890" @@ -1826,7 +1826,7 @@ test entry-6.7 {EntryComputeGeometry procedure} -constraints { fonts } -setup { entry .e -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { .e configure -font {Helvetica -24} -bd 3 -relief raised -width 5 .e insert end "01234567" @@ -1839,7 +1839,7 @@ test entry-6.8 {EntryComputeGeometry procedure} -constraints { fonts } -setup { entry .e -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { .e configure -font {Helvetica -24} -bd 3 -relief raised -width 0 .e insert end "01234567" @@ -1852,7 +1852,7 @@ test entry-6.9 {EntryComputeGeometry procedure} -constraints { fonts } -setup { entry .e -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { .e configure -font {Helvetica -24} -bd 3 -relief raised -width 0 update @@ -1864,7 +1864,7 @@ test entry-6.10 {EntryComputeGeometry procedure} -constraints { unix fonts } -setup { entry .e -highlightthickness 2 -font {Helvetica -12} - pack .e + pack .e ; update idletasks } -body { .e configure -bd 1 -relief raised -width 0 -show . .e insert 0 12345 @@ -1881,7 +1881,7 @@ test entry-6.11 {EntryComputeGeometry procedure} -constraints { win } -setup { entry .e -highlightthickness 2 - pack .e + pack .e ; update idletasks } -body { .e configure -bd 1 -relief raised -width 0 -show . -font {helvetica 12} .e insert 0 12345 @@ -1905,7 +1905,7 @@ test entry-6.12 {EntryComputeGeometry procedure} -constraints { } -setup { catch {destroy .e} entry .e -font {Courier -12} -bd 2 -relief raised -width 20 - pack .e + pack .e ; update idletasks } -body { .e insert end "012\t456\t" update @@ -1918,7 +1918,7 @@ test entry-6.12 {EntryComputeGeometry procedure} -constraints { test entry-7.1 {InsertChars procedure} -setup { unset -nocomplain contents entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll @@ -1935,7 +1935,7 @@ test entry-7.1 {InsertChars procedure} -setup { test entry-7.2 {InsertChars procedure} -setup { unset -nocomplain contents entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll @@ -1950,7 +1950,7 @@ test entry-7.2 {InsertChars procedure} -setup { } -result {abcdeXXX abcdeXXX {0.000000 1.000000}} test entry-7.3 {InsertChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks } -body { .e insert 0 0123456789 .e select from 2 @@ -1964,7 +1964,7 @@ test entry-7.3 {InsertChars procedure} -setup { } -result {5 9 5 8} test entry-7.4 {InsertChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks } -body { .e insert 0 0123456789 .e select from 2 @@ -1978,7 +1978,7 @@ test entry-7.4 {InsertChars procedure} -setup { } -result {2 9 2 8} test entry-7.5 {InsertChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks } -body { .e insert 0 0123456789 .e select from 2 @@ -1992,7 +1992,7 @@ test entry-7.5 {InsertChars procedure} -setup { } -result {2 9 2 8} test entry-7.6 {InsertChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks } -body { .e insert 0 0123456789 .e select from 2 @@ -2006,7 +2006,7 @@ test entry-7.6 {InsertChars procedure} -setup { } -result {2 6 2 5} test entry-7.7 {InsertChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks } -body { .e configure -xscrollcommand scroll .e insert 0 0123456789 @@ -2018,7 +2018,7 @@ test entry-7.7 {InsertChars procedure} -setup { } -result 7 test entry-7.8 {InsertChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks } -body { .e insert 0 0123456789 .e icursor 4 @@ -2029,7 +2029,7 @@ test entry-7.8 {InsertChars procedure} -setup { } -result 4 test entry-7.9 {InsertChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks } -body { .e insert 0 "This is a very long string" update @@ -2041,7 +2041,7 @@ test entry-7.9 {InsertChars procedure} -setup { } -result 7 test entry-7.10 {InsertChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks } -body { .e insert 0 "This is a very long string" update @@ -2056,7 +2056,7 @@ test entry-7.11 {InsertChars procedure} -constraints { fonts } -setup { entry .e -width 0 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks } -body { .e insert 0 "xyzzy" update @@ -2069,7 +2069,7 @@ test entry-7.11 {InsertChars procedure} -constraints { test entry-8.1 {DeleteChars procedure} -setup { unset -nocomplain contents entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll @@ -2085,7 +2085,7 @@ test entry-8.1 {DeleteChars procedure} -setup { test entry-8.2 {DeleteChars procedure} -setup { unset -nocomplain contents entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll @@ -2101,7 +2101,7 @@ test entry-8.2 {DeleteChars procedure} -setup { test entry-8.3 {DeleteChars procedure} -setup { unset -nocomplain contents entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e configure -textvariable contents -xscrollcommand scroll @@ -2116,7 +2116,7 @@ test entry-8.3 {DeleteChars procedure} -setup { } -result {abc abc {0.000000 1.000000}} test entry-8.4 {DeleteChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e insert 0 0123456789abcde @@ -2132,7 +2132,7 @@ test entry-8.4 {DeleteChars procedure} -setup { } -result {1 6 1 5} test entry-8.5 {DeleteChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e insert 0 0123456789abcde @@ -2148,7 +2148,7 @@ test entry-8.5 {DeleteChars procedure} -setup { } -result {1 5 1 4} test entry-8.6 {DeleteChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e insert 0 0123456789abcde @@ -2164,7 +2164,7 @@ test entry-8.6 {DeleteChars procedure} -setup { } -result {1 2 1 5} test entry-8.7 {DeleteChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e insert 0 0123456789abcde @@ -2178,7 +2178,7 @@ test entry-8.7 {DeleteChars procedure} -setup { } -returnCodes error -result {selection isn't in widget .e} test entry-8.8 {DeleteChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e insert 0 0123456789abcde @@ -2194,7 +2194,7 @@ test entry-8.8 {DeleteChars procedure} -setup { } -result {3 4 3 8} test entry-8.9 {DeleteChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks } -body { .e insert 0 0123456789abcde .e select from 3 @@ -2207,7 +2207,7 @@ test entry-8.9 {DeleteChars procedure} -setup { } -returnCodes error -result {selection isn't in widget .e} test entry-8.10 {DeleteChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e insert 0 0123456789abcde @@ -2223,7 +2223,7 @@ test entry-8.10 {DeleteChars procedure} -setup { } -result {3 5 5 8} test entry-8.11 {DeleteChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e insert 0 0123456789abcde @@ -2239,7 +2239,7 @@ test entry-8.11 {DeleteChars procedure} -setup { } -result {3 8 4 8} test entry-8.12 {DeleteChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e insert 0 0123456789abcde @@ -2252,7 +2252,7 @@ test entry-8.12 {DeleteChars procedure} -setup { } -result 1 test entry-8.13 {DeleteChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e insert 0 0123456789abcde @@ -2265,7 +2265,7 @@ test entry-8.13 {DeleteChars procedure} -setup { } -result 1 test entry-8.14 {DeleteChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e insert 0 0123456789abcde @@ -2278,7 +2278,7 @@ test entry-8.14 {DeleteChars procedure} -setup { } -result 4 test entry-8.15 {DeleteChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e insert 0 "This is a very long string" @@ -2291,7 +2291,7 @@ test entry-8.15 {DeleteChars procedure} -setup { } -result 1 test entry-8.16 {DeleteChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e insert 0 "This is a very long string" @@ -2304,7 +2304,7 @@ test entry-8.16 {DeleteChars procedure} -setup { } -result 1 test entry-8.17 {DeleteChars procedure} -setup { entry .e -width 10 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e insert 0 "This is a very long string" @@ -2317,7 +2317,7 @@ test entry-8.17 {DeleteChars procedure} -setup { } -result 4 test entry-8.18 {DeleteChars procedure} -constraints failsOnUbuntuNoXft -setup { entry .e -width 0 -font {Courier -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks focus .e } -body { .e insert 0 "xyzzy" @@ -2346,7 +2346,7 @@ test entry-10.1 {EntrySetValue procedure} -constraints fonts -body { set x abcde set y ab entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2 -width 0 - pack .e + pack .e ; update idletasks .e configure -textvariable x .e configure -textvariable y update @@ -2357,7 +2357,7 @@ test entry-10.1 {EntrySetValue procedure} -constraints fonts -body { test entry-10.2 {EntrySetValue procedure, updating selection} -setup { unset -nocomplain x entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks } -body { .e configure -textvariable x .e insert 0 "abcdefghjklmnopqrstu" @@ -2370,7 +2370,7 @@ test entry-10.2 {EntrySetValue procedure, updating selection} -setup { test entry-10.3 {EntrySetValue procedure, updating selection} -setup { unset -nocomplain x entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks } -body { .e configure -textvariable x .e insert 0 "abcdefghjklmnopqrstu" @@ -2383,7 +2383,7 @@ test entry-10.3 {EntrySetValue procedure, updating selection} -setup { test entry-10.4 {EntrySetValue procedure, updating selection} -setup { unset -nocomplain x entry .e -font {Helvetica -12} -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks } -body { .e configure -textvariable x .e insert 0 "abcdefghjklmnopqrstu" @@ -2396,7 +2396,7 @@ test entry-10.4 {EntrySetValue procedure, updating selection} -setup { test entry-10.5 {EntrySetValue procedure, updating display position} -setup { unset -nocomplain x entry .e -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks } -body { .e configure -width 10 -font {Courier -12} -textvariable x .e insert 0 "abcdefghjklmnopqrstuvwxyz" @@ -2411,10 +2411,10 @@ test entry-10.5 {EntrySetValue procedure, updating display position} -setup { test entry-10.6 {EntrySetValue procedure, updating display position} -setup { unset -nocomplain x entry .e -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks } -body { .e configure -width 10 -font {Courier -12} -textvariable x - pack .e + pack .e ; update idletasks .e insert 0 "abcdefghjklmnopqrstuvwxyz" .e xview 10 update @@ -2427,11 +2427,11 @@ test entry-10.6 {EntrySetValue procedure, updating display position} -setup { test entry-10.7 {EntrySetValue procedure, updating insertion cursor} -setup { unset -nocomplain x entry .e -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks update } -body { .e configure -width 10 -font {Courier -12} -textvariable x - pack .e + pack .e ; update idletasks .e insert 0 "abcdefghjklmnopqrstuvwxyz" .e icursor 5 set x "123" @@ -2442,10 +2442,10 @@ test entry-10.7 {EntrySetValue procedure, updating insertion cursor} -setup { test entry-10.8 {EntrySetValue procedure, updating insertion cursor} -setup { unset -nocomplain x entry .e -highlightthickness 2 -bd 2 - pack .e + pack .e ; update idletasks } -body { .e configure -width 10 -font {Courier -12} -textvariable x - pack .e + pack .e ; update idletasks .e insert 0 "abcdefghjklmnopqrstuvwxyz" .e icursor 5 set x "123456" @@ -2456,7 +2456,7 @@ test entry-10.8 {EntrySetValue procedure, updating insertion cursor} -setup { test entry-11.1 {EntryEventProc procedure} -setup { entry .e -highlightthickness 2 -bd 2 -font {Helvetica -12} - pack .e + pack .e ; update idletasks } -body { .e insert 0 abcdefg destroy .e @@ -2488,7 +2488,7 @@ test entry-12.1 {EntryCmdDeletedProc procedure} -body { test entry-13.1 {GetEntryIndex procedure} -setup { entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e + pack .e ; update idletasks } -body { .e insert 0 012345678901234567890 .e xview 4 @@ -2505,7 +2505,7 @@ test entry-13.2 {GetEntryIndex procedure} -body { } -returnCodes error -result {bad entry index "abogus"} test entry-13.3 {GetEntryIndex procedure} -setup { entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e + pack .e ; update idletasks } -body { .e insert 0 012345678901234567890 .e xview 4 @@ -2518,7 +2518,7 @@ test entry-13.3 {GetEntryIndex procedure} -setup { } -result 1 test entry-13.4 {GetEntryIndex procedure} -setup { entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e + pack .e ; update idletasks } -body { .e insert 0 012345678901234567890 .e xview 4 @@ -2531,7 +2531,7 @@ test entry-13.4 {GetEntryIndex procedure} -setup { } -result 4 test entry-13.5 {GetEntryIndex procedure} -setup { entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e + pack .e ; update idletasks } -body { .e insert 0 012345678901234567890 .e xview 4 @@ -2552,7 +2552,7 @@ test entry-13.6 {GetEntryIndex procedure} -setup { } -returnCodes error -result {bad entry index "ebogus"} test entry-13.7 {GetEntryIndex procedure} -setup { entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e + pack .e ; update idletasks } -body { .e insert 0 012345678901234567890 .e xview 4 @@ -2571,7 +2571,7 @@ test entry-13.8 {GetEntryIndex procedure} -setup { } -returnCodes error -result {bad entry index "ibogus"} test entry-13.9 {GetEntryIndex procedure} -setup { entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e + pack .e ; update idletasks } -body { .e insert 0 012345678901234567890 .e xview 4 @@ -2593,7 +2593,7 @@ test entry-13.10 {GetEntryIndex procedure} -constraints x11 -body { # selection range is reset. # Previous settings: entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e + pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 update @@ -2613,7 +2613,7 @@ test entry-13.11 {GetEntryIndex procedure} -constraints aquaOrWin32 -body { # entry, the old range will be rehighlighted. # Previous settings: entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e + pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 update @@ -2631,7 +2631,7 @@ test entry-13.11 {GetEntryIndex procedure} -constraints aquaOrWin32 -body { test entry-13.12 {GetEntryIndex procedure} -constraints x11 -body { # Previous settings: entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e + pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 update @@ -2650,7 +2650,7 @@ test entry-13.12 {GetEntryIndex procedure} -constraints x11 -body { test entry-13.12.1 {GetEntryIndex procedure} -constraints unix -body { # Previous settings: entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e + pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 update @@ -2667,7 +2667,7 @@ test entry-13.12.1 {GetEntryIndex procedure} -constraints unix -body { test entry-13.13 {GetEntryIndex procedure} -constraints win -body { # Previous settings: entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e + pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 update @@ -2687,7 +2687,7 @@ test entry-13.14 {GetEntryIndex procedure} -constraints win -body { # entry, the old range will be rehighlighted. # Previous settings: entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e + pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 update @@ -2707,7 +2707,7 @@ test entry-13.14.1 {GetEntryIndex procedure} -constraints win -body { # entry, the old range will be rehighlighted. # Previous settings: entry .e -font {Courier -12} -width 5 -bd 2 -relief sunken - pack .e + pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 update @@ -2733,7 +2733,7 @@ test entry-13.15 {GetEntryIndex procedure} -body { test entry-13.16 {GetEntryIndex procedure} -constraints fonts -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ -font {Courier -12} - pack .e + pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 update @@ -2744,7 +2744,7 @@ test entry-13.16 {GetEntryIndex procedure} -constraints fonts -body { test entry-13.17 {GetEntryIndex procedure} -constraints fonts -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ -font {Courier -12} - pack .e + pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 update @@ -2755,7 +2755,7 @@ test entry-13.17 {GetEntryIndex procedure} -constraints fonts -body { test entry-13.18 {GetEntryIndex procedure} -constraints fonts -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ -font {Courier -12} - pack .e + pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 update @@ -2766,7 +2766,7 @@ test entry-13.18 {GetEntryIndex procedure} -constraints fonts -body { test entry-13.19 {GetEntryIndex procedure} -constraints fonts -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ -font {Courier -12} - pack .e + pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 update @@ -2777,7 +2777,7 @@ test entry-13.19 {GetEntryIndex procedure} -constraints fonts -body { test entry-13.20 {GetEntryIndex procedure} -constraints fonts -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ -font {Courier -12} - pack .e + pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 update @@ -2788,7 +2788,7 @@ test entry-13.20 {GetEntryIndex procedure} -constraints fonts -body { test entry-13.21 {GetEntryIndex procedure} -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ -font {Courier -12} - pack .e + pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 update @@ -2798,7 +2798,7 @@ test entry-13.21 {GetEntryIndex procedure} -body { } -result 9 test entry-13.22 {GetEntryIndex procedure} -setup { entry .e - pack .e + pack .e ; update idletasks update } -body { .e index 1xyz @@ -2808,7 +2808,7 @@ test entry-13.22 {GetEntryIndex procedure} -setup { test entry-13.23 {GetEntryIndex procedure} -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ -font {Courier -12} - pack .e + pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 update @@ -2819,7 +2819,7 @@ test entry-13.23 {GetEntryIndex procedure} -body { test entry-13.24 {GetEntryIndex procedure} -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ -font {Courier -12} - pack .e + pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 update @@ -2830,7 +2830,7 @@ test entry-13.24 {GetEntryIndex procedure} -body { test entry-13.25 {GetEntryIndex procedure} -body { entry .e -width 5 -relief sunken -highlightthickness 2 -bd 2\ -font {Courier -12} - pack .e + pack .e ; update idletasks .e insert 0 012345678901234567890 .e xview 4 update @@ -2843,7 +2843,7 @@ test entry-13.26 {GetEntryIndex procedure} -constraints fonts -body { selection clear .e .e configure -show . .e insert 0 XXXYZZY - pack .e + pack .e ; update idletasks update list [.e index @7] [.e index @8] } -cleanup { @@ -2903,7 +2903,7 @@ test entry-15.1 {EntryLostSelection} -body { # is scrollcommand needed here?? test entry-16.1 {EntryVisibleRange procedure} -constraints fonts -body { entry .e -width 10 -font {Helvetica -12} - pack .e + pack .e ; update idletasks update .e insert 0 "............................." format {%.6f %.6f} {*}[.e xview] @@ -2914,7 +2914,7 @@ test entry-16.2 {EntryVisibleRange procedure} -constraints { unix fonts } -body { entry .e -show X -width 10 -font {Helvetica -12} - pack .e + pack .e ; update idletasks update .e insert 0 "............................." format {%.6f %.6f} {*}[.e xview] @@ -2925,7 +2925,7 @@ test entry-16.3 {EntryVisibleRange procedure} -constraints { win } -body { entry .e -show . -width 10 -font {Helvetica -12} - pack .e + pack .e ; update idletasks update .e insert 0 XXXXXXXXXXXXXXXXXXXXXXXXXXXXX format {%.6f %.6f} {*}[.e xview] @@ -2942,7 +2942,7 @@ test entry-16.4 {EntryVisibleRange procedure} -body { test entry-17.1 {EntryUpdateScrollbar procedure} -body { entry .e -width 10 -xscrollcommand scroll -font {Courier -12} - pack .e + pack .e ; update idletasks update idletasks set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] .e delete 0 end @@ -2955,7 +2955,7 @@ test entry-17.1 {EntryUpdateScrollbar procedure} -body { } -result {0.000000 1.000000} test entry-17.2 {EntryUpdateScrollbar procedure} -body { entry .e -width 10 -xscrollcommand scroll -font {Courier -12} - pack .e + pack .e ; update idletasks set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] .e insert 0 0123456789abcdef .e xview 3 @@ -2967,7 +2967,7 @@ test entry-17.2 {EntryUpdateScrollbar procedure} -body { } -result {0.187500 0.812500} test entry-17.3 {EntryUpdateScrollbar procedure} -body { entry .e -width 10 -xscrollcommand scroll -font {Courier -12} - pack .e + pack .e ; update idletasks update idletasks set timeout [after 500 {set scrollInfo {-1000000 -1000000}}] .e insert 0 abcdefghijklmnopqrs @@ -2985,7 +2985,7 @@ test entry-17.4 {EntryUpdateScrollbar procedure} -setup { } } -body { entry .e -width 5 - pack .e + pack .e ; update idletasks update idletasks .e configure -xscrollcommand thisisnotacommand vwait x @@ -3028,7 +3028,7 @@ test entry-19.1 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks .e insert 0 a set ::vVals } -cleanup { @@ -3043,7 +3043,7 @@ test entry-19.2 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks .e insert 0 a ;# previous settings .e insert 1 b return $::vVals @@ -3059,7 +3059,7 @@ test entry-19.3 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks .e insert 0 ab ;# previous settings .e insert end c set ::vVals @@ -3075,7 +3075,7 @@ test entry-19.4 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks .e insert 0 abc ;# previous settings .e insert 1 123 list $::vVals $::e @@ -3091,7 +3091,7 @@ test entry-19.5 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks .e insert 0 a123bc ;# previous settings .e delete 2 set ::vVals @@ -3107,7 +3107,7 @@ test entry-19.6 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks .e insert 0 a13bc ;# previous settings .e configure -validate key .e delete 1 3 @@ -3124,7 +3124,7 @@ test entry-19.7 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks .e insert end abc ;# previous settings set ::vVals {} .e insert end d @@ -3141,7 +3141,7 @@ test entry-19.8 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks .e configure -validate focus ;# previous settings .e insert end abcd ;# previous settings focus -force .e @@ -3160,7 +3160,7 @@ test entry-19.9 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks .e insert end abcd ;# previous settings focus -force .e ;# previous settings update ;# previous settings @@ -3181,7 +3181,7 @@ test entry-19.10 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks .e insert end abcd ;# previous settings focus -force .e # update necessary to process FocusIn event @@ -3199,7 +3199,7 @@ test entry-19.11 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks .e insert end abcd ;# previous settings focus -force .e ;# previous settings # update necessary to process FocusIn event @@ -3220,7 +3220,7 @@ test entry-19.12 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks .e insert 0 abcd ;# previous settings focus -force .e # update necessary to process FocusIn event @@ -3238,7 +3238,7 @@ test entry-19.13 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks .e insert end abcd ;# previous settings set ::vVals {} focus -force . @@ -3257,7 +3257,7 @@ test entry-19.14 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks .e insert end abcd ;# previous settings set ::vVals {} ;# previous settings focus -force .e @@ -3276,7 +3276,7 @@ test entry-19.15 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks .e insert end abcd ;# previous settings set ::vVals {} ;# previous settings focus -force .e ;# previous settings @@ -3299,7 +3299,7 @@ test entry-19.16 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks .e insert end abcd ;# previous settings set ::vVals {} ;# previous settings focus -force .e ;# previous settings @@ -3322,7 +3322,7 @@ test entry-19.17 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks .e insert end abcd ;# previous settings set ::e newdata list [.e cget -validate] $::vVals @@ -3340,7 +3340,7 @@ test entry-19.18 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks set ::e newdata ;# previous settings .e configure -validate all set ::e nextdata @@ -3360,7 +3360,7 @@ test entry-19.19 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks set ::e nextdata ;# previous settings .e configure -validatecommand [list doval2 %W %d %i %P %s %S %v %V] @@ -3383,7 +3383,7 @@ test entry-19.20 {entry widget validation} -setup { -invalidcommand bell \ -textvariable ::e \ -background red -foreground white - pack .e + pack .e ; update idletasks set ::e nextdata ;# previous settings .e configure -validatecommand [list doval2 %W %d %i %P %s %S %v %V] ;# prev .e validate ;# previous settings @@ -3406,7 +3406,7 @@ test entry-19.21 {entry widget validation - bug 40e4bf6198} -setup { entry .e -validate key \ -validatecommand [list doval2 %W %d %i %P %s %S %v %V] \ -textvariable ::e - pack .e + pack .e ; update idletasks set ::e origdata .e insert 0 A list [.e cget -validate] [.e get] $::e $::vVals diff --git a/tests/scale.test b/tests/scale.test index d7f3a75..6e62710 100644 --- a/tests/scale.test +++ b/tests/scale.test @@ -1473,17 +1473,18 @@ test scale-20.3 {Bug [2262543fff] - Scale widget unexpectedly fires command call test scale-20.4 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 4} -setup { catch {destroy .s} set res {} - set commandedVar -1 } -body { scale .s -from 1 -to 50 -command {set commandedVar} - .s set 10 pack .s + update idletasks + .s set 10 set timeout [after 500 {set $commandedVar "timeout"}] + set commandedVar -1 vwait commandedVar ; # -command callback shall fire set res [list [.s get] $commandedVar] } -cleanup { - destroy .s after cancel $timeout + destroy .s } -result {10 10} test scale-20.5 {Bug [2262543fff] - Scale widget unexpectedly fires command callback, case 5} -setup { catch {destroy .s} @@ -1492,6 +1493,7 @@ test scale-20.5 {Bug [2262543fff] - Scale widget unexpectedly fires command call } -body { scale .s -from 1 -to 50 pack .s + update idletasks .s set 10 .s configure -command {set commandedVar} update ; # -command callback shall NOT fire @@ -1506,6 +1508,7 @@ test scale-20.6 {Bug [2262543fff] - Scale widget unexpectedly fires command call } -body { scale .s -from 1 -to 50 pack .s + update idletasks .s configure -command {set commandedVar} .s set 10 set timeout [after 500 {set $commandedVar "timeout"}] -- cgit v0.12 From a3be6c56b7742a8c7f8b8f3c193ae6304e2a2cb2 Mon Sep 17 00:00:00 2001 From: culler Date: Thu, 29 Apr 2021 21:53:18 +0000 Subject: =?UTF-8?q?Fix=20textWind.test=20=C3=A0=20la=20Fran=C3=A7ois=20Vog?= =?UTF-8?q?el?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/textWind.test | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/textWind.test b/tests/textWind.test index 1329790..5b99126 100644 --- a/tests/textWind.test +++ b/tests/textWind.test @@ -1406,7 +1406,7 @@ test textWind-17.1 {peer widgets and embedded windows} -setup { .t window create 1.3 -window .f toplevel .tt pack [.t peer create .tt.t] - update ; update + update destroy .t .tt winfo exists .f } -result {0} @@ -1420,7 +1420,7 @@ test textWind-17.2 {peer widgets and embedded windows} -setup { .t window create 1.4 -window .f toplevel .tt pack [.t peer create .tt.t] - update ; update + update destroy .t .tt.t insert 1.0 "foo" update @@ -1435,7 +1435,7 @@ test textWind-17.3 {peer widget and -create} -setup { .t insert 1.0 "Some sample text" toplevel .tt pack [.t peer create .tt.t] - update ; update + update .t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue} update destroy .t .tt @@ -1451,7 +1451,7 @@ test textWind-17.4 {peer widget deleted one window shouldn't delete others} -set toplevel .tt pack [.t peer create .tt.t] .t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue} - update ; update + update destroy .tt lappend res [.t get 1.2] update @@ -1469,7 +1469,7 @@ test textWind-17.5 {peer widget window configuration} -setup { toplevel .tt pack [.t peer create .tt.t] .t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue} - update ; update + update list [.t window cget 1.2 -window] [.tt.t window cget 1.2 -window] } -cleanup { destroy .tt .t @@ -1484,7 +1484,7 @@ test textWind-17.6 {peer widget window configuration} -setup { toplevel .tt pack [.t peer create .tt.t] .t window create 1.2 -create {frame %W.f -width 10 -height 20 -bg blue} - update ; update + update list [.t window configure 1.2 -window] \ [.tt.t window configure 1.2 -window] } -cleanup { @@ -1500,7 +1500,7 @@ test textWind-17.7 {peer widget window configuration} -setup { toplevel .tt pack [.t peer create .tt.t] .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue] - update ; update + update list [.t window cget 1.2 -window] [.tt.t window cget 1.2 -window] } -cleanup { destroy .tt .t @@ -1515,7 +1515,7 @@ test textWind-17.8 {peer widget window configuration} -setup { toplevel .tt pack [.t peer create .tt.t] .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue] - update ; update + update list [.t window configure 1.2 -window] \ [.tt.t window configure 1.2 -window] } -cleanup { @@ -1531,7 +1531,7 @@ test textWind-17.9 {peer widget window configuration} -setup { toplevel .tt pack [.t peer create .tt.t] .t window create 1.2 -window [frame .t.f -width 10 -height 20 -bg blue] - update ; update + update .tt.t window configure 1.2 -window [frame .tt.t.f -width 10 -height 20 -bg red] list [.t window configure 1.2 -window] [.tt.t window configure 1.2 -window] } -cleanup { @@ -1561,7 +1561,7 @@ test textWind-17.10 {peer widget window configuration} -setup { lappend res [.t window configure 1.2 -window] .t window configure 1.2 -window {} .tt.t window configure 1.2 -window {} - update idletasks + update # Nothing should have changed. lappend res [.t window configure 1.2 -window] lappend res [.tt.t window configure 1.2 -window] -- cgit v0.12