summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2020-10-07 01:59:16 (GMT)
committerKevin Walzer <kw@codebykevin.com>2020-10-07 01:59:16 (GMT)
commit12ef0a45c453b60f6e75c07b67ea99b0d4e997e6 (patch)
treed01e5981d0488376e1ba08f51a412d7458539df2
parent1c39cdd6ec7494e363839bf400fde9c8f30ef3d0 (diff)
downloadtk-12ef0a45c453b60f6e75c07b67ea99b0d4e997e6.zip
tk-12ef0a45c453b60f6e75c07b67ea99b0d4e997e6.tar.gz
tk-12ef0a45c453b60f6e75c07b67ea99b0d4e997e6.tar.bz2
Final cleanup; ready for testing
-rw-r--r--library/systray.tcl28
-rw-r--r--macosx/tkMacOSXSysTray.c4
-rw-r--r--win/tkWinSysTray.c32
3 files changed, 31 insertions, 33 deletions
diff --git a/library/systray.tcl b/library/systray.tcl
index 402f306..79867d4 100644
--- a/library/systray.tcl
+++ b/library/systray.tcl
@@ -129,16 +129,16 @@ set ico ""
# none.
proc systray {args} {
- #Set variables for icon properties.
+ #Set variables for icon properties.
global ico
- global img
- global txt
- global cb
-
- set img ""
- set txt ""
- set cb ""
-
+ global img
+ global txt
+ global cb
+
+ set img ""
+ set txt ""
+ set cb ""
+
#Create the system tray icon.
if {[lindex $args 0] eq "create"} {
@@ -170,8 +170,7 @@ proc systray {args} {
set img [lindex $args 2]
_systray taskbar delete $ico
set ico [_systray createfrom $img]
- _systray taskbar add $ico -text $txt -callback [list \
- _win_callback %m %i $cb]
+ _systray taskbar add $ico -text $txt -callback [list _win_callback %m %i $cb]
}
if {[lindex $args 1] eq "text"} {
set txt [lindex $args 2]
@@ -179,19 +178,18 @@ proc systray {args} {
}
if {[lindex $args 1 ] eq "callback"} {
set cb [lindex $args 2]
- _systray taskbar modify $ico -callback [list \
- _win_callback %m %i $cb]
+ _systray taskbar modify $ico -callback [list _win_callback %m %i $cb]
}
}
"x11" {
if {[lindex $args 1] eq "image"} {
- set img ""
+ set img ""
set img [lindex $args 2]
._tray configure -image ""
._tray configure -image $img
}
if {[lindex $args 1] eq "text"} {
- set txt ""
+ set txt ""
set txt [lindex $args 2]
_balloon ._tray $txt
}
diff --git a/macosx/tkMacOSXSysTray.c b/macosx/tkMacOSXSysTray.c
index e81ed45..e392232 100644
--- a/macosx/tkMacOSXSysTray.c
+++ b/macosx/tkMacOSXSysTray.c
@@ -193,7 +193,7 @@ MacSystrayCmd(ClientData clientData, Tcl_Interp * interp,
if ((strncmp(argv[1], "create", length) == 0) && (length >= 2)) {
if (argc < 5) {
- Tcl_AppendResult(interp, "wrong # args: should be \"systray create image ? text? callback?\"", (char * ) NULL);
+ Tcl_AppendResult(interp, " wrong # args: should be \"systray create image ? text? callback?\"", (char * ) NULL);
return TCL_ERROR;
}
@@ -325,7 +325,7 @@ MacSystrayCmd(ClientData clientData, Tcl_Interp * interp,
*
* MacSystrayDestroy --
*
- * Deletes icon and hidden window from display.
+ * Deletes icon from display.
*
* Results:
* Icon/window removed and memory freed.
diff --git a/win/tkWinSysTray.c b/win/tkWinSysTray.c
index 7c2d4c8..caf39ad 100644
--- a/win/tkWinSysTray.c
+++ b/win/tkWinSysTray.c
@@ -517,20 +517,20 @@ TaskbarOperation(IcoInfo * icoPtr, int oper, HICON hIcon, char * txt) {
if (hmod == NULL)
hmod = LoadLibrary("SHELL32.DLL");
if (hmod == NULL) {
- Tcl_AppendResult(icoPtr -> interp, "Could not Load SHELL32.DLL", (char * ) NULL);
+ Tcl_AppendResult(icoPtr -> interp, " Could not Load SHELL32.DLL", (char * ) NULL);
return TCL_ERROR;
}
notify_funcW = (LPFN_SHELLNOTIFYICONW) GetProcAddress(hmod, "Shell_NotifyIconW");
notify_funcA = (LPFN_SHELLNOTIFYICONA) GetProcAddress(hmod, "Shell_NotifyIconA");
if (notify_funcW == NULL && notify_funcA == NULL) {
Tcl_AppendResult(icoPtr -> interp,
- "Could not get address of Shell_NotifyIconW or Shell_NotifyIconA",
+ " Could not get address of Shell_NotifyIconW or Shell_NotifyIconA",
(char * ) NULL);
return TCL_ERROR;
}
} else if (notify_funcA == NULL && notify_funcW == NULL) {
Tcl_AppendResult(icoPtr -> interp,
- "You probably don't have a Windows shell", (char * ) NULL);
+ " You probably don't have a Windows shell", (char * ) NULL);
return TCL_ERROR;
}
@@ -681,7 +681,7 @@ static IcoInfo * GetIcoPtr(Tcl_Interp * interp, char * string) {
return icoPtr;
}
}
- Tcl_AppendResult(interp, "icon \"", string,
+ Tcl_AppendResult(interp, " icon \"", string,
"\" doesn't exist", (char * ) NULL);
return NULL;
}
@@ -1431,7 +1431,7 @@ WinIcoCmd(ClientData clientData, Tcl_Interp * interp,
IcoInfo * icoPtr;
BlockOfIconImagesPtr lpIR = NULL;
if (argc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_AppendResult(interp, " wrong # args: should be \"",
argv[0], " option ?arg arg ...?\"", (char * ) NULL);
return TCL_ERROR;
}
@@ -1441,7 +1441,7 @@ WinIcoCmd(ClientData clientData, Tcl_Interp * interp,
int pos = 0;
if (argc < 3) {
- Tcl_AppendResult(interp, "wrong # args,must be:",
+ Tcl_AppendResult(interp, " wrong # args,must be:",
argv[0], " createfrom <Tk image> ", (char * ) NULL);
return TCL_ERROR;
}
@@ -1450,7 +1450,7 @@ WinIcoCmd(ClientData clientData, Tcl_Interp * interp,
lpIR = iconBits;
if (lpIR == NULL) {
- Tcl_AppendResult(interp, "reading of ", argv[2], " failed!", (char * ) NULL);
+ Tcl_AppendResult(interp, " reading of ", argv[2], " failed!", (char * ) NULL);
return TCL_ERROR;
}
hIcon = NULL;
@@ -1465,14 +1465,14 @@ WinIcoCmd(ClientData clientData, Tcl_Interp * interp,
}
if (hIcon == NULL) {
FreeIconResource(lpIR);
- Tcl_AppendResult(interp, "Could not find an icon in ", argv[2], (char * ) NULL);
+ Tcl_AppendResult(interp, " Could not find an icon in ", argv[2], (char * ) NULL);
return TCL_ERROR;
}
NewIcon(interp, hIcon, ICO_FILE, lpIR, pos);
} else if ((strncmp(argv[1], "delete", length) == 0) &&
(length >= 2)) {
if (argc != 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_AppendResult(interp, " wrong # args: should be \"",
argv[0], " delete ?id?\"", (char * ) NULL);
return TCL_ERROR;
}
@@ -1485,7 +1485,7 @@ WinIcoCmd(ClientData clientData, Tcl_Interp * interp,
return TCL_OK;
} else if ((strncmp(argv[1], "text", length) == 0) && (length >= 2)) {
if (argc < 3) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_AppendResult(interp, " wrong # args: should be \"",
argv[0], " text <id> ?newtext?\"", (char * ) NULL);
return TCL_ERROR;
}
@@ -1509,7 +1509,7 @@ WinIcoCmd(ClientData clientData, Tcl_Interp * interp,
int count;
char * txt;
if (argc < 4) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_AppendResult(interp, " wrong # args: should be \"",
argv[0], " taskbar <add/delete/modify> <id> ?-callback <callback>? \"", (char * ) NULL);
return TCL_ERROR;
}
@@ -1520,7 +1520,7 @@ WinIcoCmd(ClientData clientData, Tcl_Interp * interp,
} else if (strncmp(argv[2], "mod", 3) == 0) {
oper = NIM_MODIFY;
} else {
- Tcl_AppendResult(interp, "bad argument ", argv[2], "should be add, delete or modify", (char * ) NULL);
+ Tcl_AppendResult(interp, " bad argument ", argv[2], "should be add, delete or modify", (char * ) NULL);
return TCL_ERROR;
}
if ((icoPtr = GetIcoPtr(interp, (char * ) argv[3])) == NULL)
@@ -1556,11 +1556,11 @@ WinIcoCmd(ClientData clientData, Tcl_Interp * interp,
}
return TaskbarOperation(icoPtr, oper, hIcon, txt);
wrongargs2:
- Tcl_AppendResult(interp, "unknown option \"", args[0], "\",valid are:",
+ Tcl_AppendResult(interp, " unknown option \"", args[0], "\",valid are:",
"-callback <tcl-callback> -text <tooltiptext>", (char * ) NULL);
return TCL_ERROR;
} else {
- Tcl_AppendResult(interp, "bad argument \"", argv[1],
+ Tcl_AppendResult(interp, " bad argument \"", argv[1],
"\": must be createfrom, info, hicon, pos, text, taskbar",
(char * ) NULL);
return TCL_ERROR;
@@ -1614,7 +1614,7 @@ WinSystrayCmd(ClientData clientData, Tcl_Interp * interp,
ni.dwInfoFlags = NIIF_INFO;
if (argc < 2) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_AppendResult(interp, " wrong # args: should be \"",
argv[0], " option ?arg arg ...?\"", (char * ) NULL);
return TCL_ERROR;
}
@@ -1623,7 +1623,7 @@ WinSystrayCmd(ClientData clientData, Tcl_Interp * interp,
if ((strncmp(argv[1], "notify", length) == 0) &&
(length >= 2)) {
if (argc != 5) {
- Tcl_AppendResult(interp, "wrong # args: should be \"",
+ Tcl_AppendResult(interp, " wrong # args: should be \"",
argv[0], " notify ?id? ?title? ?detail?\"", (char * ) NULL);
return TCL_ERROR;
}