Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch tk_badges Excluding Merge-Ins
This is equivalent to a diff from 3eace28a to 1d3c4b32
2021-09-24
| ||
12:48 | Merge TIP 610 check-in: eee47cd6 user: kevin_walzer tags: trunk, main | |
2021-09-21
| ||
18:28 | Fix [0338867c74]: Windows text widget hangs when Phaistos font is installed check-in: cb3943ef user: fvogel tags: trunk, main | |
14:59 | Merge 8.7 Closed-Leaf check-in: 1d3c4b32 user: jan.nijtmans tags: tk_badges | |
14:55 | Merge 8.7 check-in: fa86b9ef user: jan.nijtmans tags: revised_text, tip-466 | |
14:49 | Merge trunk check-in: d11bb432 user: jan.nijtmans tags: strict-index, enhanced-index | |
12:00 | Merge 8.6 check-in: 3eace28a user: jan.nijtmans tags: trunk, main | |
11:58 | Fully handle 64-bit sec/usec values when Win64 Tk is loaded in Cygwin64 Tclsh check-in: 6ffcea9b user: jan.nijtmans tags: core-8-6-branch | |
09:16 | Fully handle 64-bit sec/usec values when Win64 Tk is loaded in Cygwin64 Tclsh check-in: 72c1e58e user: jan.nijtmans tags: trunk, main | |
2021-09-08
| ||
05:49 | Add more codepaths checks in wm.test for wm iconbadge. check-in: c2bcbba4 user: fvogel tags: tk_badges | |
Changes to doc/wm.n.
︙ | ︙ | |||
402 403 404 405 406 407 408 409 410 411 412 413 414 415 | a group of related windows. The window manager may use this information, for example, to unmap all of the windows in a group when the group's leader is iconified. \fIPathName\fR may be specified as an empty string to remove \fIwindow\fR from any group association. If \fIpathName\fR is specified then the command returns an empty string; otherwise it returns the path name of \fIwindow\fR's current group leader, or an empty string if \fIwindow\fR is not part of any group. .TP \fBwm iconbitmap \fIwindow\fR ?\fIbitmap\fR? . If \fIbitmap\fR is specified, then it names a bitmap in the standard forms accepted by Tk (see the \fBTk_GetBitmap\fR manual entry for details). This bitmap is passed to the window manager to be displayed in \fIwindow\fR's icon, and the command returns an empty string. If | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 | a group of related windows. The window manager may use this information, for example, to unmap all of the windows in a group when the group's leader is iconified. \fIPathName\fR may be specified as an empty string to remove \fIwindow\fR from any group association. If \fIpathName\fR is specified then the command returns an empty string; otherwise it returns the path name of \fIwindow\fR's current group leader, or an empty string if \fIwindow\fR is not part of any group. .TP \fBwm iconbadge \fIwindow\fR \fIbadge\fR . Sets a badge for the icon of the \fIwindow\fR. The badge can be a positive integer number, for instance the number of new or unread messages, or an exclamation point denoting attention needed. If the badge is an empty string, the badge image is removed from the application icon. Managing these changes through bindings, such as <FocusIn>, is the responsibility of the developer. .RS .PP On X11, for this command to work, the variable \fB::tk::icons::base_icon($window)\fR must be set to the image that is being used for the window icon of $window. On Windows and X11, the iconphoto images work best at 32x32 or a similar dimension, as the badge images are provided by Tk and drawn to overlay the icon images using native (Windows) API's or Tk rendering. On macOS, the icon badge is rendered by a system API and is not provided by Tk. The icon image itself should be higher-resolution, preferably 512 pixels, to avoid being blurry. .PP The icon badge is intended for display in the Dock (macOS), taskbar (Windows) or app panel (X11). On macOS, the last badge called will be displayed in the Dock, regardless of how many different icon badges may be assigned to different windows. On Windows, the taskbar display depends on whether the taskbar buttons are combined or not (this is an OS setting available to the user): if combined the behavior is the same as on macOS, otherwise each button in the taskbar shows the badge it was assigned. Badge display on macOS is configured in the system preferences. App panel display behavior on X11 will depend on the window manager and/or desktop environment. .RE .TP \fBwm iconbitmap \fIwindow\fR ?\fIbitmap\fR? . If \fIbitmap\fR is specified, then it names a bitmap in the standard forms accepted by Tk (see the \fBTk_GetBitmap\fR manual entry for details). This bitmap is passed to the window manager to be displayed in \fIwindow\fR's icon, and the command returns an empty string. If |
︙ | ︙ | |||
477 478 479 480 481 482 483 | reflected to the titlebar icons. Multiple images are accepted to allow different images sizes (e.g., 16x16 and 32x32) to be provided. The window manager may scale provided icons to an appropriate size. .RS .PP On Windows, the images are packed into a Windows icon structure. This will override an ico specified to \fBwm iconbitmap\fR, and | | | > | 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 | reflected to the titlebar icons. Multiple images are accepted to allow different images sizes (e.g., 16x16 and 32x32) to be provided. The window manager may scale provided icons to an appropriate size. .RS .PP On Windows, the images are packed into a Windows icon structure. This will override an ico specified to \fBwm iconbitmap\fR, and vice versa. This command sets the taskbar icon for the window. .PP On X, the images are arranged into the _NET_WM_ICON X property, which most modern window managers support. A \fBwm iconbitmap\fR may exist simultaneously. It is recommended to use not more than 2 icons, placing the larger icon first. This command also sets the panel icon for the application if the window manager or desktop environment supports it. .PP On Macintosh, the first image called is loaded into an OSX-native icon format, and becomes the application icon in dialogs, the Dock, and other contexts. At the script level the command will accept only the first image passed in the parameters as support for multiple sizes/resolutions on macOS is outside Tk's scope. Developers should use the largest icon they can support |
︙ | ︙ |
Changes to library/demos/tclIndex.
︙ | ︙ | |||
62 63 64 65 66 67 68 69 | set auto_index(puzzleSwitch) [list source -encoding utf-8 [file join $dir puzzle.tcl]] set auto_index(setHeight) [list source -encoding utf-8 [file join $dir vscale.tcl]] set auto_index(showMessageBox) [list source -encoding utf-8 [file join $dir msgbox.tcl]] set auto_index(setColor) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(setColor_helper) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(fileDialog) [list source -encoding utf-8 [file join $dir filebox.tcl]] set auto_index(systray) [list source -encoding utf-8 [file join $dir systray.tcl]] | > | 62 63 64 65 66 67 68 69 70 | set auto_index(puzzleSwitch) [list source -encoding utf-8 [file join $dir puzzle.tcl]] set auto_index(setHeight) [list source -encoding utf-8 [file join $dir vscale.tcl]] set auto_index(showMessageBox) [list source -encoding utf-8 [file join $dir msgbox.tcl]] set auto_index(setColor) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(setColor_helper) [list source -encoding utf-8 [file join $dir clrpick.tcl]] set auto_index(fileDialog) [list source -encoding utf-8 [file join $dir filebox.tcl]] set auto_index(systray) [list source -encoding utf-8 [file join $dir systray.tcl]] set auto_index(windoicons [list source -encoding utf-8 [file join $dir windowicons.tcl]] |
Changes to library/demos/widget.
︙ | ︙ | |||
397 398 399 400 401 402 403 404 405 406 407 408 409 410 | @@demo pendulum Pendulum simulation @@demo goldberg A celebration of Rube Goldberg @@subtitle Miscellaneous @@demo bitmap The built-in bitmaps @@demo dialog1 A dialog box with a local grab @@demo dialog2 A dialog box with a global grab } ############################################################################## .t configure -state disabled focus .s | > > | 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 | @@demo pendulum Pendulum simulation @@demo goldberg A celebration of Rube Goldberg @@subtitle Miscellaneous @@demo bitmap The built-in bitmaps @@demo dialog1 A dialog box with a local grab @@demo dialog2 A dialog box with a global grab @@new @@demo windowicons Window icons and badges } ############################################################################## .t configure -state disabled focus .s |
︙ | ︙ |
Added library/demos/windowicons.tcl.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | # windowicons.tcl -- # # This demonstration script showcases the wm iconphoto and wm iconbadge commands. # if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } set w .windowicons destroy $w toplevel $w wm title $w "Window Icon Demonstration" positionWindow $w image create photo icon -data { iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGP C/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTA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8eqfw3wLwzvVmX9jsvx8AHEAcnn91/BlySEFKTpuCtgAAABN0RVh0 QXV0aG9yAHdhcnN6YXdpYW5rYQy+S5cAAABYdEVYdENvcHlyaWdodABDQzAg UHVibGljIERvbWFpbiBEZWRpY2F0aW9uIGh0dHA6Ly9jcmVhdGl2ZWNvbW1v bnMub3JnL3B1YmxpY2RvbWFpbi96ZXJvLzEuMC/G4735AAAAIXRFWHRDcmVh dGlvbiBUaW1lADIwMTAtMDMtMjlUMDg6MDg6MzD47LxwAAAAJXRFWHRkYXRl OmNyZWF0ZQAyMDIxLTA4LTE1VDIwOjU0OjM5LTA0OjAwNBT3DQAAACV0RVh0 ZGF0ZTptb2RpZnkAMjAyMS0wOC0xNVQyMDo1NDoxMS0wNDowMDSDBqsAAADI elRYdERlc2NyaXB0aW9uAAAY042OwQqCQBCGn6B3GOy+Cl0qTAjEc1HRJVhW HXUrd2pmLXr7tDrVpcMP838w/F+wxxxyprsgB2ALclAxtRAbaBirRdB4f5mH oTeuJlUxYoly8nRRxHW4HahO30SvmI5Y+CCBF4dPhzg0CYwOLs45GdKfG+sK hBuy2H4xUlM1i76+BhcBwwirLj/bAlJqjXXzP9UyxmuHzp8feiknLPW6Q/H9 moy3yK1oqvROUE2yH99suX45PwEyf2MTOoCNrQAAABl0RVh0U29mdHdhcmUA d3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABWdEVYdFNvdXJjZQBodHRwczovL29w ZW5jbGlwYXJ0Lm9yZy9kZXRhaWwvMzUyMzMvdGFuZ28taW5ldHJuZXQtd2Vi LWJyb3dzZXItYnktd2Fyc3phd2lhbmth5nAuRgAAACB0RVh0VGl0bGUAdGF uZ28gaW5ldHJuZXQgd2ViIGJyb3dzZXLyr62TAAAAAElFTkSuQmCC } set ::tk::icons::base_icon(.) icon pack [button $w.i -text "Set Window Icon to Globe" -image $::tk::icons::base_icon(.) \ -compound top -command {wm iconphoto . $::tk::icons::base_icon(.) }] pack [button $w.b -text "Set Badge to 3" -command {wm iconbadge . 3}] pack [button $w.e -text "Set Badge to 11" -command {wm iconbadge . 11}] pack [button $w.f -text "Reset Badge" -command {wm iconbadge . ""}] ## See Code / Dismiss buttons pack [addSeeDismiss $w.buttons $w] -side bottom -fill x |
Added library/iconbadges.tcl.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | # iconbadges.tcl -- # # Notification badges for Tk applications. # # # Copyright © 2021 Kevin Walzer/WordTech Communications LLC namespace eval ::tk::icons {} image create photo ::tk::icons::1-badge -data { iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAM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MjEtMDgtMTBU MDg6MzU6MTUtMDQ6MDAGj0kTAAAAAElFTkSuQmCC } image create photo ::tk::icons::8-badge -data { iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAABGdBTUEAALGPC/xh BQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAA 6lBMVEUAAAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/ AAD/AAD/AAD/AAD/Bwf/MjL/UVH/TU3/Kir/BAT/DAz/j4//7e3/+Pj/5+f/eXn/ BQX/Skr/9/f/7+//Z2f/fn7/+/v/6ur/MDD/UFD/4uL/Jib/QUH/9PT/NTX/EhL/ srL/////09P/2tr/m5v/CAj/ycn//f3/y8v/1dX/s7P/GBj/hYX/HR3/Zmb/0dH/ LCz/5eX/dHT/S0v/wsL/NDT/V1f/sLD/zc3/ysr/paX/RUX/AQH/Bgb/Dg7/DQ3m iTf5AAAAEXRSTlMAAA5Vq9/4NK/0St3cDa7z4Pnet34AAAABYktHRC8j1CARAAAA yklEQVQY021Q1RLCQBDbowZFSpEWh+J+xd3d/v936N5hD+QlmezsTrIAQIhLECVZ lkTBRQgAOorbozN43Ap6hKhe/QOv6nhE8ek/8CkE/AFUoXAkapioAn4QNIdj8UQy mUpnHKkJIOIom7PyhWKpjFoECalSrNbqDauJWgIZqdWmdod2e6hlbhn9wXBExxNu scUptWfhFJ3zRXY+TheT5Yqu+XkWYmMNtkNa3fEQLGpmfziezpcrj/oqdLs/zHeh P7X/POf7wuDrhU+46hlBGTVCQgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMS0wOC0x MFQwODozNToxNS0wNDowMHfS8a8AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEtMDgt MTBUMDg6MzU6MTUtMDQ6MDAGj0kTAAAAAElFTkSuQmCC } image create photo ::tk::icons::9-badge -data { iVBORw0KGgoAAAANSUhEUgAAABIAAAAS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ABhEH5lAAAABGdBTUEAALGPC/xh BQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAA olBMVEUAAAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/ AAD/AAD/AAD/AAD/Fhb/QED/Pj7/ExP/VVX/9PT/8PD/SUn/WFj//v7/+fn/S0v/ SEj/PDz/MjL/6Oj/Jyf/ICD/4+P/2Nj/Fxf/Dw//qKj/nZ3/Cgr/IyP/hIT/gYH/ Hh7/PT3/Ly//paX/oqL/KCj/AgL///8V6AjgAAAAEXRSTlMAAA5Vq9/4NK/0St3c Da7z4Pnet34AAAABYktHRDXettlrAAAAoElEQVQY022QxxKCQBBEZ9hERkygophz lv//NmF3Bz0wp1dd1V3dAwCIDuNCSsGZgwjQKMr1Un2eqxoN0Q/S9gK/1lCF6d+F CiGKNfYHw5GGOAKWaBpn+URDwoAbw3RWzA1xEAYWRVYaEiANLPPV2pAkabPd7Umy xsPxdCajjb9cb3eKtyXq+AeVsFWfr/eHqtKgqmoHdczueM7vhT37wi9PRRMHXNeq aAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMS0wOC0xMFQwODozNToxNi0wNDowMEY6 6zIAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEtMDgtMTBUMDg6MzU6MTYtMDQ6MDA3 Z1OOAAAAAElFTkSuQmCC } if {[tk windowingsystem] eq "x11"} { # ::tk::icons::IconBadge -- # This procedure creates an icon with an overlay badge on systems that # do not have a native icon/badge API. # # Arguments: # win - window name # badgenumber - badge number to draw over the window icon proc ::tk::icons::IconBadge {win badgenumber} { variable ::tk::icons::base_icon if {![info exists ::tk::icons::base_icon]} { return -code error "::tk::icons::base_icon($win) must be set on X11" } if {![info exists ::tk::icons::base_icon($win)]} { return -code error "::tk::icons::base_icon($win) must be set on X11" } if {[lsearch -exact [image names] $::tk::icons::base_icon($win)] <= 0} { return -code error "can't use \"$::tk::icons::base_icon($win)\" as iconphoto: not a photo image" } if {!([string is integer $badgenumber] && $badgenumber > 0) && [string match $badgenumber "!"] == 0 && $badgenumber ne ""} { return -code error "can't use \"$badgenumber\" as icon badge" } wm iconphoto $win $::tk::icons::base_icon($win) if {$badgenumber eq ""} { return } image create photo overlay switch -glob -- $badgenumber { ! { set badge ::tk::icons::!-badge } [1-9] { set badge ::tk::icons::$badgenumber-badge } default { set badge ::tk::icons::9plus-badge } } overlay copy $::tk::icons::base_icon($win) overlay copy $badge -from 0 0 18 18 -to 18 0 wm iconphoto $win overlay } } |
Changes to library/tk.tcl.
︙ | ︙ | |||
493 494 495 496 497 498 499 500 501 502 503 504 505 506 | if {$::tk_library ne ""} { proc ::tk::SourceLibFile {file} { namespace eval :: [list source -encoding utf-8 [file join $::tk_library $file.tcl]] } namespace eval ::tk { SourceLibFile icons SourceLibFile button SourceLibFile entry SourceLibFile listbox SourceLibFile menu SourceLibFile panedwindow SourceLibFile print SourceLibFile scale | > | 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 | if {$::tk_library ne ""} { proc ::tk::SourceLibFile {file} { namespace eval :: [list source -encoding utf-8 [file join $::tk_library $file.tcl]] } namespace eval ::tk { SourceLibFile icons SourceLibFile iconbadges SourceLibFile button SourceLibFile entry SourceLibFile listbox SourceLibFile menu SourceLibFile panedwindow SourceLibFile print SourceLibFile scale |
︙ | ︙ |
Changes to macosx/tkMacOSXWm.c.
︙ | ︙ | |||
238 239 240 241 242 243 244 245 246 247 248 249 250 251 | Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int WmGridCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int WmGroupCmd(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[]); static int WmIconifyCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); | > > > | 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int WmGridCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); 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[]); static int WmIconifyCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); |
︙ | ︙ | |||
1187 1188 1189 1190 1191 1192 1193 | int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window)clientData; static const char *const optionStrings[] = { "aspect", "attributes", "client", "colormapwindows", "command", "deiconify", "focusmodel", "forget", | | | | 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 | int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window)clientData; static const char *const optionStrings[] = { "aspect", "attributes", "client", "colormapwindows", "command", "deiconify", "focusmodel", "forget", "frame", "geometry", "grid", "group", "iconbadge", "iconbitmap", "iconify", "iconmask", "iconname", "iconphoto", "iconposition", "iconwindow", "manage", "maxsize", "minsize", "overrideredirect", "positionfrom", "protocol", "resizable", "sizefrom", "stackorder", "state", "title", "transient", "withdraw", NULL }; 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_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, WMOPT_PROTOCOL, WMOPT_RESIZABLE, WMOPT_SIZEFROM, WMOPT_STACKORDER, WMOPT_STATE, WMOPT_TITLE, WMOPT_TRANSIENT, WMOPT_WITHDRAW }; int index, length; |
︙ | ︙ | |||
1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 | return WmFrameCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_GEOMETRY: return WmGeometryCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_GRID: return WmGridCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_GROUP: return WmGroupCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONBITMAP: return WmIconbitmapCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONIFY: return WmIconifyCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONMASK: return WmIconmaskCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONNAME: | > > | 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 | return WmFrameCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_GEOMETRY: return WmGeometryCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_GRID: 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: return WmIconifyCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONMASK: return WmIconmaskCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONNAME: |
︙ | ︙ | |||
2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 | if (wmPtr->leaderName != NULL) { ckfree(wmPtr->leaderName); } wmPtr->hints.window_group = Tk_WindowId(tkwin2); wmPtr->hints.flags |= WindowGroupHint; wmPtr->leaderName = (char *)ckalloc(length + 1); strcpy(wmPtr->leaderName, argv3); } return TCL_OK; } /* *---------------------------------------------------------------------- * | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 | if (wmPtr->leaderName != NULL) { ckfree(wmPtr->leaderName); } wmPtr->hints.window_group = Tk_WindowId(tkwin2); wmPtr->hints.flags |= WindowGroupHint; wmPtr->leaderName = (char *)ckalloc(length + 1); strcpy(wmPtr->leaderName, argv3); } 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. */ { (void) winPtr; NSString *label; if (objc < 4) { Tcl_WrongNumArgs(interp, 2, objv,"window badge"); return TCL_ERROR; } label = [NSString stringWithUTF8String:Tcl_GetString(objv[3])]; int number = [label intValue]; NSDockTile *dockicon = [NSApp dockTile]; /* * First, check that the label is not a decimal. If it is, * return an error. */ if ([label containsString:@"."]) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't use \"%s\" as icon badge", Tcl_GetString(objv[3]))); return TCL_ERROR; } /* * Next, check that label is an int, empty string, or exclamation * point. If so, set the icon badge on the Dock icon. Otherwise, * return an error. */ NSArray *array = @[@"", @"!"]; if ([array containsObject: label]) { [dockicon setBadgeLabel:label]; } else if (number > 0) { NSString *str = [@(number) stringValue]; [dockicon setBadgeLabel:str]; } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't use \"%s\" as icon badge", Tcl_GetString(objv[3]))); return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------- * |
︙ | ︙ |
Changes to tests/unixWm.test.
︙ | ︙ | |||
898 899 900 901 902 903 904 | } {{} questhead 0x20 {} 0x0} test unixWm-24.3 {Tk_WmCmd procedure, "iconmask" option} unix { list [catch {wm iconmask .t bogus} msg] $msg } {1 {bitmap "bogus" not defined}} test unixWm-25.1 {Tk_WmCmd procedure, "iconname" option} unix { list [catch {wm icon .t} msg] $msg | | | 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 | } {{} questhead 0x20 {} 0x0} test unixWm-24.3 {Tk_WmCmd procedure, "iconmask" option} unix { list [catch {wm iconmask .t bogus} msg] $msg } {1 {bitmap "bogus" not defined}} test unixWm-25.1 {Tk_WmCmd procedure, "iconname" option} unix { list [catch {wm icon .t} msg] $msg } {1 {ambiguous option "icon": must be aspect, attributes, client, colormapwindows, command, deiconify, focusmodel, forget, frame, geometry, grid, group, iconbadge, iconbitmap, iconify, iconmask, iconname, iconphoto, iconposition, iconwindow, manage, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw}} test unixWm-25.2 {Tk_WmCmd procedure, "iconname" option} unix { list [catch {wm iconname .t 12 13} msg] $msg } {1 {wrong # args: should be "wm iconname window ?newName?"}} test unixWm-25.3 {Tk_WmCmd procedure, "iconname" option} {unix testwrapper} { set result {} lappend result [wm iconname .t] wm iconname .t test_name |
︙ | ︙ | |||
1347 1348 1349 1350 1351 1352 1353 | lappend result [wm state .t] [winfo ismapped .t] wm deiconify .t lappend result [wm state .t] [winfo ismapped .t] } {withdrawn 0 normal 1} test unixWm-39.1 {Tk_WmCmd procedure, miscellaneous} unix { list [catch {wm unknown .t} msg] $msg | | | 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 | lappend result [wm state .t] [winfo ismapped .t] wm deiconify .t lappend result [wm state .t] [winfo ismapped .t] } {withdrawn 0 normal 1} test unixWm-39.1 {Tk_WmCmd procedure, miscellaneous} unix { list [catch {wm unknown .t} msg] $msg } {1 {bad option "unknown": must be aspect, attributes, client, colormapwindows, command, deiconify, focusmodel, forget, frame, geometry, grid, group, iconbadge, iconbitmap, iconify, iconmask, iconname, iconphoto, iconposition, iconwindow, manage, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw}} destroy .t .icon test unixWm-40.1 {Tk_SetGrid procedure, set grid dimensions before turning on grid} {unix nonPortable} { destroy .t toplevel .t wm geometry .t 30x10+0+0 |
︙ | ︙ |
Changes to tests/wm.test.
︙ | ︙ | |||
10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # This file tests window manager interactions that work across platforms. # Window manager tests that only work on a specific platform should be placed # in unixWm.test or winWm.test. package require tcltest 2.2 eval tcltest::configure $argv tcltest::loadTestedCommands wm deiconify . if {![winfo ismapped .]} { tkwait visibility . } proc stdWindow {} { | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | # This file tests window manager interactions that work across platforms. # Window manager tests that only work on a specific platform should be placed # in unixWm.test or winWm.test. package require tcltest 2.2 eval tcltest::configure $argv tcltest::loadTestedCommands image create photo icon -data { iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAA CBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/w D/AP+gvaeTAAAACXBIWXMAArQNAAK0DQEdFIm+AAAJQElEQVRYw+WXW2xdV5nHf/ty7lc f2/FxYsdOnMSNC0HTpDiRKJWAQjWCEQNUSEAFfUOiQqrEC2+IxwpemDLSzNBBCCQeQEKq RJgBSikiuGlN22TqhsR27OPL8eWc43Pdt7X22osHHydOm4FBPM6Slr69paX9/32Xtb614 f/7MP6vC3O5f8L3G7HJyZPHBwfz5wrF7HQ6nRwxLTOhQuU4PW+z3eq9Xa+33rq9cms7k8 pHjvfS3w8wOfk52u1u8oHpiUff897JJ8+dO/nI6LHho6OjQ3ahkMYwTTZ2O2zXutS3G/7 ayubq7Vtr/7Ve2f7RytLam4ViXq1t/vRvB0ilPsjzz3+LZ5/9j7MzM5Nf/8hj5//5H97/ YNbK5hkfTFLMxAEQQvD766v0yBGIEBEEuPUGi9dv7lx77cb3Vm9vfqc0WNi9evUKWr/xL h3rfuLj45+l0bjM7m768U98/OJ/fulLH/3wiemxeCafxRcKw7TJxKC+12RpbYdAx7HsOC rSRNpg+sQQj1w8nS0N5h8JAvm+rWr99ZmZB2qWdZq9vWt/GWBm5im+9rUn6HRGPv7EE4/ ++2P/eOFkV0FkJTDQgCaXTbO1tcV2R2EmCxBJQixs2+R9EwV00MFAceJE2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d3Lmlua3NjYXBlLm9yZ5vuPBoAAABWdEVYdFNvdXJjZQBodHR wczovL29wZW5jbGlwYXJ0Lm9yZy9kZXRhaWwvMzUyMzMvdGFuZ28taW5ldHJuZXQtd2Vi LWJyb3dzZXItYnktd2Fyc3phd2lhbmth5nAuRgAAACB0RVh0VGl0bGUAdGFuZ28gaW5ld HJuZXQgd2ViIGJyb3dzZXLyr62TAAAAAElFTkSuQmCC } wm deiconify . if {![winfo ismapped .]} { tkwait visibility . } proc stdWindow {} { |
︙ | ︙ | |||
55 56 57 58 59 60 61 | test wm-1.1 {Tk_WmObjCmd procedure, miscellaneous errors} -returnCodes error -body { wm } -result {wrong # args: should be "wm option window ?arg ...?"} # Next test will fail every time set of subcommands is changed test wm-1.2 {Tk_WmObjCmd procedure, miscellaneous errors} -returnCodes error -body { wm foo | | | 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | test wm-1.1 {Tk_WmObjCmd procedure, miscellaneous errors} -returnCodes error -body { wm } -result {wrong # args: should be "wm option window ?arg ...?"} # Next test will fail every time set of subcommands is changed test wm-1.2 {Tk_WmObjCmd procedure, miscellaneous errors} -returnCodes error -body { wm foo } -result {bad option "foo": must be aspect, attributes, client, colormapwindows, command, deiconify, focusmodel, forget, frame, geometry, grid, group, iconbadge, iconbitmap, iconify, iconmask, iconname, iconphoto, iconposition, iconwindow, manage, maxsize, minsize, overrideredirect, positionfrom, protocol, resizable, sizefrom, stackorder, state, title, transient, or withdraw} test wm-1.3 {Tk_WmObjCmd procedure, miscellaneous errors} -returnCodes error -body { wm command } -result {wrong # args: should be "wm option window ?arg ...?"} test wm-1.4 {Tk_WmObjCmd procedure, miscellaneous errors} -returnCodes error -body { wm aspect bogus } -result {bad window path name "bogus"} test wm-1.5 {Tk_WmObjCmd procedure, miscellaneous errors} -body { |
︙ | ︙ | |||
720 721 722 723 724 725 726 727 728 729 730 731 732 733 | lappend result [wm group .t] wm group .t . lappend result [wm group .t] wm group .t {} lappend result [wm group .t] } -result [list {} . {}] ### wm iconbitmap ### test wm-iconbitmap-1.1 {usage} -returnCodes error -body { wm iconbitmap } -result {wrong # args: should be "wm option window ?arg ...?"} test wm-iconbitmap-1.2.1 {usage} -constraints unix -returnCodes error -body { wm iconbitmap .t 12 13 | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 | lappend result [wm group .t] wm group .t . lappend result [wm group .t] wm group .t {} lappend result [wm group .t] } -result [list {} . {}] ### wm iconbadge ### test wm-iconbadge-1.1 {usage} -body { wm iconbadge } -returnCodes error -result {wrong # args: should be "wm option window ?arg ...?"} test wm-iconbadge-1.2 {usage} -body { frame .f set ::tk::icons::base_icon(.f) icon wm iconbadge .f icon } -cleanup { destroy .f unset ::tk::icons::base_icon(.f) } -returnCodes error -result {window ".f" isn't a top-level window} test wm-iconbadge-1.3 {::tk::icons::base_icon($win) must be set on X11} -constraints { x11 } -setup { unset -nocomplain ::tk::icons::base_icon(.) } -body { wm iconbadge . ! } -returnCodes error -result {::tk::icons::base_icon(.) must be set on X11} test wm-iconbadge-1.4 {::tk::icons::base_icon($win) must be a Tk photo on X11} -constraints { x11 } -setup { catch {image delete book} } -body { set ::tk::icons::base_icon(.) book wm iconbadge . 27 } -returnCodes error -result {can't use "book" as iconphoto: not a photo image} test wm-iconbadge-1.5 {illegal badge number} -body { image create photo book -data { R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAAC wAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IM QCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc 0yv+DVSEUuFxIAOw== } set ::tk::icons::base_icon(.) book wm iconbadge . illegal } -cleanup { image delete book } -returnCodes error -result {can't use "illegal" as icon badge} test wm-iconbadge-1.6 {non-integer badge number} -body { image create photo book -data { R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAAC wAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IM QCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc 0yv+DVSEUuFxIAOw== } set ::tk::icons::base_icon(.) book wm iconbadge . 3.2 } -cleanup { image delete book } -returnCodes error -result {can't use "3.2" as icon badge} test wm-iconbadge-1.7 {negative or zero badge number} -body { image create photo book -data { R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAAC wAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IM QCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc 0yv+DVSEUuFxIAOw== } set ::tk::icons::base_icon(.) book wm iconbadge . 0 } -cleanup { image delete book } -returnCodes error -result {can't use "0" as icon badge} test wm-iconbadge-1.8 {usage, no need to call iconphoto on aqua or win32} -constraints { aquaOrWin32 } -body { wm iconbadge . 3 wm iconbadge . 5000 wm iconbadge . ! wm iconbadge . "" } -result {} ### wm iconbitmap ### test wm-iconbitmap-1.1 {usage} -returnCodes error -body { wm iconbitmap } -result {wrong # args: should be "wm option window ?arg ...?"} test wm-iconbitmap-1.2.1 {usage} -constraints unix -returnCodes error -body { wm iconbitmap .t 12 13 |
︙ | ︙ | |||
876 877 878 879 880 881 882 883 884 885 886 887 888 889 | } -result {wrong # args: should be "wm iconphoto window ?-default? image1 ?image2 ...?"} test wm-iconphoto-1.5.1 {usage} -constraints aquaOrWin32 -returnCodes error -body { wm iconphoto . -default [image create photo -file {}] } -match {glob} -result {failed to create an iconphoto with image *} test wm-iconphoto-1.5.2 {usage} -constraints x11 -body { wm iconphoto . -default [image create photo -file {}] } -result {} # All other iconphoto tests are platform specific ### wm iconposition ### test wm-iconposition-1.1 {usage} -returnCodes error -body { wm iconposition | > | 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 | } -result {wrong # args: should be "wm iconphoto window ?-default? image1 ?image2 ...?"} test wm-iconphoto-1.5.1 {usage} -constraints aquaOrWin32 -returnCodes error -body { wm iconphoto . -default [image create photo -file {}] } -match {glob} -result {failed to create an iconphoto with image *} test wm-iconphoto-1.5.2 {usage} -constraints x11 -body { wm iconphoto . -default [image create photo -file {}] } -result {} # All other iconphoto tests are platform specific ### wm iconposition ### test wm-iconposition-1.1 {usage} -returnCodes error -body { wm iconposition |
︙ | ︙ |
Changes to unix/tkUnixWm.c.
︙ | ︙ | |||
410 411 412 413 414 415 416 417 418 419 420 421 422 423 | Tcl_Obj *const objv[]); static int WmGridCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int WmGroupCmd(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[]); static int WmIconifyCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int WmIconmaskCmd(Tk_Window tkwin, TkWindow *winPtr, | > > > | 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 | Tcl_Obj *const objv[]); static int WmGridCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); 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[]); static int WmIconifyCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int WmIconmaskCmd(Tk_Window tkwin, TkWindow *winPtr, |
︙ | ︙ | |||
1012 1013 1014 1015 1016 1017 1018 | int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window)clientData; static const char *const optionStrings[] = { "aspect", "attributes", "client", "colormapwindows", "command", "deiconify", "focusmodel", "forget", | | | | 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 | int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window)clientData; static const char *const optionStrings[] = { "aspect", "attributes", "client", "colormapwindows", "command", "deiconify", "focusmodel", "forget", "frame", "geometry", "grid", "group", "iconbadge", "iconbitmap", "iconify", "iconmask", "iconname", "iconphoto", "iconposition", "iconwindow", "manage", "maxsize", "minsize", "overrideredirect", "positionfrom", "protocol", "resizable", "sizefrom", "stackorder", "state", "title", "transient", "withdraw", NULL }; 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_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, WMOPT_PROTOCOL, WMOPT_RESIZABLE, WMOPT_SIZEFROM, WMOPT_STACKORDER, WMOPT_STATE, WMOPT_TITLE, WMOPT_TRANSIENT, WMOPT_WITHDRAW }; int index; const char *argv1; |
︙ | ︙ | |||
1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 | return WmFrameCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_GEOMETRY: return WmGeometryCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_GRID: return WmGridCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_GROUP: return WmGroupCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONBITMAP: return WmIconbitmapCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONIFY: return WmIconifyCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONMASK: return WmIconmaskCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONNAME: | > > | 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 | return WmFrameCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_GEOMETRY: return WmGeometryCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_GRID: 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: return WmIconifyCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONMASK: return WmIconmaskCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONNAME: |
︙ | ︙ | |||
2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 | wmPtr->hints.flags |= WindowGroupHint; wmPtr->leaderName = (char *)ckalloc(objv[3]->length + 1); strcpy(wmPtr->leaderName, argv3); } UpdateHints(winPtr); return TCL_OK; } /* *---------------------------------------------------------------------- * * WmIconbitmapCmd -- * * This function is invoked to process the "wm iconbitmap" Tcl command. | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 | wmPtr->hints.flags |= WindowGroupHint; wmPtr->leaderName = (char *)ckalloc(objv[3]->length + 1); strcpy(wmPtr->leaderName, argv3); } UpdateHints(winPtr); return TCL_OK; } /* *---------------------------------------------------------------------- * * 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 *tkWin, /* Toplevel to work with */ Tcl_Interp *interp, /* Current interpreter. */ int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { (void) tkWin; char cmd[4096]; if (objc < 4) { Tcl_WrongNumArgs(interp, 2, objv, "window badge"); return TCL_ERROR; } 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) { return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------- * * WmIconbitmapCmd -- * * This function is invoked to process the "wm iconbitmap" Tcl command. |
︙ | ︙ |
Changes to win/makefile.vc.
︙ | ︙ | |||
356 357 358 359 360 361 362 | !if $(TK_NO_DEPRECATED) /DTK_NO_DEPRECATED=1 !endif PRJ_DEFINES = /DBUILD_ttk $(CONFIG_DEFS) /Dinline=__inline /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE # Additional Link libraries needed beyond those in rules.vc | | | 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 | !if $(TK_NO_DEPRECATED) /DTK_NO_DEPRECATED=1 !endif PRJ_DEFINES = /DBUILD_ttk $(CONFIG_DEFS) /Dinline=__inline /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE # Additional Link libraries needed beyond those in rules.vc PRJ_LIBS = netapi32.lib gdi32.lib user32.lib userenv.lib winspool.lib shell32.lib ole32.lib uuid.lib #--------------------------------------------------------------------- # TkTest flags #--------------------------------------------------------------------- !if "$(TESTPAT)" != "" TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT) |
︙ | ︙ |
Changes to win/tkWinWm.c.
︙ | ︙ | |||
9 10 11 12 13 14 15 | * Copyright © 1995-1997 Sun Microsystems, Inc. * Copyright © 1998-2000 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ | | | > > | > | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | * Copyright © 1995-1997 Sun Microsystems, Inc. * Copyright © 1998-2000 Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ #include <windows.h> #include <wtypes.h> #include <shobjidl.h> #include <shlguid.h> #include <shellapi.h> #include "tkWinInt.h" #include "tkWinIco.h" /* * These next two defines are only valid on Win2K/XP+. */ #ifndef WS_EX_LAYERED #define WS_EX_LAYERED 0x00080000 #endif |
︙ | ︙ | |||
342 343 344 345 346 347 348 349 350 351 352 353 354 355 | */ static int initialized; /* Flag indicating whether module has been * initialized. */ TCL_DECLARE_MUTEX(winWmMutex) /* * Forward declarations for functions defined in this file: */ static int ActivateWindow(Tcl_Event *evPtr, int flags); static void ConfigureTopLevel(WINDOWPOS *pos); static void GenerateConfigureNotify(TkWindow *winPtr); | > > > > > > > > > > | 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 | */ static int initialized; /* Flag indicating whether module has been * initialized. */ TCL_DECLARE_MUTEX(winWmMutex) /* * The following records the "TaskbarButtonCreated" message ID * for overlay icons. */ static UINT TaskbarButtonCreatedMessageId = WM_NULL; /* Reference to taskbarlist API for overlay icons. */ ITaskbarList3 *ptbl; /* * Forward declarations for functions defined in this file: */ static int ActivateWindow(Tcl_Event *evPtr, int flags); static void ConfigureTopLevel(WINDOWPOS *pos); static void GenerateConfigureNotify(TkWindow *winPtr); |
︙ | ︙ | |||
428 429 430 431 432 433 434 435 436 437 438 439 440 441 | Tcl_Obj *const objv[]); static int WmGridCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int WmGroupCmd(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[]); static int WmIconifyCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int WmIconmaskCmd(Tk_Window tkwin, | > > > | 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 | Tcl_Obj *const objv[]); static int WmGridCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); 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[]); static int WmIconifyCmd(Tk_Window tkwin, TkWindow *winPtr, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]); static int WmIconmaskCmd(Tk_Window tkwin, |
︙ | ︙ | |||
1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 | tsdPtr = (ThreadSpecificData *)Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!tsdPtr->initialized) { return; } tsdPtr->initialized = 0; UnregisterClassW(TK_WIN_TOPLEVEL_CLASS_NAME, hInstance); } /* *-------------------------------------------------------------- * * TkWmNewWindow -- | > > > > > > | 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 | tsdPtr = (ThreadSpecificData *)Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (!tsdPtr->initialized) { return; } tsdPtr->initialized = 0; /* * COM library cleanup. */ CoUninitialize(); UnregisterClassW(TK_WIN_TOPLEVEL_CLASS_NAME, hInstance); } /* *-------------------------------------------------------------- * * TkWmNewWindow -- |
︙ | ︙ | |||
1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 | WmInfo *wmPtr = winPtr->wmInfoPtr; HWND parentHWND, oldWrapper = wmPtr->wrapper; HWND child, nextHWND, focusHWND; int x, y, width, height, state; WINDOWPLACEMENT place; HICON hSmallIcon = NULL; HICON hBigIcon = NULL; Tcl_DString titleString; int *childStateInfo = NULL; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (winPtr->window == None) { /* | > | 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 | WmInfo *wmPtr = winPtr->wmInfoPtr; HWND parentHWND, oldWrapper = wmPtr->wrapper; HWND child, nextHWND, focusHWND; int x, y, width, height, state; WINDOWPLACEMENT place; HICON hSmallIcon = NULL; HICON hBigIcon = NULL; HRESULT hr; Tcl_DString titleString; int *childStateInfo = NULL; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); if (winPtr->window == None) { /* |
︙ | ︙ | |||
2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 | if (tsdPtr->firstWindow) { tsdPtr->firstWindow = 0; SetActiveWindow(wmPtr->wrapper); } else if (focusHWND) { SetFocus(focusHWND); } } /* *-------------------------------------------------------------- * * TkWmMapWindow -- * | > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 | if (tsdPtr->firstWindow) { tsdPtr->firstWindow = 0; SetActiveWindow(wmPtr->wrapper); } else if (focusHWND) { SetFocus(focusHWND); } /* * Initialize hooks for overlay icon. * Start with TaskbarButtonCreated message. */ TaskbarButtonCreatedMessageId = RegisterWindowMessage(TEXT("TaskbarButtonCreated")); /* * In case the application is run elevated, allow the * TaskbarButtonCreated message through. */ ChangeWindowMessageFilter(TaskbarButtonCreatedMessageId, MSGFLT_ADD); /* * Load COM library for icon overlay. */ hr = CoInitialize(0); if (SUCCEEDED(hr)) { hr = CoCreateInstance(&CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, &IID_ITaskbarList3, &ptbl); if (FAILED(hr)) { printf("Unable to initialize ITaskbarList3 API"); ptbl->lpVtbl->Release(NULL); ptbl = NULL; } } } /* *-------------------------------------------------------------- * * TkWmMapWindow -- * |
︙ | ︙ | |||
2609 2610 2611 2612 2613 2614 2615 | int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window)clientData; static const char *const optionStrings[] = { "aspect", "attributes", "client", "colormapwindows", "command", "deiconify", "focusmodel", "forget", "frame", | | | | 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 | int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument objects. */ { Tk_Window tkwin = (Tk_Window)clientData; static const char *const optionStrings[] = { "aspect", "attributes", "client", "colormapwindows", "command", "deiconify", "focusmodel", "forget", "frame", "geometry", "grid", "group", "iconbadge", "iconbitmap", "iconify", "iconmask", "iconname", "iconphoto", "iconposition", "iconwindow", "manage", "maxsize", "minsize", "overrideredirect", "positionfrom", "protocol", "resizable", "sizefrom", "stackorder", "state", "title", "transient", "withdraw", NULL }; 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_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, WMOPT_PROTOCOL, WMOPT_RESIZABLE, WMOPT_SIZEFROM, WMOPT_STACKORDER, WMOPT_STATE, WMOPT_TITLE, WMOPT_TRANSIENT, WMOPT_WITHDRAW |
︙ | ︙ | |||
2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 | return WmFrameCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_GEOMETRY: return WmGeometryCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_GRID: return WmGridCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_GROUP: return WmGroupCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONBITMAP: return WmIconbitmapCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONIFY: return WmIconifyCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONMASK: return WmIconmaskCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONNAME: | > > | 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 | return WmFrameCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_GEOMETRY: return WmGeometryCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_GRID: 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: return WmIconifyCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONMASK: return WmIconmaskCmd(tkwin, winPtr, interp, objc, objv); case WMOPT_ICONNAME: |
︙ | ︙ | |||
3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 | } return TCL_OK; } /* *---------------------------------------------------------------------- * * WmIconbitmapCmd -- * * This function is invoked to process the "wm iconbitmap" Tcl command. * See the user documentation for details on what it does. * * Results: * A standard Tcl result. | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 | } return TCL_OK; } /* *---------------------------------------------------------------------- * * 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( Tk_Window tkwin, /* 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. */ { HWND hwnd; Tk_PhotoHandle photo; Tk_PhotoImageBlock block; int width, height; HICON overlayicon; (void) winPtr; int badgenumber; char *badgestring = NULL; char photoname[4096]; LPCWSTR string; HRESULT hr; Tk_Window badgewindow; WmInfo *wmPtr; if (objc < 4) { Tcl_WrongNumArgs(interp, 2, objv, "window badge"); return TCL_ERROR; } /* * Parse args, get native wrapper window, and determine image. */ badgewindow = Tk_NameToWindow(interp, Tcl_GetString(objv[2]), tkwin); wmPtr = ((TkWindow *) badgewindow)->wmInfoPtr; hwnd = wmPtr->wrapper; badgestring = Tcl_GetString(objv[3]); badgenumber = atoi(badgestring); if (badgenumber > 9) { strcpy(photoname, "::tk::icons::9plus-badge"); } else { strcpy(photoname, "::tk::icons::"); strcat(photoname, badgestring); strcat(photoname, "-badge"); } /* * If badgestring is empty string, remove icon. */ if (strcmp("", badgestring) == 0) { ptbl->lpVtbl->SetOverlayIcon(ptbl, hwnd, NULL, NULL); return TCL_OK; } /* * If photo does not exist, return error. This means we do not have * to test for decimal or negative values; no photo for such values * is present. */ photo = Tk_FindPhoto(interp, photoname); if (photo == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't use \"%s\" as icon badge", badgestring)); return TCL_ERROR; } /* * We have found the image. Convert to icon. */ Tk_PhotoGetSize(photo, &width, &height); Tk_PhotoGetImage(photo, &block); overlayicon = CreateIcoFromPhoto(width, height, block); if (overlayicon == NULL) { Tcl_SetResult(interp, "Failed to create badge icon", TCL_VOLATILE); return TCL_ERROR; } /* * Place overlay icon on taskbar icon. */ string = L"Alert"; hr = ptbl->lpVtbl->SetOverlayIcon(ptbl, hwnd, overlayicon, string); if (hr != S_OK) { Tcl_SetResult(interp, "Failed to display badge icon", TCL_VOLATILE); return TCL_ERROR; } DestroyIcon(overlayicon); return TCL_OK; } /* *---------------------------------------------------------------------- * * WmIconbitmapCmd -- * * This function is invoked to process the "wm iconbitmap" Tcl command. * See the user documentation for details on what it does. * * Results: * A standard Tcl result. |
︙ | ︙ | |||
4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 | DecrIconRefCount(titlebaricon); return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------- * * WmIconpositionCmd -- * * This function is invoked to process the "wm iconposition" Tcl command. * See the user documentation for details on what it does. | > > | 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 | DecrIconRefCount(titlebaricon); return TCL_ERROR; } return TCL_OK; } /* *---------------------------------------------------------------------- * * WmIconpositionCmd -- * * This function is invoked to process the "wm iconposition" Tcl command. * See the user documentation for details on what it does. |
︙ | ︙ |