diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-01-10 17:04:41 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-01-10 17:04:41 (GMT) |
commit | ed36cf228c15623a65b89fc174ffc6668179f221 (patch) | |
tree | 9be53e00e57e05eabbfec0206fbd6cbba188f823 | |
parent | 525ee9b1ac100b2015f585612c4d1b7a9a336024 (diff) | |
download | tk-ed36cf228c15623a65b89fc174ffc6668179f221.zip tk-ed36cf228c15623a65b89fc174ffc6668179f221.tar.gz tk-ed36cf228c15623a65b89fc174ffc6668179f221.tar.bz2 |
Use pixels in stead of ints in the "wm minsize" and "wm maxsize" commands, so those become scalable.
-rw-r--r-- | macosx/tkMacOSXWm.c | 12 | ||||
-rw-r--r-- | tests/wm.test | 8 | ||||
-rw-r--r-- | unix/tkUnixWm.c | 12 | ||||
-rw-r--r-- | win/tkWinWm.c | 12 |
4 files changed, 22 insertions, 22 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index b1bfc5e..fbbccef 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -2988,7 +2988,7 @@ WmManageCmd( static int WmMaxsizeCmd( - TCL_UNUSED(Tk_Window), /* Main window of the application. */ + Tk_Window tkwin, /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ @@ -3012,8 +3012,8 @@ WmMaxsizeCmd( return TCL_OK; } - if ((Tcl_GetIntFromObj(interp, objv[3], &width) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[4], &height) != TCL_OK)) { + if ((Tk_GetPixelsFromObj(interp, tkwin, objv[3], &width) != TCL_OK) + || (Tk_GetPixelsFromObj(interp, tkwin, objv[4], &height) != TCL_OK)) { return TCL_ERROR; } wmPtr->maxWidth = width; @@ -3042,7 +3042,7 @@ WmMaxsizeCmd( static int WmMinsizeCmd( - TCL_UNUSED(Tk_Window), /* Main window of the application. */ + Tk_Window tkwin, /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ @@ -3066,8 +3066,8 @@ WmMinsizeCmd( return TCL_OK; } - if ((Tcl_GetIntFromObj(interp, objv[3], &width) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[4], &height) != TCL_OK)) { + if ((Tk_GetPixelsFromObj(interp, tkwin, objv[3], &width) != TCL_OK) + || (Tk_GetPixelsFromObj(interp, tkwin, objv[4], &height) != TCL_OK)) { return TCL_ERROR; } wmPtr->minWidth = width; diff --git a/tests/wm.test b/tests/wm.test index 5edbb2c..f3436e1 100644 --- a/tests/wm.test +++ b/tests/wm.test @@ -1107,10 +1107,10 @@ test wm-maxsize-1.3 {usage} -returnCodes error -body { } -result {wrong # args: should be "wm maxsize window ?width height?"} test wm-maxsize-1.4 {usage} -returnCodes error -body { wm maxsize . x 100 -} -result {expected integer but got "x"} +} -result {bad screen distance "x"} test wm-maxsize-1.5 {usage} -returnCodes error -body { wm maxsize . 100 bogus -} -result {expected integer but got "bogus"} +} -result {bad screen distance "bogus"} test wm-maxsize-1.6 {usage} -setup { destroy .t2 } -body { @@ -1207,10 +1207,10 @@ test wm-minsize-1.3 {usage} -returnCodes error -body { } -result {wrong # args: should be "wm minsize window ?width height?"} test wm-minsize-1.4 {usage} -returnCodes error -body { wm minsize . x 100 -} -result {expected integer but got "x"} +} -result {bad screen distance "x"} test wm-minsize-1.5 {usage} -returnCodes error -body { wm minsize . 100 bogus -} -result {expected integer but got "bogus"} +} -result {bad screen distance "bogus"} test wm-minsize-1.6 {usage} -setup { destroy .t2 } -body { diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index 28e1e29..7351c78 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -2812,7 +2812,7 @@ WmManageCmd( static int WmMaxsizeCmd( - TCL_UNUSED(Tk_Window), /* Main window of the application. */ + Tk_Window tkwin, /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ @@ -2834,8 +2834,8 @@ WmMaxsizeCmd( Tcl_SetObjResult(interp, Tcl_NewListObj(2, results)); return TCL_OK; } - if ((Tcl_GetIntFromObj(interp, objv[3], &width) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[4], &height) != TCL_OK)) { + if ((Tk_GetPixelsFromObj(interp, tkwin, objv[3], &width) != TCL_OK) + || (Tk_GetPixelsFromObj(interp, tkwin, objv[4], &height) != TCL_OK)) { return TCL_ERROR; } wmPtr->maxWidth = width; @@ -2871,7 +2871,7 @@ WmMaxsizeCmd( static int WmMinsizeCmd( - TCL_UNUSED(Tk_Window), /* Main window of the application. */ + Tk_Window tkwin, /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ @@ -2892,8 +2892,8 @@ WmMinsizeCmd( Tcl_SetObjResult(interp, Tcl_NewListObj(2, results)); return TCL_OK; } - if ((Tcl_GetIntFromObj(interp, objv[3], &width) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[4], &height) != TCL_OK)) { + if ((Tk_GetPixelsFromObj(interp, tkwin, objv[3], &width) != TCL_OK) + || (Tk_GetPixelsFromObj(interp, tkwin, objv[4], &height) != TCL_OK)) { return TCL_ERROR; } wmPtr->minWidth = width; diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 8196eb3..f97f2e4 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -4623,7 +4623,7 @@ WmManageCmd( static int WmMaxsizeCmd( - TCL_UNUSED(Tk_Window), /* Main window of the application. */ + Tk_Window tkwin, /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ @@ -4645,8 +4645,8 @@ WmMaxsizeCmd( Tcl_SetObjResult(interp, Tcl_NewListObj(2, results)); return TCL_OK; } - if ((Tcl_GetIntFromObj(interp, objv[3], &width) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[4], &height) != TCL_OK)) { + if ((Tk_GetPixelsFromObj(interp, tkwin, objv[3], &width) != TCL_OK) + || (Tk_GetPixelsFromObj(interp, tkwin, objv[4], &height) != TCL_OK)) { return TCL_ERROR; } wmPtr->maxWidth = width; @@ -4674,7 +4674,7 @@ WmMaxsizeCmd( static int WmMinsizeCmd( - TCL_UNUSED(Tk_Window), /* Main window of the application. */ + Tk_Window tkwin, /* Main window of the application. */ TkWindow *winPtr, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ @@ -4696,8 +4696,8 @@ WmMinsizeCmd( Tcl_SetObjResult(interp, Tcl_NewListObj(2, results)); return TCL_OK; } - if ((Tcl_GetIntFromObj(interp, objv[3], &width) != TCL_OK) - || (Tcl_GetIntFromObj(interp, objv[4], &height) != TCL_OK)) { + if ((Tk_GetPixelsFromObj(interp, tkwin, objv[3], &width) != TCL_OK) + || (Tk_GetPixelsFromObj(interp, tkwin, objv[4], &height) != TCL_OK)) { return TCL_ERROR; } wmPtr->minWidth = width; |