From a416d2e8f5cf471d4aaa92c75ca81150dba384c3 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Thu, 16 Nov 2023 13:57:27 +0000 Subject: Remove legacy "pack" and "scrollbar" syntax --- doc/scrollbar.n | 40 --- generic/tkPack.c | 343 ---------------------- generic/tkScrollbar.c | 58 ---- generic/tkScrollbar.h | 19 -- macosx/Tk.xcodeproj/project.pbxproj | 2 - tests/oldpack.test | 558 ------------------------------------ 6 files changed, 1020 deletions(-) delete mode 100644 tests/oldpack.test diff --git a/doc/scrollbar.n b/doc/scrollbar.n index 4f808f4..838dac1 100644 --- a/doc/scrollbar.n +++ b/doc/scrollbar.n @@ -236,46 +236,6 @@ the top or left of the window, or \-1, which means that one unit should scroll off the bottom or right of the window. Fractional numbers are rounded away from 0, so scrolling 0.001 units has the same effect as scrolling 1 unit. -.SH "OLD COMMAND SYNTAX" -.PP -In versions of Tk before 4.0, the \fBset\fR and \fBget\fR widget -commands used a different form. -This form is still supported for backward compatibility, but it -is deprecated. -In the old command syntax, the \fBset\fR widget command has the -following form: -.TP -\fIpathName \fBset \fItotalUnits windowUnits firstUnit lastUnit\fR -In this form the arguments are all integers. -\fITotalUnits\fR gives the total size of the object being displayed in the -associated widget. The meaning of one unit depends on the associated -widget; for example, in a text editor widget units might -correspond to lines of -text. \fIWindowUnits\fR indicates the total number of units that -can fit in the associated window at one time. \fIFirstUnit\fR -and \fIlastUnit\fR give the indices of the first and last units -currently visible in the associated window (zero corresponds to the -first unit of the object). -.LP -Under the old syntax the \fBget\fR widget command returns a list -of four integers, consisting of the \fItotalUnits\fR, \fIwindowUnits\fR, -\fIfirstUnit\fR, and \fIlastUnit\fR values from the last \fBset\fR -widget command. -.PP -The commands generated by scrollbars also have a different form -when the old syntax is being used: -.TP -\fIprefix\fR \fIunit\fR -\fIUnit\fR is an integer that indicates what should appear at -the top or left of the associated widget's window. -It has the same meaning as the \fIfirstUnit\fR and \fIlastUnit\fR -arguments to the \fBset\fR widget command. -.LP -The most recent \fBset\fR widget command determines whether or not -to use the old syntax. -If it is given two real arguments then the new syntax will be -used in the future, and if it is given four integer arguments then -the old syntax will be used. .SH BINDINGS .PP Tk automatically creates class bindings for scrollbars that give them diff --git a/generic/tkPack.c b/generic/tkPack.c index 8dc6284..baf2a70 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.c @@ -122,10 +122,6 @@ static int ConfigureContent(Tcl_Interp *interp, Tk_Window tkwin, int objc, Tcl_Obj *const objv[]); static Tcl_FreeProc DestroyPacker; static Packer * GetPacker(Tk_Window tkwin); -#ifndef TK_NO_DEPRECATED -static int PackAfter(Tcl_Interp *interp, Packer *prevPtr, - Packer *containerPtr, int objc,Tcl_Obj *const objv[]); -#endif /* !TK_NO_DEPRECATED */ static void PackStructureProc(void *clientData, XEvent *eventPtr); static void Unlink(Packer *packPtr); @@ -199,16 +195,10 @@ Tk_PackObjCmd( Tk_Window tkwin = (Tk_Window)clientData; const char *argv2; static const char *const optionStrings[] = { -#ifndef TK_NO_DEPRECATED - "after", "append", "before", "unpack", -#endif /* !TK_NO_DEPRECATED */ "configure", "content", "forget", "info", "propagate", "slaves", NULL }; static const char *const optionStringsNoDep[] = { "configure", "content", "forget", "info", "propagate", NULL }; enum options { -#ifndef TK_NO_DEPRECATED - PACK_AFTER, PACK_APPEND, PACK_BEFORE, PACK_UNPACK, -#endif /* !TK_NO_DEPRECATED */ PACK_CONFIGURE, PACK_CONTENT, PACK_FORGET, PACK_INFO, PACK_PROPAGATE, PACK_SLAVES }; int index; @@ -239,72 +229,6 @@ Tk_PackObjCmd( argv2 = Tcl_GetString(objv[2]); switch ((enum options) index) { -#ifndef TK_NO_DEPRECATED - case PACK_AFTER: { - Packer *prevPtr; - Tk_Window tkwin2; - - if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { - return TCL_ERROR; - } - prevPtr = GetPacker(tkwin2); - if (prevPtr->containerPtr == NULL) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "window \"%s\" isn't packed", argv2)); - Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", NULL); - return TCL_ERROR; - } - return PackAfter(interp, prevPtr, prevPtr->containerPtr, objc-3, objv+3); - } - case PACK_APPEND: { - Packer *containerPtr; - Packer *prevPtr; - Tk_Window tkwin2; - - if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { - return TCL_ERROR; - } - containerPtr = GetPacker(tkwin2); - prevPtr = containerPtr->contentPtr; - if (prevPtr != NULL) { - while (prevPtr->nextPtr != NULL) { - prevPtr = prevPtr->nextPtr; - } - } - return PackAfter(interp, prevPtr, containerPtr, objc-3, objv+3); - } - case PACK_BEFORE: { - Packer *packPtr, *containerPtr; - Packer *prevPtr; - Tk_Window tkwin2; - - if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { - return TCL_ERROR; - } - packPtr = GetPacker(tkwin2); - if (packPtr->containerPtr == NULL) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "window \"%s\" isn't packed", argv2)); - Tcl_SetErrorCode(interp, "TK", "PACK", "NOT_PACKED", NULL); - return TCL_ERROR; - } - containerPtr = packPtr->containerPtr; - prevPtr = containerPtr->contentPtr; - if (prevPtr == packPtr) { - prevPtr = NULL; - } else { - for ( ; ; prevPtr = prevPtr->nextPtr) { - if (prevPtr == NULL) { - Tcl_Panic("\"pack before\" couldn't find predecessor"); - } - if (prevPtr->nextPtr == packPtr) { - break; - } - } - } - return PackAfter(interp, prevPtr, containerPtr, objc-3, objv+3); - } -#endif /* !TK_NO_DEPRECATED */ case PACK_CONFIGURE: if (argv2[0] != '.') { Tcl_SetObjResult(interp, Tcl_ObjPrintf( @@ -467,31 +391,6 @@ Tk_PackObjCmd( Tcl_SetObjResult(interp, resultObj); break; } -#ifndef TK_NO_DEPRECATED - case PACK_UNPACK: { - Tk_Window tkwin2; - Packer *packPtr; - - if (objc != 3) { - Tcl_WrongNumArgs(interp, 2, objv, "window"); - return TCL_ERROR; - } - if (TkGetWindowFromObj(interp, tkwin, objv[2], &tkwin2) != TCL_OK) { - return TCL_ERROR; - } - packPtr = GetPacker(tkwin2); - if ((packPtr != NULL) && (packPtr->containerPtr != NULL)) { - Tk_ManageGeometry(tkwin2, NULL, NULL); - if (packPtr->containerPtr->tkwin != Tk_Parent(packPtr->tkwin)) { - Tk_UnmaintainGeometry(packPtr->tkwin, - packPtr->containerPtr->tkwin); - } - Unlink(packPtr); - Tk_UnmapWindow(packPtr->tkwin); - } - break; - } -#endif /* !TK_NO_DEPRECATED */ } return TCL_OK; @@ -1078,248 +977,6 @@ GetPacker( } /* - *------------------------------------------------------------------------ - * - * PackAfter -- - * - * This function does most of the real work of adding one or more windows - * into the packing order for its container. - * - * Results: - * A standard Tcl return value. - * - * Side effects: - * The geometry of the specified windows may change, both now and again - * in the future. - * - *------------------------------------------------------------------------ - */ - -#ifndef TK_NO_DEPRECATED -static int -PackAfter( - Tcl_Interp *interp, /* Interpreter for error reporting. */ - Packer *prevPtr, /* Pack windows in argv just after this - * window; NULL means pack as first child of - * containerPtr. */ - Packer *containerPtr, /* Container in which to pack windows. */ - int objc, /* Number of elements in objv. */ - Tcl_Obj *const objv[]) /* Array of lists, each containing 2 elements: - * window name and side against which to - * pack. */ -{ - Packer *packPtr; - Tk_Window tkwin, ancestor, parent; - Tcl_Obj **options; - int c; - Tcl_Size index, optionCount; - - /* - * Iterate over all of the window specifiers, each consisting of two - * arguments. The first argument contains the window name and the - * additional arguments contain options such as "top" or "padx 20". - */ - - for ( ; objc > 0; objc -= 2, objv += 2, prevPtr = packPtr) { - if (objc < 2) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "wrong # args: window \"%s\" should be followed by options", - Tcl_GetString(objv[0]))); - Tcl_SetErrorCode(interp, "TCL", "WRONGARGS", NULL); - return TCL_ERROR; - } - - /* - * Find the packer for the window to be packed, and make sure that the - * window in which it will be packed is either its or a descendant of - * its parent. - */ - - if (TkGetWindowFromObj(interp, containerPtr->tkwin, objv[0], &tkwin) - != TCL_OK) { - return TCL_ERROR; - } - - parent = Tk_Parent(tkwin); - for (ancestor = containerPtr->tkwin; ; ancestor = Tk_Parent(ancestor)) { - if (ancestor == parent) { - break; - } - if (((Tk_FakeWin *) (ancestor))->flags & TK_TOP_HIERARCHY) { - badWindow: - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "can't pack \"%s\" inside \"%s\"", Tcl_GetString(objv[0]), - Tk_PathName(containerPtr->tkwin))); - Tcl_SetErrorCode(interp, "TK", "GEOMETRY", "HIERARCHY", NULL); - return TCL_ERROR; - } - } - if (((Tk_FakeWin *) (tkwin))->flags & TK_TOP_HIERARCHY) { - goto badWindow; - } - if (tkwin == containerPtr->tkwin) { - goto badWindow; - } - packPtr = GetPacker(tkwin); - - /* - * Process options for this window. - */ - - if (Tcl_ListObjGetElements(interp, objv[1], &optionCount, &options) - != TCL_OK) { - return TCL_ERROR; - } - packPtr->side = TOP; - packPtr->anchor = TK_ANCHOR_CENTER; - packPtr->padX = packPtr->padY = 0; - packPtr->padLeft = packPtr->padTop = 0; - packPtr->iPadX = packPtr->iPadY = 0; - packPtr->flags &= ~(FILLX|FILLY|EXPAND); - packPtr->flags |= OLD_STYLE; - for (index = 0 ; index < optionCount; index++) { - Tcl_Obj *curOptPtr = options[index]; - Tcl_Size length; - const char *curOpt = Tcl_GetStringFromObj(curOptPtr, &length); - - c = curOpt[0]; - - if ((c == 't') - && (strncmp(curOpt, "top", length)) == 0) { - packPtr->side = TOP; - } else if ((c == 'b') - && (strncmp(curOpt, "bottom", length)) == 0) { - packPtr->side = BOTTOM; - } else if ((c == 'l') - && (strncmp(curOpt, "left", length)) == 0) { - packPtr->side = LEFT; - } else if ((c == 'r') - && (strncmp(curOpt, "right", length)) == 0) { - packPtr->side = RIGHT; - } else if ((c == 'e') - && (strncmp(curOpt, "expand", length)) == 0) { - packPtr->flags |= EXPAND; - } else if ((c == 'f') - && (strcmp(curOpt, "fill")) == 0) { - packPtr->flags |= FILLX|FILLY; - } else if ((length == 5) && (strcmp(curOpt, "fillx")) == 0) { - packPtr->flags |= FILLX; - } else if ((length == 5) && (strcmp(curOpt, "filly")) == 0) { - packPtr->flags |= FILLY; - } else if ((c == 'p') && (strcmp(curOpt, "padx")) == 0) { - if (optionCount <= (index+1)) { - missingPad: - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "wrong # args: \"%s\" option must be" - " followed by screen distance", curOpt)); - Tcl_SetErrorCode(interp, "TK", "OLDPACK", "BAD_PARAMETER", - NULL); - return TCL_ERROR; - } - if (TkParsePadAmount(interp, tkwin, options[index+1], - &packPtr->padLeft, &packPtr->padX) != TCL_OK) { - return TCL_ERROR; - } - packPtr->padX /= 2; - packPtr->padLeft /= 2; - packPtr->iPadX = 0; - index++; - } else if ((c == 'p') && (strcmp(curOpt, "pady")) == 0) { - if (optionCount <= (index+1)) { - goto missingPad; - } - if (TkParsePadAmount(interp, tkwin, options[index+1], - &packPtr->padTop, &packPtr->padY) != TCL_OK) { - return TCL_ERROR; - } - packPtr->padY /= 2; - packPtr->padTop /= 2; - packPtr->iPadY = 0; - index++; - } else if ((c == 'f') && (length > 1) - && (strncmp(curOpt, "frame", length) == 0)) { - if (optionCount <= (index+1)) { - Tcl_SetObjResult(interp, Tcl_NewStringObj( - "wrong # args: \"frame\"" - " option must be followed by anchor point", TCL_INDEX_NONE)); - Tcl_SetErrorCode(interp, "TK", "OLDPACK", "BAD_PARAMETER", - NULL); - return TCL_ERROR; - } - if (Tk_GetAnchorFromObj(interp, options[index+1], - &packPtr->anchor) != TCL_OK) { - return TCL_ERROR; - } - index++; - } else { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "bad option \"%s\": should be top, bottom, left," - " right, expand, fill, fillx, filly, padx, pady, or" - " frame", curOpt)); - Tcl_SetErrorCode(interp, "TK", "OLDPACK", "BAD_PARAMETER", - NULL); - return TCL_ERROR; - } - } - - if (packPtr != prevPtr) { - /* - * Unpack this window if it's currently packed. - */ - - if (packPtr->containerPtr != NULL) { - if ((packPtr->containerPtr != containerPtr) && - (packPtr->containerPtr->tkwin - != Tk_Parent(packPtr->tkwin))) { - Tk_UnmaintainGeometry(packPtr->tkwin, - packPtr->containerPtr->tkwin); - } - Unlink(packPtr); - } - - /* - * Add the window in the correct place in its container's packing - * order, then make sure that the window is managed by us. - */ - - packPtr->containerPtr = containerPtr; - if (prevPtr == NULL) { - packPtr->nextPtr = containerPtr->contentPtr; - containerPtr->contentPtr = packPtr; - } else { - packPtr->nextPtr = prevPtr->nextPtr; - prevPtr->nextPtr = packPtr; - } - Tk_ManageGeometry(tkwin, &packerType, packPtr); - - if (!(containerPtr->flags & DONT_PROPAGATE)) { - if (TkSetGeometryContainer(interp, containerPtr->tkwin, "pack") - != TCL_OK) { - Tk_ManageGeometry(tkwin, NULL, NULL); - Unlink(packPtr); - return TCL_ERROR; - } - containerPtr->flags |= ALLOCED_CONTAINER; - } - } - } - - /* - * Arrange for the container to be re-packed at the first idle moment. - */ - - if (containerPtr->abortPtr != NULL) { - *containerPtr->abortPtr = 1; - } - if (!(containerPtr->flags & REQUESTED_REPACK)) { - containerPtr->flags |= REQUESTED_REPACK; - Tcl_DoWhenIdle(ArrangePacking, containerPtr); - } - return TCL_OK; -} -#endif /* !TK_NO_DEPRECATED */ - -/* *---------------------------------------------------------------------- * * Unlink -- diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index 4fb8b3c..dbe2c62 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -179,12 +179,6 @@ Tk_ScrollbarObjCmd( scrollPtr->sliderLast = 0; scrollPtr->activeField = 0; scrollPtr->activeRelief = TK_RELIEF_RAISED; -#ifndef TK_NO_DEPRECATED - scrollPtr->totalUnits = 0; - scrollPtr->windowUnits = 0; - scrollPtr->firstUnit = 0; - scrollPtr->lastUnit = 0; -#endif /* TK_NO_DEPRECATED */ scrollPtr->firstFraction = 0.0; scrollPtr->lastFraction = 0.0; scrollPtr->cursor = NULL; @@ -379,16 +373,6 @@ ScrollbarWidgetObjCmd( Tcl_WrongNumArgs(interp, 1, objv, "get"); goto error; } -#ifndef TK_NO_DEPRECATED - if (scrollPtr->flags & OLD_STYLE_COMMANDS) { - resObjs[0] = Tcl_NewWideIntObj(scrollPtr->totalUnits); - resObjs[1] = Tcl_NewWideIntObj(scrollPtr->windowUnits); - resObjs[2] = Tcl_NewWideIntObj(scrollPtr->firstUnit); - resObjs[3] = Tcl_NewWideIntObj(scrollPtr->lastUnit); - Tcl_SetObjResult(interp, Tcl_NewListObj(4, resObjs)); - break; - } -#endif /* TK_NO_DEPRECATED */ resObjs[0] = Tcl_NewDoubleObj(scrollPtr->firstFraction); resObjs[1] = Tcl_NewDoubleObj(scrollPtr->lastFraction); Tcl_SetObjResult(interp, Tcl_NewListObj(2, resObjs)); @@ -440,48 +424,6 @@ ScrollbarWidgetObjCmd( } else { scrollPtr->lastFraction = last; } -#ifndef TK_NO_DEPRECATED - scrollPtr->flags &= ~OLD_STYLE_COMMANDS; - } else if (objc == 6) { - int totalUnits, windowUnits, firstUnit, lastUnit; - if (Tcl_GetIntFromObj(interp, objv[2], &totalUnits) != TCL_OK) { - goto error; - } - if (totalUnits < 0) { - totalUnits = 0; - } - if (Tcl_GetIntFromObj(interp, objv[3], &windowUnits) != TCL_OK) { - goto error; - } - if (windowUnits < 0) { - windowUnits = 0; - } - if (Tcl_GetIntFromObj(interp, objv[4], &firstUnit) != TCL_OK) { - goto error; - } - if (Tcl_GetIntFromObj(interp, objv[5], &lastUnit) != TCL_OK) { - goto error; - } - if (totalUnits > 0) { - if (lastUnit < firstUnit) { - lastUnit = firstUnit; - } - } else { - firstUnit = lastUnit = 0; - } - scrollPtr->totalUnits = totalUnits; - scrollPtr->windowUnits = windowUnits; - scrollPtr->firstUnit = firstUnit; - scrollPtr->lastUnit = lastUnit; - if (scrollPtr->totalUnits == 0) { - scrollPtr->firstFraction = 0.0; - scrollPtr->lastFraction = 1.0; - } else { - scrollPtr->firstFraction = ((double) firstUnit)/totalUnits; - scrollPtr->lastFraction = ((double) (lastUnit+1))/totalUnits; - } - scrollPtr->flags |= OLD_STYLE_COMMANDS; -#endif /* !TK_NO_DEPRECATED */ } else { Tcl_WrongNumArgs(interp, 1, objv, "set firstFraction lastFraction"); goto error; diff --git a/generic/tkScrollbar.h b/generic/tkScrollbar.h index 6912e71..3543d4f 100644 --- a/generic/tkScrollbar.h +++ b/generic/tkScrollbar.h @@ -96,22 +96,6 @@ typedef struct TkScrollbar { * the OLD_STYLE_COMMANDS flag is 1. */ -#ifndef TK_NO_DEPRECATED - int totalUnits; /* Total dimension of application, in units. - * Valid only if the OLD_STYLE_COMMANDS flag - * is set. */ - int windowUnits; /* Maximum number of units that can be - * displayed in the window at once. Valid only - * if the OLD_STYLE_COMMANDS flag is set. */ - int firstUnit; /* Number of last unit visible in - * application's window. Valid only if the - * OLD_STYLE_COMMANDS flag is set. */ - int lastUnit; /* Index of last unit visible in window. - * Valid only if the OLD_STYLE_COMMANDS flag - * isn't set. */ -#else - int dummy1,dummy2,dummy3,dummy4; /* sizeof(TkScrollbar) should not depend on TK_NO_DEPRECATED */ -#endif /* TK_NO_DEPRECATED */ double firstFraction; /* Position of first visible thing in window, * specified as a fraction between 0 and * 1.0. */ @@ -157,9 +141,6 @@ typedef struct TkScrollbar { */ #define REDRAW_PENDING 1 -#ifndef TK_NO_DEPRECATED -# define OLD_STYLE_COMMANDS 2 -#endif /* TK_NO_DEPRECATED */ #define GOT_FOCUS 4 /* diff --git a/macosx/Tk.xcodeproj/project.pbxproj b/macosx/Tk.xcodeproj/project.pbxproj index e2acb38..c4c3b25 100644 --- a/macosx/Tk.xcodeproj/project.pbxproj +++ b/macosx/Tk.xcodeproj/project.pbxproj @@ -1121,7 +1121,6 @@ F966BC3C08F27A3C005CB29B /* message.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = message.test; sourceTree = ""; }; F966BC3D08F27A3C005CB29B /* msgbox.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = msgbox.test; sourceTree = ""; }; F966BC3E08F27A3C005CB29B /* obj.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = obj.test; sourceTree = ""; }; - F966BC3F08F27A3C005CB29B /* oldpack.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = oldpack.test; sourceTree = ""; }; F966BC4008F27A3C005CB29B /* option.file1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = option.file1; sourceTree = ""; }; F966BC4108F27A3C005CB29B /* option.file2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = option.file2; sourceTree = ""; }; F966BC4208F27A3C005CB29B /* option.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = option.test; sourceTree = ""; }; @@ -2676,7 +2675,6 @@ F966BC3C08F27A3C005CB29B /* message.test */, F966BC3D08F27A3C005CB29B /* msgbox.test */, F966BC3E08F27A3C005CB29B /* obj.test */, - F966BC3F08F27A3C005CB29B /* oldpack.test */, F966BC4008F27A3C005CB29B /* option.file1 */, F966BC4108F27A3C005CB29B /* option.file2 */, F966BC4208F27A3C005CB29B /* option.test */, diff --git a/tests/oldpack.test b/tests/oldpack.test deleted file mode 100644 index d8a1bfe..0000000 --- a/tests/oldpack.test +++ /dev/null @@ -1,558 +0,0 @@ -# This file is a Tcl script to test out the old syntax of Tk's -# "pack" command (before release 3.3). It is organized in the -# standard fashion for Tcl tests. -# -# Copyright © 1991-1994 The Regents of the University of California. -# Copyright © 1994 Sun Microsystems, Inc. -# Copyright © 1998-1999 Scriptics Corporation. -# All rights reserved. - -package require tcltest 2.2 -eval tcltest::configure $argv -tcltest::loadTestedCommands -namespace import -force tcltest::test - -# First, test a single window packed in various ways in a parent - -destroy .pack -frame .pack -place .pack -width 100 -height 100 -frame .pack.red -width 10 -height 20 -label .pack.red.l -text R -bd 2 -relief raised -place .pack.red.l -relwidth 1.0 -relheight 1.0 -frame .pack.green -width 30 -height 40 -label .pack.green.l -text G -bd 2 -relief raised -place .pack.green.l -relwidth 1.0 -relheight 1.0 -frame .pack.blue -width 40 -height 40 -label .pack.blue.l -text B -bd 2 -relief raised -place .pack.blue.l -relwidth 1.0 -relheight 1.0 -frame .pack.violet -width 80 -height 20 -label .pack.violet.l -text P -bd 2 -relief raised -place .pack.violet.l -relwidth 1.0 -relheight 1.0 - -if {![catch {pack ap .pack .pack.red top}]} { - -# Don't execute any of this file if Tk is compiled with -DTK_NO_DEPRECATED - - -test oldpack-1.1 {basic positioning} -body { - #pack ap .pack .pack.red top - update - winfo geometry .pack.red -} -result 10x20+45+0 -test oldpack-1.2 {basic positioning} -body { - pack append .pack .pack.red bottom - update - winfo geometry .pack.red -} -result 10x20+45+80 -test oldpack-1.3 {basic positioning} -body { - pack append .pack .pack.red left - update - winfo geometry .pack.red -} -result 10x20+0+40 -test oldpack-1.4 {basic positioning} -body { - pack append .pack .pack.red right - update - winfo geometry .pack.red -} -result 10x20+90+40 - -# Try adding padding around the window and make sure that the -# window gets a larger frame. - -test oldpack-2.1 {padding} -body { - pack append .pack .pack.red {t padx 20} - update - winfo geometry .pack.red -} -result 10x20+45+0 -test oldpack-2.2 {padding} -body { - pack append .pack .pack.red {top pady 20} - update - winfo geometry .pack.red -} -result 10x20+45+10 -test oldpack-2.3 {padding} -body { - pack append .pack .pack.red {l padx 20} - update - winfo geometry .pack.red -} -result 10x20+10+40 -test oldpack-2.4 {padding} -body { - pack append .pack .pack.red {left pady 20} - update - winfo geometry .pack.red -} -result 10x20+0+40 - -# Position the window at different positions in its frame to -# make sure they all work. Try two differenet frame locations, -# to make sure that frame offsets are being added in correctly. - -test oldpack-3.1 {framing} -body { - pack append .pack .pack.red {b padx 20 pady 30} - update - winfo geometry .pack.red -} -result 10x20+45+65 -test oldpack-3.2 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 fr n} - update - winfo geometry .pack.red -} -result 10x20+45+50 -test oldpack-3.3 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame ne} - update - winfo geometry .pack.red -} -result 10x20+90+50 -test oldpack-3.4 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame e} - update - winfo geometry .pack.red -} -result 10x20+90+65 -test oldpack-3.5 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame se} - update - winfo geometry .pack.red -} -result 10x20+90+80 -test oldpack-3.6 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame s} - update - winfo geometry .pack.red -} -result 10x20+45+80 -test oldpack-3.7 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame sw} - update - winfo geometry .pack.red -} -result 10x20+0+80 -test oldpack-3.8 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame w} - update - winfo geometry .pack.red -} -result 10x20+0+65 -test oldpack-3.9 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame nw} - update - winfo geometry .pack.red -} -result 10x20+0+50 -test oldpack-3.10 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame c} - update - winfo geometry .pack.red -} -result 10x20+45+65 -test oldpack-3.11 {framing} -body { - pack append .pack .pack.red {r padx 20 pady 30} - update - winfo geometry .pack.red -} -result 10x20+80+40 -test oldpack-3.12 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame n} - update - winfo geometry .pack.red -} -result 10x20+80+0 -test oldpack-3.13 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame ne} - update - winfo geometry .pack.red -} -result 10x20+90+0 -test oldpack-3.14 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame e} - update - winfo geometry .pack.red -} -result 10x20+90+40 -test oldpack-3.15 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame se} - update - winfo geometry .pack.red -} -result 10x20+90+80 -test oldpack-3.16 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame s} - update - winfo geometry .pack.red -} -result 10x20+80+80 -test oldpack-3.17 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame sw} - update - winfo geometry .pack.red -} -result 10x20+70+80 -test oldpack-3.18 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame w} - update - winfo geometry .pack.red -} -result 10x20+70+40 -test oldpack-3.19 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame nw} - update - winfo geometry .pack.red -} -result 10x20+70+0 -test oldpack-3.20 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame center} - update - winfo geometry .pack.red -} -result 10x20+80+40 - -# Try out various filling combinations in a couple of different -# frame locations. - -test oldpack-4.1 {filling} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 fillx} - update - winfo geometry .pack.red -} -result 100x20+0+65 -test oldpack-4.2 {filling} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 filly} - update - winfo geometry .pack.red -} -result 10x50+45+50 -test oldpack-4.3 {filling} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 fill} - update - winfo geometry .pack.red -} -result 100x50+0+50 -test oldpack-4.4 {filling} -body { - pack append .pack .pack.red {right padx 20 pady 30 fillx} - update - winfo geometry .pack.red -} -result 30x20+70+40 -test oldpack-4.5 {filling} -body { - pack append .pack .pack.red {right padx 20 pady 30 filly} - update - winfo geometry .pack.red -} -result 10x100+80+0 -test oldpack-4.6 {filling} -body { - pack append .pack .pack.red {right padx 20 pady 30 fill} - update - winfo geometry .pack.red -} -result 30x100+70+0 - -# Multiple windows: make sure that space is properly subtracted -# from the cavity as windows are positioned inwards from all -# different sides. Also make sure that windows get unmapped if -# there isn't enough space for them. - -pack append .pack .pack.red top .pack.green top .pack.blue top \ - .pack.violet top -update -test oldpack-5.1 {multiple windows} -body { - winfo geometry .pack.red -} -result 10x20+45+0 -test oldpack-5.2 {multiple windows} -body { - winfo geometry .pack.green -} -result 30x40+35+20 -test oldpack-5.3 {multiple windows} -body { - winfo geometry .pack.blue -} -result 40x40+30+60 -test oldpack-5.4 {multiple windows} -body { - winfo ismapped .pack.violet -} -result 0 - -pack b .pack.blue .pack.violet top -update -test oldpack-5.5 {multiple windows} -body { - winfo ismapped .pack.violet -} -result 1 -test oldpack-5.6 {multiple windows} -body { - winfo geometry .pack.violet -} -result 80x20+10+60 -test oldpack-5.7 {multiple windows} -body { - winfo geometry .pack.blue -} -result 40x20+30+80 - -pack after .pack.blue .pack.red top -update -test oldpack-5.8 {multiple windows} -body { - winfo geometry .pack.green -} -result 30x40+35+0 -test oldpack-5.9 {multiple windows} -body { - winfo geometry .pack.violet -} -result 80x20+10+40 -test oldpack-5.10 {multiple windows} -body { - winfo geometry .pack.blue -} -result 40x40+30+60 -test oldpack-5.11 {multiple windows} -body { - winfo ismapped .pack.red -} -result 0 - -pack before .pack.green .pack.red right .pack.blue left -update -test oldpack-5.12 {multiple windows} -body { - winfo ismapped .pack.red -} -result 1 -test oldpack-5.13 {multiple windows} -body { - winfo geometry .pack.red -} -result 10x20+90+40 -test oldpack-5.14 {multiple windows} -body { - winfo geometry .pack.blue -} -result 40x40+0+30 -test oldpack-5.15 {multiple windows} -body { - winfo geometry .pack.green -} -result 30x40+50+0 -test oldpack-5.16 {multiple windows} -body { - winfo geometry .pack.violet -} -result 50x20+40+40 - -pack append .pack .pack.violet left .pack.green bottom .pack.red bottom \ - .pack.blue bottom -update -test oldpack-5.17 {multiple windows} -body { - winfo geometry .pack.violet -} -result 80x20+0+40 -test oldpack-5.18 {multiple windows} -body { - winfo geometry .pack.green -} -result 20x40+80+60 -test oldpack-5.19 {multiple windows} -body { - winfo geometry .pack.red -} -result 10x20+85+40 -test oldpack-5.20 {multiple windows} -body { - winfo geometry .pack.blue -} -result 20x40+80+0 - -pack after .pack.blue .pack.blue top .pack.red right .pack.green right \ - .pack.violet right -update -test oldpack-5.21 {multiple windows} -body { - winfo geometry .pack.blue -} -result 40x40+30+0 -test oldpack-5.22 {multiple windows} -body { - winfo geometry .pack.red -} -result 10x20+90+60 -test oldpack-5.23 {multiple windows} -body { - winfo geometry .pack.green -} -result 30x40+60+50 -test oldpack-5.24 {multiple windows} -body { - winfo geometry .pack.violet -} -result 60x20+0+60 - -pack after .pack.blue .pack.red left .pack.green left .pack.violet left -update -test oldpack-5.25 {multiple windows} -body { - winfo geometry .pack.blue -} -result 40x40+30+0 -test oldpack-5.26 {multiple windows} -body { - winfo geometry .pack.red -} -result 10x20+0+60 -test oldpack-5.27 {multiple windows} -body { - winfo geometry .pack.green -} -result 30x40+10+50 -test oldpack-5.28 {multiple windows} -body { - winfo geometry .pack.violet -} -result 60x20+40+60 - -pack append .pack .pack.violet left .pack.green left .pack.blue left \ - .pack.red left -update -test oldpack-5.29 {multiple windows} -body { - winfo geometry .pack.violet -} -result 80x20+0+40 -test oldpack-5.30 {multiple windows} -body { - winfo geometry .pack.green -} -result 20x40+80+30 -test oldpack-5.31 {multiple windows} -body { - winfo ismapped .pack.blue -} -result 0 -test oldpack-5.32 {multiple windows} -body { - winfo ismapped .pack.red -} -result 0 - - -# Test the ability of the packer to propagate geometry information -# to its parent. Make sure it computes the parent's needs both in -# the direction of packing (width for "left" and "right" windows, -# for example), and perpendicular to the pack direction (height for -# "left" and "right" windows). - -pack append .pack .pack.red top .pack.green top .pack.blue top \ - .pack.violet top -update -test oldpack-6.1 {geometry propagation} -body { - winfo reqwidth .pack} -result 80 -test oldpack-6.2 {geometry propagation} -body { - winfo reqheight .pack} -result 120 -destroy .pack.violet -update -test oldpack-6.3 {geometry propagation} -body { - winfo reqwidth .pack} -result 40 -test oldpack-6.4 {geometry propagation} -body { - winfo reqheight .pack} -result 100 -frame .pack.violet -width 80 -height 20 -bg violet -label .pack.violet.l -text P -bd 2 -relief raised -place .pack.violet.l -relwidth 1.0 -relheight 1.0 -pack append .pack .pack.red left .pack.green right .pack.blue bottom \ - .pack.violet top -update -test oldpack-6.5 {geometry propagation} -body { - winfo reqwidth .pack} -result 120 -test oldpack-6.6 {geometry propagation} -body { - winfo reqheight .pack} -result 60 -pack append .pack .pack.violet top .pack.green top .pack.blue left \ - .pack.red left -update -test oldpack-6.7 {geometry propagation} -body { - winfo reqwidth .pack} -result 80 -test oldpack-6.8 {geometry propagation} -body { - winfo reqheight .pack} -result 100 - -# Test the "expand" option, and make sure space is evenly divided -# when several windows request expansion. - -pack append .pack .pack.violet top .pack.green {left e} \ - .pack.blue {left expand} .pack.red {left expand} -update -test oldpack-7.1 {multiple expanded windows} -body { - pack append .pack .pack.violet top .pack.green {left e} \ - .pack.blue {left expand} .pack.red {left expand} - update - list [winfo geometry .pack.green] [winfo geometry .pack.blue] \ - [winfo geometry .pack.red] -} -result {30x40+3+40 40x40+39+40 10x20+86+50} -test oldpack-7.2 {multiple expanded windows} -body { - pack append .pack .pack.green left .pack.violet {bottom expand} \ - .pack.blue {bottom expand} .pack.red {bottom expand} - update - list [winfo geometry .pack.violet] [winfo geometry .pack.blue] \ - [winfo geometry .pack.red] -} -result {70x20+30+77 40x40+45+30 10x20+60+3} -test oldpack-7.3 {multiple expanded windows} -body { - foreach i [winfo child .pack] { - pack unpack $i - } - pack append .pack .pack.green {left e fill} .pack.red {left expand fill} \ - .pack.blue {top fill} - update - list [winfo geometry .pack.green] [winfo geometry .pack.red] \ - [winfo geometry .pack.blue] -} -result {40x100+0+0 20x100+40+0 40x40+60+0} -test oldpack-7.4 {multiple expanded windows} -body { - foreach i [winfo child .pack] { - pack unpack $i - } - pack append .pack .pack.red {top expand} .pack.violet {top expand} \ - .pack.blue {right fill} - update - list [winfo geometry .pack.red] [winfo geometry .pack.violet] \ - [winfo geometry .pack.blue] -} -result {10x20+45+5 80x20+10+35 40x40+60+60} -test oldpack-7.5 {multiple expanded windows} -body { - foreach i [winfo child .pack] { - pack unpack $i - } - pack append .pack .pack.green {right frame s} .pack.red {top expand} - update - list [winfo geometry .pack.green] [winfo geometry .pack.red] -} -result {30x40+70+60 10x20+30+40} -test oldpack-7.6 {multiple expanded windows} -body { - foreach i [winfo child .pack] { - pack unpack $i - } - pack append .pack .pack.violet {bottom frame e} .pack.red {right expand} - update - list [winfo geometry .pack.violet] [winfo geometry .pack.red] -} -result {80x20+20+80 10x20+45+30} - -# Need more bizarre tests with combinations of expanded windows and -# windows in opposing directions! Also, include padding in expanded -# (and unexpanded) windows. - -# Syntax errors on pack commands - -test oldpack-8.1 {syntax errors} -body { - pack -} -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"} -test oldpack-8.2 {syntax errors} -body { - pack append -} -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"} -test oldpack-8.3 {syntax errors} -body { - pack gorp foo -} -returnCodes error -result {bad option "gorp": must be configure, content, forget, info, or propagate} -test oldpack-8.4 {syntax errors} -body { - pack a .pack -} -returnCodes error -result {bad option "a": must be configure, content, forget, info, or propagate} -test oldpack-8.5 {syntax errors} -body { - pack after foobar -} -returnCodes error -result {bad window path name "foobar"} -test oldpack-8.6 {syntax errors} -setup { - destroy .pack.yellow -} -body { - frame .pack.yellow -bg yellow - pack after .pack.yellow -} -cleanup { - destroy .pack.yellow -} -returnCodes error -result {window ".pack.yellow" isn't packed} -test oldpack-8.7 {syntax errors} -body { - pack append foobar -} -returnCodes error -result {bad window path name "foobar"} -test oldpack-8.8 {syntax errors} -body { - pack before foobar -} -returnCodes error -result {bad window path name "foobar"} -test oldpack-8.9 {syntax errors} -setup { - destroy .pack.yellow -} -body { - frame .pack.yellow -bg yellow - pack before .pack.yellow -} -cleanup { - destroy .pack.yellow -} -returnCodes error -result {window ".pack.yellow" isn't packed} -test oldpack-8.10 {syntax errors} -body { - pack info .pack help -} -returnCodes error -result {wrong # args: should be "pack info window"} -test oldpack-8.11 {syntax errors} -body { - pack info foobar -} -returnCodes error -result {bad window path name "foobar"} -test oldpack-8.12 {syntax errors} -body { - pack append .pack .pack.blue -} -returnCodes error -result {wrong # args: window ".pack.blue" should be followed by options} -test oldpack-8.13 {syntax errors} -body { - pack append . .pack.blue top -} -returnCodes error -result {can't pack ".pack.blue" inside "."} -test oldpack-8.14 {syntax errors} -body { - pack append .pack .pack.blue f -} -returnCodes error -result {bad option "f": should be top, bottom, left, right, expand, fill, fillx, filly, padx, pady, or frame} -test oldpack-8.15 {syntax errors} -body { - pack append .pack .pack.blue pad -} -returnCodes error -result {bad option "pad": should be top, bottom, left, right, expand, fill, fillx, filly, padx, pady, or frame} -test oldpack-8.16 {syntax errors} -body { - pack append .pack .pack.blue {frame south} -} -returnCodes error -result {bad anchor "south": must be n, ne, e, se, s, sw, w, nw, or center} -test oldpack-8.17 {syntax errors} -body { - pack append .pack .pack.blue {padx -2} -} -returnCodes error -result {bad pad value "-2": must be positive screen distance} -test oldpack-8.18 {syntax errors} -body { - pack append .pack .pack.blue {padx} -} -returnCodes error -result {wrong # args: "padx" option must be followed by screen distance} -test oldpack-8.19 {syntax errors} -body { - pack append .pack .pack.blue {pady -2} -} -returnCodes error -result {bad pad value "-2": must be positive screen distance} -test oldpack-8.20 {syntax errors} -body { - pack append .pack .pack.blue {pady} -} -returnCodes error -result {wrong # args: "pady" option must be followed by screen distance} -test oldpack-8.21 {syntax errors} -body { - pack append .pack .pack.blue "\{abc" -} -returnCodes error -result {unmatched open brace in list} -test oldpack-8.22 {syntax errors} -body { - pack append .pack .pack.blue frame -} -returnCodes error -result {wrong # args: "frame" option must be followed by anchor point} - -# Test "pack info" command output. - -test oldpack-9.1 {information output} -body { - pack append .pack .pack.blue {top fillx frame n} \ - .pack.red {bottom filly frame s} .pack.green {left fill frame w} \ - .pack.violet {right expand frame e} - list [pack content .pack] [pack info .pack.blue] [pack info .pack.red] \ - [pack info .pack.green] [pack info .pack.violet] -} -result {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor n -expand 0 -fill x -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor s -expand 0 -fill y -ipadx 0 -ipady 0 -padx 0 -pady 0 -side bottom} {-in .pack -anchor w -expand 0 -fill both -ipadx 0 -ipady 0 -padx 0 -pady 0 -side left} {-in .pack -anchor e -expand 1 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side right}} -test oldpack-9.2 {information output} -body { - pack append .pack .pack.blue {padx 10 frame nw} \ - .pack.red {pady 20 frame ne} .pack.green {frame se} \ - .pack.violet {frame sw} - list [pack content .pack] [pack info .pack.blue] [pack info .pack.red] \ - [pack info .pack.green] [pack info .pack.violet] -} -result {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor nw -expand 0 -fill none -ipadx 0 -ipady 0 -padx 5 -pady 0 -side top} {-in .pack -anchor ne -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 10 -side top} {-in .pack -anchor se -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor sw -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top}} -test oldpack-9.3 {information output} -body { - pack append .pack .pack.blue {frame center} .pack.red {frame center} \ - .pack.green {frame c} .pack.violet {frame c} - list [pack content .pack] [pack info .pack.blue] [pack info .pack.red] \ - [pack info .pack.green] [pack info .pack.violet] -} -result {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top}} - -} -destroy .pack - -# cleanup -cleanupTests -return - -- cgit v0.12 From ebaefdb7a46e5e843ef135029041fdfbfa1c1a49 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 17 Nov 2023 14:33:24 +0000 Subject: Remove pack-old.n too --- doc/pack-old.n | 195 ------------------------------------ macosx/Tk.xcodeproj/project.pbxproj | 2 - 2 files changed, 197 deletions(-) delete mode 100644 doc/pack-old.n diff --git a/doc/pack-old.n b/doc/pack-old.n deleted file mode 100644 index 5ef5da1..0000000 --- a/doc/pack-old.n +++ /dev/null @@ -1,195 +0,0 @@ -'\" -'\" Copyright (c) 1990-1994 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -.TH pack-old n 4.0 Tk "Tk Built-In Commands" -.so man.macros -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -pack-old \- Obsolete syntax for packer geometry manager -.SH SYNOPSIS -\fBpack after \fIsibling \fIwindow options\fR ?\fIwindow options \fR...? -.sp -\fBpack append \fIparent \fIwindow options\fR ?\fIwindow options \fR...? -.sp -\fBpack before \fIsibling \fIwindow options\fR ?\fIwindow options \fR...? -.sp -\fBpack unpack \fIwindow\fR -.BE -.SH DESCRIPTION -.PP -\fINote: this manual entry describes the syntax for the \fBpack\fI -command as it existed before Tk version 3.3. -Although this syntax continues to be supported for backward -compatibility, it is obsolete and should not be used anymore. -At some point in the future it may cease to be supported.\fR -.PP -The packer is a geometry manager that arranges the -children of a parent by packing them in order around the edges of -the parent. The first child is placed against one side of -the window, occupying the entire span of the window along that -side. This reduces the space remaining for other children as -if the side had been moved in by the size of the first child. -Then the next child is placed against one side of the remaining -cavity, and so on until all children have been placed or there -is no space left in the cavity. -.PP -The \fBbefore\fR, \fBafter\fR, and \fBappend\fR forms of the \fBpack\fR -command are used to insert one or more children into the packing order -for their parent. The \fBbefore\fR form inserts the children before -window \fIsibling\fR in the order; all of the other windows must be -siblings of \fIsibling\fR. The \fBafter\fR form inserts the windows -after \fIsibling\fR, and the \fBappend\fR form appends one or more -windows to the end of the packing order for \fIparent\fR. If a -\fIwindow\fR named in any of these commands is already packed in -its parent, it is removed from its current position in the packing -order and repositioned as indicated by the command. All of these -commands return an empty string as result. -.PP -The \fBunpack\fR form of the \fBpack\fR command removes \fIwindow\fR -from the packing order of its parent and unmaps it. After the -execution of this command the packer will no longer manage -\fIwindow\fR's geometry. -.PP -The placement of each child is actually a four-step process; -the \fIoptions\fR argument following each \fIwindow\fR consists of -a list of one or more fields that govern the placement of that -window. In the discussion below, the term \fIcavity\fR refers -to the space left in a parent when a particular child is placed -(i.e. all the space that was not claimed by earlier children in -the packing order). The term \fIparcel\fR refers to the space -allocated to a particular child; this is not necessarily the -same as the child window's final geometry. -.PP -The first step in placing a child is to determine which side of -the cavity it will lie against. Any one of the following options -may be used to specify a side: -.TP -\fBtop\fR -Position the child's parcel against the top of the cavity, -occupying the full width of the cavity. -.TP -\fBbottom\fR -Position the child's parcel against the bottom of the cavity, -occupying the full width of the cavity. -.TP -\fBleft\fR -Position the child's parcel against the left side of the cavity, -occupying the full height of the cavity. -.TP -\fBright\fR -Position the child's parcel against the right side of the cavity, -occupying the full height of the cavity. -.LP -At most one of these options should be specified for any given window. -If no side is specified, then the default is \fBtop\fR. -.PP -The second step is to decide on a parcel for the child. For \fBtop\fR -and \fBbottom\fR windows, the desired parcel width is normally the cavity -width and the desired parcel height is the window's requested height, -as passed to \fBTk_GeometryRequest\fR. For \fBleft\fR and \fBright\fR -windows, the desired parcel height is normally the cavity height and the -desired width is the window's requested width. However, extra -space may be requested for the window using any of the following -options: -.TP 12 -\fBpadx \fInum\fR -Add \fInum\fR pixels to the window's requested width before computing -the parcel size as described above. -.TP 12 -\fBpady \fInum\fR -Add \fInum\fR pixels to the window's requested height before computing -the parcel size as described above. -.TP 12 -\fBexpand\fR -This option requests that the window's parcel absorb any extra space left over -in the parent's cavity after packing all the children. -The amount of space left over depends on the sizes requested by the -other children, and may be zero. If several windows have all specified -\fBexpand\fR then the extra width will be divided equally among all the -\fBleft\fR and \fBright\fR windows that specified \fBexpand\fR and -the extra height will be divided equally among all the \fBtop\fR and -\fBbottom\fR windows that specified \fBexpand\fR. -.LP -If the desired width or height for a parcel is larger than the corresponding -dimension of the cavity, then the cavity's dimension is used instead. -.PP -The third step in placing the window is to decide on the window's -width and height. The default is for the window to receive either -its requested width and height or the those of the parcel, whichever -is smaller. If the parcel is larger than the window's requested -size, then the following options may be used to expand the -window to partially or completely fill the parcel: -.TP -\fBfill\fR -Set the window's size to equal the parcel size. -.TP -\fBfillx\fR -Increase the window's width to equal the parcel's width, but retain -the window's requested height. -.TP -\fBfilly\fR -Increase the window's height to equal the parcel's height, but retain -the window's requested width. -.PP -The last step is to decide the window's location within its parcel. -If the window's size equals the parcel's size, then the window simply -fills the entire parcel. If the parcel is larger than the window, -then one of -the following options may be used to specify where the window should -be positioned within its parcel: -.TP 15 -\fBframe center\fR -Center the window in its parcel. This is the default if no framing -option is specified. -.TP 15 -\fBframe n\fR -Position the window with its top edge centered on the top edge of -the parcel. -.TP 15 -\fBframe ne\fR -Position the window with its upper-right corner at the upper-right corner -of the parcel. -.TP 15 -\fBframe e\fR -Position the window with its right edge centered on the right edge of -the parcel. -.TP 15 -\fBframe se\fR -Position the window with its lower-right corner at the lower-right corner -of the parcel. -.TP 15 -\fBframe s\fR -Position the window with its bottom edge centered on the bottom edge of -the parcel. -.TP 15 -\fBframe sw\fR -Position the window with its lower-left corner at the lower-left corner -of the parcel. -.TP 15 -\fBframe w\fR -Position the window with its left edge centered on the left edge of -the parcel. -.TP 15 -\fBframe nw\fR -Position the window with its upper-left corner at the upper-left corner -of the parcel. -.PP -The packer manages the mapped/unmapped state of all the packed -children windows. It automatically maps the windows when it packs -them, and it unmaps any windows for which there was no space left -in the cavity. -.PP -The packer makes geometry requests on behalf of the parent windows -it manages. For each parent window it requests a size large enough -to accommodate all the options specified by all the packed children, -such that zero space would be leftover for \fBexpand\fR options. -.SH KEYWORDS -geometry manager, location, packer, parcel, size -'\" Local Variables: -'\" mode: nroff -'\" End: diff --git a/macosx/Tk.xcodeproj/project.pbxproj b/macosx/Tk.xcodeproj/project.pbxproj index c4c3b25..c5b66d5 100644 --- a/macosx/Tk.xcodeproj/project.pbxproj +++ b/macosx/Tk.xcodeproj/project.pbxproj @@ -790,7 +790,6 @@ F966BA7908F27A38005CB29B /* optionMenu.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = optionMenu.n; sourceTree = ""; }; F966BA7A08F27A38005CB29B /* options.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = options.n; sourceTree = ""; }; F966BA7B08F27A38005CB29B /* OwnSelect.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = OwnSelect.3; sourceTree = ""; }; - F966BA7C08F27A38005CB29B /* pack-old.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = "pack-old.n"; sourceTree = ""; }; F966BA7D08F27A38005CB29B /* pack.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = pack.n; sourceTree = ""; }; F966BA7E08F27A38005CB29B /* palette.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = palette.n; sourceTree = ""; }; F966BA7F08F27A38005CB29B /* panedwindow.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = panedwindow.n; sourceTree = ""; }; @@ -2257,7 +2256,6 @@ F966BA7908F27A38005CB29B /* optionMenu.n */, F966BA7A08F27A38005CB29B /* options.n */, F966BA7B08F27A38005CB29B /* OwnSelect.3 */, - F966BA7C08F27A38005CB29B /* pack-old.n */, F966BA7D08F27A38005CB29B /* pack.n */, F966BA7E08F27A38005CB29B /* palette.n */, F966BA7F08F27A38005CB29B /* panedwindow.n */, -- cgit v0.12 From 265f056d7a3105d510d8fcf52ed8c4153ce2939a Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Sat, 25 Nov 2023 18:41:11 +0000 Subject: Remove deprecated tests/documentation --- doc/pack-old.n | 195 ------------- doc/scrollbar.n | 40 --- macosx/Tk.xcodeproj/project.pbxproj | 10 - tests/oldpack.test | 558 ------------------------------------ 4 files changed, 803 deletions(-) delete mode 100644 doc/pack-old.n delete mode 100644 tests/oldpack.test diff --git a/doc/pack-old.n b/doc/pack-old.n deleted file mode 100644 index 5ef5da1..0000000 --- a/doc/pack-old.n +++ /dev/null @@ -1,195 +0,0 @@ -'\" -'\" Copyright (c) 1990-1994 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -.TH pack-old n 4.0 Tk "Tk Built-In Commands" -.so man.macros -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -pack-old \- Obsolete syntax for packer geometry manager -.SH SYNOPSIS -\fBpack after \fIsibling \fIwindow options\fR ?\fIwindow options \fR...? -.sp -\fBpack append \fIparent \fIwindow options\fR ?\fIwindow options \fR...? -.sp -\fBpack before \fIsibling \fIwindow options\fR ?\fIwindow options \fR...? -.sp -\fBpack unpack \fIwindow\fR -.BE -.SH DESCRIPTION -.PP -\fINote: this manual entry describes the syntax for the \fBpack\fI -command as it existed before Tk version 3.3. -Although this syntax continues to be supported for backward -compatibility, it is obsolete and should not be used anymore. -At some point in the future it may cease to be supported.\fR -.PP -The packer is a geometry manager that arranges the -children of a parent by packing them in order around the edges of -the parent. The first child is placed against one side of -the window, occupying the entire span of the window along that -side. This reduces the space remaining for other children as -if the side had been moved in by the size of the first child. -Then the next child is placed against one side of the remaining -cavity, and so on until all children have been placed or there -is no space left in the cavity. -.PP -The \fBbefore\fR, \fBafter\fR, and \fBappend\fR forms of the \fBpack\fR -command are used to insert one or more children into the packing order -for their parent. The \fBbefore\fR form inserts the children before -window \fIsibling\fR in the order; all of the other windows must be -siblings of \fIsibling\fR. The \fBafter\fR form inserts the windows -after \fIsibling\fR, and the \fBappend\fR form appends one or more -windows to the end of the packing order for \fIparent\fR. If a -\fIwindow\fR named in any of these commands is already packed in -its parent, it is removed from its current position in the packing -order and repositioned as indicated by the command. All of these -commands return an empty string as result. -.PP -The \fBunpack\fR form of the \fBpack\fR command removes \fIwindow\fR -from the packing order of its parent and unmaps it. After the -execution of this command the packer will no longer manage -\fIwindow\fR's geometry. -.PP -The placement of each child is actually a four-step process; -the \fIoptions\fR argument following each \fIwindow\fR consists of -a list of one or more fields that govern the placement of that -window. In the discussion below, the term \fIcavity\fR refers -to the space left in a parent when a particular child is placed -(i.e. all the space that was not claimed by earlier children in -the packing order). The term \fIparcel\fR refers to the space -allocated to a particular child; this is not necessarily the -same as the child window's final geometry. -.PP -The first step in placing a child is to determine which side of -the cavity it will lie against. Any one of the following options -may be used to specify a side: -.TP -\fBtop\fR -Position the child's parcel against the top of the cavity, -occupying the full width of the cavity. -.TP -\fBbottom\fR -Position the child's parcel against the bottom of the cavity, -occupying the full width of the cavity. -.TP -\fBleft\fR -Position the child's parcel against the left side of the cavity, -occupying the full height of the cavity. -.TP -\fBright\fR -Position the child's parcel against the right side of the cavity, -occupying the full height of the cavity. -.LP -At most one of these options should be specified for any given window. -If no side is specified, then the default is \fBtop\fR. -.PP -The second step is to decide on a parcel for the child. For \fBtop\fR -and \fBbottom\fR windows, the desired parcel width is normally the cavity -width and the desired parcel height is the window's requested height, -as passed to \fBTk_GeometryRequest\fR. For \fBleft\fR and \fBright\fR -windows, the desired parcel height is normally the cavity height and the -desired width is the window's requested width. However, extra -space may be requested for the window using any of the following -options: -.TP 12 -\fBpadx \fInum\fR -Add \fInum\fR pixels to the window's requested width before computing -the parcel size as described above. -.TP 12 -\fBpady \fInum\fR -Add \fInum\fR pixels to the window's requested height before computing -the parcel size as described above. -.TP 12 -\fBexpand\fR -This option requests that the window's parcel absorb any extra space left over -in the parent's cavity after packing all the children. -The amount of space left over depends on the sizes requested by the -other children, and may be zero. If several windows have all specified -\fBexpand\fR then the extra width will be divided equally among all the -\fBleft\fR and \fBright\fR windows that specified \fBexpand\fR and -the extra height will be divided equally among all the \fBtop\fR and -\fBbottom\fR windows that specified \fBexpand\fR. -.LP -If the desired width or height for a parcel is larger than the corresponding -dimension of the cavity, then the cavity's dimension is used instead. -.PP -The third step in placing the window is to decide on the window's -width and height. The default is for the window to receive either -its requested width and height or the those of the parcel, whichever -is smaller. If the parcel is larger than the window's requested -size, then the following options may be used to expand the -window to partially or completely fill the parcel: -.TP -\fBfill\fR -Set the window's size to equal the parcel size. -.TP -\fBfillx\fR -Increase the window's width to equal the parcel's width, but retain -the window's requested height. -.TP -\fBfilly\fR -Increase the window's height to equal the parcel's height, but retain -the window's requested width. -.PP -The last step is to decide the window's location within its parcel. -If the window's size equals the parcel's size, then the window simply -fills the entire parcel. If the parcel is larger than the window, -then one of -the following options may be used to specify where the window should -be positioned within its parcel: -.TP 15 -\fBframe center\fR -Center the window in its parcel. This is the default if no framing -option is specified. -.TP 15 -\fBframe n\fR -Position the window with its top edge centered on the top edge of -the parcel. -.TP 15 -\fBframe ne\fR -Position the window with its upper-right corner at the upper-right corner -of the parcel. -.TP 15 -\fBframe e\fR -Position the window with its right edge centered on the right edge of -the parcel. -.TP 15 -\fBframe se\fR -Position the window with its lower-right corner at the lower-right corner -of the parcel. -.TP 15 -\fBframe s\fR -Position the window with its bottom edge centered on the bottom edge of -the parcel. -.TP 15 -\fBframe sw\fR -Position the window with its lower-left corner at the lower-left corner -of the parcel. -.TP 15 -\fBframe w\fR -Position the window with its left edge centered on the left edge of -the parcel. -.TP 15 -\fBframe nw\fR -Position the window with its upper-left corner at the upper-left corner -of the parcel. -.PP -The packer manages the mapped/unmapped state of all the packed -children windows. It automatically maps the windows when it packs -them, and it unmaps any windows for which there was no space left -in the cavity. -.PP -The packer makes geometry requests on behalf of the parent windows -it manages. For each parent window it requests a size large enough -to accommodate all the options specified by all the packed children, -such that zero space would be leftover for \fBexpand\fR options. -.SH KEYWORDS -geometry manager, location, packer, parcel, size -'\" Local Variables: -'\" mode: nroff -'\" End: diff --git a/doc/scrollbar.n b/doc/scrollbar.n index 4f808f4..838dac1 100644 --- a/doc/scrollbar.n +++ b/doc/scrollbar.n @@ -236,46 +236,6 @@ the top or left of the window, or \-1, which means that one unit should scroll off the bottom or right of the window. Fractional numbers are rounded away from 0, so scrolling 0.001 units has the same effect as scrolling 1 unit. -.SH "OLD COMMAND SYNTAX" -.PP -In versions of Tk before 4.0, the \fBset\fR and \fBget\fR widget -commands used a different form. -This form is still supported for backward compatibility, but it -is deprecated. -In the old command syntax, the \fBset\fR widget command has the -following form: -.TP -\fIpathName \fBset \fItotalUnits windowUnits firstUnit lastUnit\fR -In this form the arguments are all integers. -\fITotalUnits\fR gives the total size of the object being displayed in the -associated widget. The meaning of one unit depends on the associated -widget; for example, in a text editor widget units might -correspond to lines of -text. \fIWindowUnits\fR indicates the total number of units that -can fit in the associated window at one time. \fIFirstUnit\fR -and \fIlastUnit\fR give the indices of the first and last units -currently visible in the associated window (zero corresponds to the -first unit of the object). -.LP -Under the old syntax the \fBget\fR widget command returns a list -of four integers, consisting of the \fItotalUnits\fR, \fIwindowUnits\fR, -\fIfirstUnit\fR, and \fIlastUnit\fR values from the last \fBset\fR -widget command. -.PP -The commands generated by scrollbars also have a different form -when the old syntax is being used: -.TP -\fIprefix\fR \fIunit\fR -\fIUnit\fR is an integer that indicates what should appear at -the top or left of the associated widget's window. -It has the same meaning as the \fIfirstUnit\fR and \fIlastUnit\fR -arguments to the \fBset\fR widget command. -.LP -The most recent \fBset\fR widget command determines whether or not -to use the old syntax. -If it is given two real arguments then the new syntax will be -used in the future, and if it is given four integer arguments then -the old syntax will be used. .SH BINDINGS .PP Tk automatically creates class bindings for scrollbars that give them diff --git a/macosx/Tk.xcodeproj/project.pbxproj b/macosx/Tk.xcodeproj/project.pbxproj index 47ed01a..c5b66d5 100644 --- a/macosx/Tk.xcodeproj/project.pbxproj +++ b/macosx/Tk.xcodeproj/project.pbxproj @@ -7,7 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - F9067BCD0BFBA2900074F726 /* tkOldTest.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFE08F27A39005CB29B /* tkOldTest.c */; }; F9152B090EAF8A5000CD5C7B /* tkBusy.c in Sources */ = {isa = PBXBuildFile; fileRef = F9152B080EAF8A5000CD5C7B /* tkBusy.c */; }; F9152B0A0EAF8A5700CD5C7B /* tkBusy.c in Sources */ = {isa = PBXBuildFile; fileRef = F9152B080EAF8A5000CD5C7B /* tkBusy.c */; }; F92EE8BF0E62F846001A6E80 /* tkImgPhInstance.c in Sources */ = {isa = PBXBuildFile; fileRef = F92EE8BE0E62F846001A6E80 /* tkImgPhInstance.c */; }; @@ -520,7 +519,6 @@ F9FD317C0CC1AD070073837D /* tkMessage.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEC08F27A39005CB29B /* tkMessage.c */; }; F9FD317D0CC1AD070073837D /* tkObj.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAED08F27A39005CB29B /* tkObj.c */; }; F9FD317E0CC1AD070073837D /* tkOldConfig.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEE08F27A39005CB29B /* tkOldConfig.c */; }; - F9FD317F0CC1AD070073837D /* tkOldTest.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAFE08F27A39005CB29B /* tkOldTest.c */; }; F9FD31800CC1AD070073837D /* tkOption.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAEF08F27A39005CB29B /* tkOption.c */; }; F9FD31810CC1AD070073837D /* tkPack.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF008F27A39005CB29B /* tkPack.c */; }; F9FD31820CC1AD070073837D /* tkPanedWindow.c in Sources */ = {isa = PBXBuildFile; fileRef = F966BAF108F27A39005CB29B /* tkPanedWindow.c */; }; @@ -792,7 +790,6 @@ F966BA7908F27A38005CB29B /* optionMenu.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = optionMenu.n; sourceTree = ""; }; F966BA7A08F27A38005CB29B /* options.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = options.n; sourceTree = ""; }; F966BA7B08F27A38005CB29B /* OwnSelect.3 */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = OwnSelect.3; sourceTree = ""; }; - F966BA7C08F27A38005CB29B /* pack-old.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = "pack-old.n"; sourceTree = ""; }; F966BA7D08F27A38005CB29B /* pack.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = pack.n; sourceTree = ""; }; F966BA7E08F27A38005CB29B /* palette.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = palette.n; sourceTree = ""; }; F966BA7F08F27A38005CB29B /* panedwindow.n */ = {isa = PBXFileReference; explicitFileType = text.man; fileEncoding = 4; path = panedwindow.n; sourceTree = ""; }; @@ -916,7 +913,6 @@ F966BAFB08F27A39005CB29B /* tkSelect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkSelect.c; sourceTree = ""; }; F966BAFC08F27A39005CB29B /* tkSelect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tkSelect.h; sourceTree = ""; }; F966BAFD08F27A39005CB29B /* tkSquare.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkSquare.c; sourceTree = ""; }; - F966BAFE08F27A39005CB29B /* tkOldTest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkOldTest.c; sourceTree = ""; }; F966BAFF08F27A39005CB29B /* tkStubInit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkStubInit.c; sourceTree = ""; }; F966BB0008F27A39005CB29B /* tkStubLib.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkStubLib.c; sourceTree = ""; }; F966BB0108F27A39005CB29B /* tkStyle.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tkStyle.c; sourceTree = ""; }; @@ -1124,7 +1120,6 @@ F966BC3C08F27A3C005CB29B /* message.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = message.test; sourceTree = ""; }; F966BC3D08F27A3C005CB29B /* msgbox.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = msgbox.test; sourceTree = ""; }; F966BC3E08F27A3C005CB29B /* obj.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = obj.test; sourceTree = ""; }; - F966BC3F08F27A3C005CB29B /* oldpack.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = oldpack.test; sourceTree = ""; }; F966BC4008F27A3C005CB29B /* option.file1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = option.file1; sourceTree = ""; }; F966BC4108F27A3C005CB29B /* option.file2 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = option.file2; sourceTree = ""; }; F966BC4208F27A3C005CB29B /* option.test */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = option.test; sourceTree = ""; }; @@ -2261,7 +2256,6 @@ F966BA7908F27A38005CB29B /* optionMenu.n */, F966BA7A08F27A38005CB29B /* options.n */, F966BA7B08F27A38005CB29B /* OwnSelect.3 */, - F966BA7C08F27A38005CB29B /* pack-old.n */, F966BA7D08F27A38005CB29B /* pack.n */, F966BA7E08F27A38005CB29B /* palette.n */, F966BA7F08F27A38005CB29B /* panedwindow.n */, @@ -2417,7 +2411,6 @@ F966BAFB08F27A39005CB29B /* tkSelect.c */, F966BAFC08F27A39005CB29B /* tkSelect.h */, F966BAFD08F27A39005CB29B /* tkSquare.c */, - F966BAFE08F27A39005CB29B /* tkOldTest.c */, F966BAFF08F27A39005CB29B /* tkStubInit.c */, F966BB0008F27A39005CB29B /* tkStubLib.c */, F966BB0108F27A39005CB29B /* tkStyle.c */, @@ -2680,7 +2673,6 @@ F966BC3C08F27A3C005CB29B /* message.test */, F966BC3D08F27A3C005CB29B /* msgbox.test */, F966BC3E08F27A3C005CB29B /* obj.test */, - F966BC3F08F27A3C005CB29B /* oldpack.test */, F966BC4008F27A3C005CB29B /* option.file1 */, F966BC4108F27A3C005CB29B /* option.file2 */, F966BC4208F27A3C005CB29B /* option.test */, @@ -4258,7 +4250,6 @@ F966BE0F08F27A3F005CB29B /* tkMessage.c in Sources */, F966BE1008F27A3F005CB29B /* tkObj.c in Sources */, F966BE1108F27A3F005CB29B /* tkOldConfig.c in Sources */, - F9067BCD0BFBA2900074F726 /* tkOldTest.c in Sources */, F966BE1208F27A3F005CB29B /* tkOption.c in Sources */, F966BE1308F27A3F005CB29B /* tkPack.c in Sources */, F966BE1408F27A3F005CB29B /* tkPanedWindow.c in Sources */, @@ -4572,7 +4563,6 @@ F9FD317C0CC1AD070073837D /* tkMessage.c in Sources */, F9FD317D0CC1AD070073837D /* tkObj.c in Sources */, F9FD317E0CC1AD070073837D /* tkOldConfig.c in Sources */, - F9FD317F0CC1AD070073837D /* tkOldTest.c in Sources */, F9FD31800CC1AD070073837D /* tkOption.c in Sources */, F9FD31810CC1AD070073837D /* tkPack.c in Sources */, F9FD31820CC1AD070073837D /* tkPanedWindow.c in Sources */, diff --git a/tests/oldpack.test b/tests/oldpack.test deleted file mode 100644 index d8a1bfe..0000000 --- a/tests/oldpack.test +++ /dev/null @@ -1,558 +0,0 @@ -# This file is a Tcl script to test out the old syntax of Tk's -# "pack" command (before release 3.3). It is organized in the -# standard fashion for Tcl tests. -# -# Copyright © 1991-1994 The Regents of the University of California. -# Copyright © 1994 Sun Microsystems, Inc. -# Copyright © 1998-1999 Scriptics Corporation. -# All rights reserved. - -package require tcltest 2.2 -eval tcltest::configure $argv -tcltest::loadTestedCommands -namespace import -force tcltest::test - -# First, test a single window packed in various ways in a parent - -destroy .pack -frame .pack -place .pack -width 100 -height 100 -frame .pack.red -width 10 -height 20 -label .pack.red.l -text R -bd 2 -relief raised -place .pack.red.l -relwidth 1.0 -relheight 1.0 -frame .pack.green -width 30 -height 40 -label .pack.green.l -text G -bd 2 -relief raised -place .pack.green.l -relwidth 1.0 -relheight 1.0 -frame .pack.blue -width 40 -height 40 -label .pack.blue.l -text B -bd 2 -relief raised -place .pack.blue.l -relwidth 1.0 -relheight 1.0 -frame .pack.violet -width 80 -height 20 -label .pack.violet.l -text P -bd 2 -relief raised -place .pack.violet.l -relwidth 1.0 -relheight 1.0 - -if {![catch {pack ap .pack .pack.red top}]} { - -# Don't execute any of this file if Tk is compiled with -DTK_NO_DEPRECATED - - -test oldpack-1.1 {basic positioning} -body { - #pack ap .pack .pack.red top - update - winfo geometry .pack.red -} -result 10x20+45+0 -test oldpack-1.2 {basic positioning} -body { - pack append .pack .pack.red bottom - update - winfo geometry .pack.red -} -result 10x20+45+80 -test oldpack-1.3 {basic positioning} -body { - pack append .pack .pack.red left - update - winfo geometry .pack.red -} -result 10x20+0+40 -test oldpack-1.4 {basic positioning} -body { - pack append .pack .pack.red right - update - winfo geometry .pack.red -} -result 10x20+90+40 - -# Try adding padding around the window and make sure that the -# window gets a larger frame. - -test oldpack-2.1 {padding} -body { - pack append .pack .pack.red {t padx 20} - update - winfo geometry .pack.red -} -result 10x20+45+0 -test oldpack-2.2 {padding} -body { - pack append .pack .pack.red {top pady 20} - update - winfo geometry .pack.red -} -result 10x20+45+10 -test oldpack-2.3 {padding} -body { - pack append .pack .pack.red {l padx 20} - update - winfo geometry .pack.red -} -result 10x20+10+40 -test oldpack-2.4 {padding} -body { - pack append .pack .pack.red {left pady 20} - update - winfo geometry .pack.red -} -result 10x20+0+40 - -# Position the window at different positions in its frame to -# make sure they all work. Try two differenet frame locations, -# to make sure that frame offsets are being added in correctly. - -test oldpack-3.1 {framing} -body { - pack append .pack .pack.red {b padx 20 pady 30} - update - winfo geometry .pack.red -} -result 10x20+45+65 -test oldpack-3.2 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 fr n} - update - winfo geometry .pack.red -} -result 10x20+45+50 -test oldpack-3.3 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame ne} - update - winfo geometry .pack.red -} -result 10x20+90+50 -test oldpack-3.4 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame e} - update - winfo geometry .pack.red -} -result 10x20+90+65 -test oldpack-3.5 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame se} - update - winfo geometry .pack.red -} -result 10x20+90+80 -test oldpack-3.6 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame s} - update - winfo geometry .pack.red -} -result 10x20+45+80 -test oldpack-3.7 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame sw} - update - winfo geometry .pack.red -} -result 10x20+0+80 -test oldpack-3.8 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame w} - update - winfo geometry .pack.red -} -result 10x20+0+65 -test oldpack-3.9 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame nw} - update - winfo geometry .pack.red -} -result 10x20+0+50 -test oldpack-3.10 {framing} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 frame c} - update - winfo geometry .pack.red -} -result 10x20+45+65 -test oldpack-3.11 {framing} -body { - pack append .pack .pack.red {r padx 20 pady 30} - update - winfo geometry .pack.red -} -result 10x20+80+40 -test oldpack-3.12 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame n} - update - winfo geometry .pack.red -} -result 10x20+80+0 -test oldpack-3.13 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame ne} - update - winfo geometry .pack.red -} -result 10x20+90+0 -test oldpack-3.14 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame e} - update - winfo geometry .pack.red -} -result 10x20+90+40 -test oldpack-3.15 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame se} - update - winfo geometry .pack.red -} -result 10x20+90+80 -test oldpack-3.16 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame s} - update - winfo geometry .pack.red -} -result 10x20+80+80 -test oldpack-3.17 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame sw} - update - winfo geometry .pack.red -} -result 10x20+70+80 -test oldpack-3.18 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame w} - update - winfo geometry .pack.red -} -result 10x20+70+40 -test oldpack-3.19 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame nw} - update - winfo geometry .pack.red -} -result 10x20+70+0 -test oldpack-3.20 {framing} -body { - pack append .pack .pack.red {right padx 20 pady 30 frame center} - update - winfo geometry .pack.red -} -result 10x20+80+40 - -# Try out various filling combinations in a couple of different -# frame locations. - -test oldpack-4.1 {filling} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 fillx} - update - winfo geometry .pack.red -} -result 100x20+0+65 -test oldpack-4.2 {filling} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 filly} - update - winfo geometry .pack.red -} -result 10x50+45+50 -test oldpack-4.3 {filling} -body { - pack append .pack .pack.red {bottom padx 20 pady 30 fill} - update - winfo geometry .pack.red -} -result 100x50+0+50 -test oldpack-4.4 {filling} -body { - pack append .pack .pack.red {right padx 20 pady 30 fillx} - update - winfo geometry .pack.red -} -result 30x20+70+40 -test oldpack-4.5 {filling} -body { - pack append .pack .pack.red {right padx 20 pady 30 filly} - update - winfo geometry .pack.red -} -result 10x100+80+0 -test oldpack-4.6 {filling} -body { - pack append .pack .pack.red {right padx 20 pady 30 fill} - update - winfo geometry .pack.red -} -result 30x100+70+0 - -# Multiple windows: make sure that space is properly subtracted -# from the cavity as windows are positioned inwards from all -# different sides. Also make sure that windows get unmapped if -# there isn't enough space for them. - -pack append .pack .pack.red top .pack.green top .pack.blue top \ - .pack.violet top -update -test oldpack-5.1 {multiple windows} -body { - winfo geometry .pack.red -} -result 10x20+45+0 -test oldpack-5.2 {multiple windows} -body { - winfo geometry .pack.green -} -result 30x40+35+20 -test oldpack-5.3 {multiple windows} -body { - winfo geometry .pack.blue -} -result 40x40+30+60 -test oldpack-5.4 {multiple windows} -body { - winfo ismapped .pack.violet -} -result 0 - -pack b .pack.blue .pack.violet top -update -test oldpack-5.5 {multiple windows} -body { - winfo ismapped .pack.violet -} -result 1 -test oldpack-5.6 {multiple windows} -body { - winfo geometry .pack.violet -} -result 80x20+10+60 -test oldpack-5.7 {multiple windows} -body { - winfo geometry .pack.blue -} -result 40x20+30+80 - -pack after .pack.blue .pack.red top -update -test oldpack-5.8 {multiple windows} -body { - winfo geometry .pack.green -} -result 30x40+35+0 -test oldpack-5.9 {multiple windows} -body { - winfo geometry .pack.violet -} -result 80x20+10+40 -test oldpack-5.10 {multiple windows} -body { - winfo geometry .pack.blue -} -result 40x40+30+60 -test oldpack-5.11 {multiple windows} -body { - winfo ismapped .pack.red -} -result 0 - -pack before .pack.green .pack.red right .pack.blue left -update -test oldpack-5.12 {multiple windows} -body { - winfo ismapped .pack.red -} -result 1 -test oldpack-5.13 {multiple windows} -body { - winfo geometry .pack.red -} -result 10x20+90+40 -test oldpack-5.14 {multiple windows} -body { - winfo geometry .pack.blue -} -result 40x40+0+30 -test oldpack-5.15 {multiple windows} -body { - winfo geometry .pack.green -} -result 30x40+50+0 -test oldpack-5.16 {multiple windows} -body { - winfo geometry .pack.violet -} -result 50x20+40+40 - -pack append .pack .pack.violet left .pack.green bottom .pack.red bottom \ - .pack.blue bottom -update -test oldpack-5.17 {multiple windows} -body { - winfo geometry .pack.violet -} -result 80x20+0+40 -test oldpack-5.18 {multiple windows} -body { - winfo geometry .pack.green -} -result 20x40+80+60 -test oldpack-5.19 {multiple windows} -body { - winfo geometry .pack.red -} -result 10x20+85+40 -test oldpack-5.20 {multiple windows} -body { - winfo geometry .pack.blue -} -result 20x40+80+0 - -pack after .pack.blue .pack.blue top .pack.red right .pack.green right \ - .pack.violet right -update -test oldpack-5.21 {multiple windows} -body { - winfo geometry .pack.blue -} -result 40x40+30+0 -test oldpack-5.22 {multiple windows} -body { - winfo geometry .pack.red -} -result 10x20+90+60 -test oldpack-5.23 {multiple windows} -body { - winfo geometry .pack.green -} -result 30x40+60+50 -test oldpack-5.24 {multiple windows} -body { - winfo geometry .pack.violet -} -result 60x20+0+60 - -pack after .pack.blue .pack.red left .pack.green left .pack.violet left -update -test oldpack-5.25 {multiple windows} -body { - winfo geometry .pack.blue -} -result 40x40+30+0 -test oldpack-5.26 {multiple windows} -body { - winfo geometry .pack.red -} -result 10x20+0+60 -test oldpack-5.27 {multiple windows} -body { - winfo geometry .pack.green -} -result 30x40+10+50 -test oldpack-5.28 {multiple windows} -body { - winfo geometry .pack.violet -} -result 60x20+40+60 - -pack append .pack .pack.violet left .pack.green left .pack.blue left \ - .pack.red left -update -test oldpack-5.29 {multiple windows} -body { - winfo geometry .pack.violet -} -result 80x20+0+40 -test oldpack-5.30 {multiple windows} -body { - winfo geometry .pack.green -} -result 20x40+80+30 -test oldpack-5.31 {multiple windows} -body { - winfo ismapped .pack.blue -} -result 0 -test oldpack-5.32 {multiple windows} -body { - winfo ismapped .pack.red -} -result 0 - - -# Test the ability of the packer to propagate geometry information -# to its parent. Make sure it computes the parent's needs both in -# the direction of packing (width for "left" and "right" windows, -# for example), and perpendicular to the pack direction (height for -# "left" and "right" windows). - -pack append .pack .pack.red top .pack.green top .pack.blue top \ - .pack.violet top -update -test oldpack-6.1 {geometry propagation} -body { - winfo reqwidth .pack} -result 80 -test oldpack-6.2 {geometry propagation} -body { - winfo reqheight .pack} -result 120 -destroy .pack.violet -update -test oldpack-6.3 {geometry propagation} -body { - winfo reqwidth .pack} -result 40 -test oldpack-6.4 {geometry propagation} -body { - winfo reqheight .pack} -result 100 -frame .pack.violet -width 80 -height 20 -bg violet -label .pack.violet.l -text P -bd 2 -relief raised -place .pack.violet.l -relwidth 1.0 -relheight 1.0 -pack append .pack .pack.red left .pack.green right .pack.blue bottom \ - .pack.violet top -update -test oldpack-6.5 {geometry propagation} -body { - winfo reqwidth .pack} -result 120 -test oldpack-6.6 {geometry propagation} -body { - winfo reqheight .pack} -result 60 -pack append .pack .pack.violet top .pack.green top .pack.blue left \ - .pack.red left -update -test oldpack-6.7 {geometry propagation} -body { - winfo reqwidth .pack} -result 80 -test oldpack-6.8 {geometry propagation} -body { - winfo reqheight .pack} -result 100 - -# Test the "expand" option, and make sure space is evenly divided -# when several windows request expansion. - -pack append .pack .pack.violet top .pack.green {left e} \ - .pack.blue {left expand} .pack.red {left expand} -update -test oldpack-7.1 {multiple expanded windows} -body { - pack append .pack .pack.violet top .pack.green {left e} \ - .pack.blue {left expand} .pack.red {left expand} - update - list [winfo geometry .pack.green] [winfo geometry .pack.blue] \ - [winfo geometry .pack.red] -} -result {30x40+3+40 40x40+39+40 10x20+86+50} -test oldpack-7.2 {multiple expanded windows} -body { - pack append .pack .pack.green left .pack.violet {bottom expand} \ - .pack.blue {bottom expand} .pack.red {bottom expand} - update - list [winfo geometry .pack.violet] [winfo geometry .pack.blue] \ - [winfo geometry .pack.red] -} -result {70x20+30+77 40x40+45+30 10x20+60+3} -test oldpack-7.3 {multiple expanded windows} -body { - foreach i [winfo child .pack] { - pack unpack $i - } - pack append .pack .pack.green {left e fill} .pack.red {left expand fill} \ - .pack.blue {top fill} - update - list [winfo geometry .pack.green] [winfo geometry .pack.red] \ - [winfo geometry .pack.blue] -} -result {40x100+0+0 20x100+40+0 40x40+60+0} -test oldpack-7.4 {multiple expanded windows} -body { - foreach i [winfo child .pack] { - pack unpack $i - } - pack append .pack .pack.red {top expand} .pack.violet {top expand} \ - .pack.blue {right fill} - update - list [winfo geometry .pack.red] [winfo geometry .pack.violet] \ - [winfo geometry .pack.blue] -} -result {10x20+45+5 80x20+10+35 40x40+60+60} -test oldpack-7.5 {multiple expanded windows} -body { - foreach i [winfo child .pack] { - pack unpack $i - } - pack append .pack .pack.green {right frame s} .pack.red {top expand} - update - list [winfo geometry .pack.green] [winfo geometry .pack.red] -} -result {30x40+70+60 10x20+30+40} -test oldpack-7.6 {multiple expanded windows} -body { - foreach i [winfo child .pack] { - pack unpack $i - } - pack append .pack .pack.violet {bottom frame e} .pack.red {right expand} - update - list [winfo geometry .pack.violet] [winfo geometry .pack.red] -} -result {80x20+20+80 10x20+45+30} - -# Need more bizarre tests with combinations of expanded windows and -# windows in opposing directions! Also, include padding in expanded -# (and unexpanded) windows. - -# Syntax errors on pack commands - -test oldpack-8.1 {syntax errors} -body { - pack -} -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"} -test oldpack-8.2 {syntax errors} -body { - pack append -} -returnCodes error -result {wrong # args: should be "pack option arg ?arg ...?"} -test oldpack-8.3 {syntax errors} -body { - pack gorp foo -} -returnCodes error -result {bad option "gorp": must be configure, content, forget, info, or propagate} -test oldpack-8.4 {syntax errors} -body { - pack a .pack -} -returnCodes error -result {bad option "a": must be configure, content, forget, info, or propagate} -test oldpack-8.5 {syntax errors} -body { - pack after foobar -} -returnCodes error -result {bad window path name "foobar"} -test oldpack-8.6 {syntax errors} -setup { - destroy .pack.yellow -} -body { - frame .pack.yellow -bg yellow - pack after .pack.yellow -} -cleanup { - destroy .pack.yellow -} -returnCodes error -result {window ".pack.yellow" isn't packed} -test oldpack-8.7 {syntax errors} -body { - pack append foobar -} -returnCodes error -result {bad window path name "foobar"} -test oldpack-8.8 {syntax errors} -body { - pack before foobar -} -returnCodes error -result {bad window path name "foobar"} -test oldpack-8.9 {syntax errors} -setup { - destroy .pack.yellow -} -body { - frame .pack.yellow -bg yellow - pack before .pack.yellow -} -cleanup { - destroy .pack.yellow -} -returnCodes error -result {window ".pack.yellow" isn't packed} -test oldpack-8.10 {syntax errors} -body { - pack info .pack help -} -returnCodes error -result {wrong # args: should be "pack info window"} -test oldpack-8.11 {syntax errors} -body { - pack info foobar -} -returnCodes error -result {bad window path name "foobar"} -test oldpack-8.12 {syntax errors} -body { - pack append .pack .pack.blue -} -returnCodes error -result {wrong # args: window ".pack.blue" should be followed by options} -test oldpack-8.13 {syntax errors} -body { - pack append . .pack.blue top -} -returnCodes error -result {can't pack ".pack.blue" inside "."} -test oldpack-8.14 {syntax errors} -body { - pack append .pack .pack.blue f -} -returnCodes error -result {bad option "f": should be top, bottom, left, right, expand, fill, fillx, filly, padx, pady, or frame} -test oldpack-8.15 {syntax errors} -body { - pack append .pack .pack.blue pad -} -returnCodes error -result {bad option "pad": should be top, bottom, left, right, expand, fill, fillx, filly, padx, pady, or frame} -test oldpack-8.16 {syntax errors} -body { - pack append .pack .pack.blue {frame south} -} -returnCodes error -result {bad anchor "south": must be n, ne, e, se, s, sw, w, nw, or center} -test oldpack-8.17 {syntax errors} -body { - pack append .pack .pack.blue {padx -2} -} -returnCodes error -result {bad pad value "-2": must be positive screen distance} -test oldpack-8.18 {syntax errors} -body { - pack append .pack .pack.blue {padx} -} -returnCodes error -result {wrong # args: "padx" option must be followed by screen distance} -test oldpack-8.19 {syntax errors} -body { - pack append .pack .pack.blue {pady -2} -} -returnCodes error -result {bad pad value "-2": must be positive screen distance} -test oldpack-8.20 {syntax errors} -body { - pack append .pack .pack.blue {pady} -} -returnCodes error -result {wrong # args: "pady" option must be followed by screen distance} -test oldpack-8.21 {syntax errors} -body { - pack append .pack .pack.blue "\{abc" -} -returnCodes error -result {unmatched open brace in list} -test oldpack-8.22 {syntax errors} -body { - pack append .pack .pack.blue frame -} -returnCodes error -result {wrong # args: "frame" option must be followed by anchor point} - -# Test "pack info" command output. - -test oldpack-9.1 {information output} -body { - pack append .pack .pack.blue {top fillx frame n} \ - .pack.red {bottom filly frame s} .pack.green {left fill frame w} \ - .pack.violet {right expand frame e} - list [pack content .pack] [pack info .pack.blue] [pack info .pack.red] \ - [pack info .pack.green] [pack info .pack.violet] -} -result {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor n -expand 0 -fill x -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor s -expand 0 -fill y -ipadx 0 -ipady 0 -padx 0 -pady 0 -side bottom} {-in .pack -anchor w -expand 0 -fill both -ipadx 0 -ipady 0 -padx 0 -pady 0 -side left} {-in .pack -anchor e -expand 1 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side right}} -test oldpack-9.2 {information output} -body { - pack append .pack .pack.blue {padx 10 frame nw} \ - .pack.red {pady 20 frame ne} .pack.green {frame se} \ - .pack.violet {frame sw} - list [pack content .pack] [pack info .pack.blue] [pack info .pack.red] \ - [pack info .pack.green] [pack info .pack.violet] -} -result {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor nw -expand 0 -fill none -ipadx 0 -ipady 0 -padx 5 -pady 0 -side top} {-in .pack -anchor ne -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 10 -side top} {-in .pack -anchor se -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor sw -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top}} -test oldpack-9.3 {information output} -body { - pack append .pack .pack.blue {frame center} .pack.red {frame center} \ - .pack.green {frame c} .pack.violet {frame c} - list [pack content .pack] [pack info .pack.blue] [pack info .pack.red] \ - [pack info .pack.green] [pack info .pack.violet] -} -result {{.pack.blue .pack.red .pack.green .pack.violet} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top} {-in .pack -anchor center -expand 0 -fill none -ipadx 0 -ipady 0 -padx 0 -pady 0 -side top}} - -} -destroy .pack - -# cleanup -cleanupTests -return - -- cgit v0.12