diff options
author | Kevin Walzer <kw@codebykevin.com> | 2021-08-16 14:45:04 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2021-08-16 14:45:04 (GMT) |
commit | 57410166f0e19205b5e4a7109ec345ffb2dbc915 (patch) | |
tree | 714a220648fc284d665407db6d938322a223cd0b /unix/tkUnixWm.c | |
parent | b49fe39c8aa91fc4e88b5c997a011e75f39b136b (diff) | |
download | tk-57410166f0e19205b5e4a7109ec345ffb2dbc915.zip tk-57410166f0e19205b5e4a7109ec345ffb2dbc915.tar.gz tk-57410166f0e19205b5e4a7109ec345ffb2dbc915.tar.bz2 |
X11 implementation substantially complete
Diffstat (limited to 'unix/tkUnixWm.c')
-rw-r--r-- | unix/tkUnixWm.c | 51 |
1 files changed, 49 insertions, 2 deletions
diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index dcf669f..0666012 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -419,6 +419,9 @@ static int WmGridCmd(Tk_Window tkwin, TkWindow *winPtr, static int WmGroupCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); +static int WmIconbadgeCmd(Tk_Window tkwin, TkWindow *winPtr, + Tcl_Interp *interp, int objc, + Tcl_Obj *const objv[]); static int WmIconbitmapCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); @@ -1021,7 +1024,7 @@ Tk_WmObjCmd( static const char *const optionStrings[] = { "aspect", "attributes", "client", "colormapwindows", "command", "deiconify", "focusmodel", "forget", - "frame", "geometry", "grid", "group", "iconbitmap", + "frame", "geometry", "grid", "group", "iconbadge", "iconbitmap", "iconify", "iconmask", "iconname", "iconphoto", "iconposition", "iconwindow", "manage", "maxsize", "minsize", "overrideredirect", "positionfrom", @@ -1031,7 +1034,7 @@ Tk_WmObjCmd( WMOPT_ASPECT, WMOPT_ATTRIBUTES, WMOPT_CLIENT, WMOPT_COLORMAPWINDOWS, WMOPT_COMMAND, WMOPT_DEICONIFY, WMOPT_FOCUSMODEL, WMOPT_FORGET, WMOPT_FRAME, WMOPT_GEOMETRY, WMOPT_GRID, WMOPT_GROUP, - WMOPT_ICONBITMAP, + WMOPT_ICONBADGE, WMOPT_ICONBITMAP, WMOPT_ICONIFY, WMOPT_ICONMASK, WMOPT_ICONNAME, WMOPT_ICONPHOTO, WMOPT_ICONPOSITION, WMOPT_ICONWINDOW, WMOPT_MANAGE, WMOPT_MAXSIZE, WMOPT_MINSIZE, WMOPT_OVERRIDEREDIRECT, WMOPT_POSITIONFROM, @@ -1121,6 +1124,8 @@ Tk_WmObjCmd( return WmGridCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_GROUP: return WmGroupCmd(tkwin, winPtr, interp, objc, objv); + case WMOPT_ICONBADGE: + return WmIconbadgeCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONBITMAP: return WmIconbitmapCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONIFY: @@ -2125,6 +2130,48 @@ WmGroupCmd( /* *---------------------------------------------------------------------- * + * WmIconbadgeCmd -- + * + * This function is invoked to process the "wm iconbadge" Tcl command. + * See the user documentation for details on what it does. + * + * Results: + * A standard Tcl result. + * + * Side effects: + * See the user documentation. + * + *---------------------------------------------------------------------- + */ + +static int +WmIconbadgeCmd( + TCL_UNUSED(Tk_Window), /* Main window of the application. */ + TkWindow *winPtr, /* Toplevel to work with */ + Tcl_Interp *interp, /* Current interpreter. */ + int objc, /* Number of arguments. */ + Tcl_Obj *const objv[]) /* Argument objects. */ +{ + + if (objc < 4) { + Tcl_WrongNumArgs(interp, 2, objv, + "window ? badge?"); + return TCL_ERROR; + } + + char cmd[4096]; + sprintf(cmd, "::tk::icons::IconBadge {%s} {%s}", Tcl_GetString(objv[2]), Tcl_GetString(objv[3])); + if (Tcl_EvalEx(interp, cmd, -1, TCL_EVAL_DIRECT) != TCL_OK) { + //Tcl_GetStringResult(interp); + return TCL_ERROR; + } + + +return TCL_OK; +} +/* + *---------------------------------------------------------------------- + * * WmIconbitmapCmd -- * * This function is invoked to process the "wm iconbitmap" Tcl command. |