diff options
-rw-r--r-- | doc/systray.n | 10 | ||||
-rw-r--r-- | macosx/tkMacOSXSysTray.c | 8 |
2 files changed, 10 insertions, 8 deletions
diff --git a/doc/systray.n b/doc/systray.n index 534f5bb..c0bc9ff 100644 --- a/doc/systray.n +++ b/doc/systray.n @@ -10,7 +10,7 @@ .SH NAME systray \- Creates an icon display in the platform-specific system tray. .SH SYNOPSIS -\fBtk systray create\fP \fIimage\fP? \fItext\fP? \fIcallback\fR? +\fBtk systray create\fP \fIimage\fP? \fItext\fP? \fIb1_callback\fR? \fIb3_callback\fR? .sp \fBtk systray modify image\fI image\fR? .sp @@ -25,13 +25,14 @@ systray \- Creates an icon display in the platform-specific system tray. .PP The \fBtk systray\fP command creates an icon in the platform-specific tray. The widget is configured with a Tk image for the icon display, a string -for display in a tooltip, and a callback is bound to <Button-1>. +for display in a tooltip, and callbacks that are bound to <Button-1> and +<Button-3>. .SH EXAMPLE .PP Here is an example of the \fBtk systray\fP code: .CS image create photo book -data R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAACwAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IMQCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc0yv+DVSEUuFxIAOw== - tk systray create book "tk systray sample" {puts "Here is the tk systray output"} + tk systray create book "tk systray sample" {puts "Here is the tk systray output"} {puts "here is alternate output"} .CE .PP Here is an example of modifying the \fBtk systray\fP icon: @@ -39,7 +40,8 @@ Here is an example of modifying the \fBtk systray\fP icon: image create book_page -data R0lGODlhCwAPAKIAAP//////AMDAwICAgAAA/wAAAAAAAAAAACwAAAAACwAPAAADMzi6CzAugiAgDGE68aB0RXgRJBFVX0SNpQlUWfahQOvSsgrX7eZJMlQMWBEYj8iQchlKAAA7 tk systray modify image book_page tk systray modify text "Updated sample" - tk systray modify callback {puts "Different output from the tk systray"} + tk systray modify b1_callback {puts "Different output from the tk systray"} + tk systray modify b3_callback {puts "and more different output from the tk systray"} .CE .PP The \fBtk systray\fP destroy command removes the icon from display and diff --git a/macosx/tkMacOSXSysTray.c b/macosx/tkMacOSXSysTray.c index 53ffe52..e861630 100644 --- a/macosx/tkMacOSXSysTray.c +++ b/macosx/tkMacOSXSysTray.c @@ -104,13 +104,13 @@ static const char ASSOC_KEY[] = "tk::tktray"; } } else { if (([event type] == NSEventTypeRightMouseUp) && (b3_callback != NULL)) { - int result = Tcl_EvalObjEx(interp, b3_callback, TCL_EVAL_GLOBAL); - if (result != TCL_OK) { - Tcl_BackgroundException(interp, result); + int result = Tcl_EvalObjEx(interp, b3_callback, TCL_EVAL_GLOBAL); + if (result != TCL_OK) { + Tcl_BackgroundException(interp, result); + } } } } -} - (void) dealloc { /* |