summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXWm.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2021-08-17 01:14:13 (GMT)
committerKevin Walzer <kw@codebykevin.com>2021-08-17 01:14:13 (GMT)
commite02bd57b0aed182ae341187acb8f95ed67c79710 (patch)
tree1e99b601edd06558fe22d3691828f689b2fbae98 /macosx/tkMacOSXWm.c
parent894e012be469ccf33af304775715605b177c44a6 (diff)
downloadtk-e02bd57b0aed182ae341187acb8f95ed67c79710.zip
tk-e02bd57b0aed182ae341187acb8f95ed67c79710.tar.gz
tk-e02bd57b0aed182ae341187acb8f95ed67c79710.tar.bz2
Minor adjustments/updates
Diffstat (limited to 'macosx/tkMacOSXWm.c')
-rw-r--r--macosx/tkMacOSXWm.c49
1 files changed, 47 insertions, 2 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c
index 39399cf..ef5c205 100644
--- a/macosx/tkMacOSXWm.c
+++ b/macosx/tkMacOSXWm.c
@@ -248,6 +248,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[]);
@@ -1196,7 +1199,7 @@ Tk_WmObjCmd(
static const char *const optionStrings[] = {
"aspect", "attributes", "client", "colormapwindows",
"command", "deiconify", "focusmodel", "forget",
- "frame", "geometry", "grid", "group",
+ "frame", "geometry", "grid", "group", "iconbadge",
"iconbitmap", "iconify", "iconmask", "iconname",
"iconphoto", "iconposition", "iconwindow",
"manage", "maxsize", "minsize", "overrideredirect",
@@ -1206,7 +1209,7 @@ Tk_WmObjCmd(
enum options {
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_FRAME, WMOPT_GEOMETRY, WMOPT_GRID, WMOPT_GROUP, WMOPT_ICONBADGE,
WMOPT_ICONBITMAP, WMOPT_ICONIFY, WMOPT_ICONMASK, WMOPT_ICONNAME,
WMOPT_ICONPHOTO, WMOPT_ICONPOSITION, WMOPT_ICONWINDOW,
WMOPT_MANAGE, WMOPT_MAXSIZE, WMOPT_MINSIZE, WMOPT_OVERRIDEREDIRECT,
@@ -1284,6 +1287,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:
@@ -2342,6 +2347,46 @@ WmGroupCmd(
}
return TCL_OK;
}
+
+ /*----------------------------------------------------------------------
+ *
+ * WmIconbadgeCmd --
+ *
+ * This procedure 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;
+ }
+
+ (void) winPtr;
+ NSString *label;
+ label = [NSString stringWithUTF8String:Tcl_GetString(objv[3])];
+
+ /* Set the icon badge on the Dock icon. */
+ NSDockTile *dockicon = [NSApp dockTile];
+ [dockicon setBadgeLabel: label];
+ return TCL_OK;
+}
/*
*----------------------------------------------------------------------