The tk systray configure command sets one or more options of the systray icon. Configurable options are the same as for the create subcommand. When a single option name is given, the command returns the current valus of this option. When no option is given this command returns the list of all options and their current value.
The tk systray destroy command removes the icon from display and deallocates it.
From a user-interface standpoint, only one icon per interpreter is supported; attempts to create additional icons will return an error. The existing tray icon can be modified with different images and strings to indicate app state. Loading additional interpreters into a running instance of Wish will allow additional icons to be displayed.
image create photo book -data R0lGODlhDwAPAKIAAP//////AP8AAMDAwICAgAAAAAAAAAAAACwAAAAADwAPAAADSQhA2u5ksPeKABKSCaya29d4WKgERFF0l1IMQCAKatvBJ0OTdzzXI1xMB3TBZAvATtB6NSLKleXi3OBoLqrVgc0yv+DVSEUuFxIAOw== tk systray create -image book -text "tk systray sample" -button1 {puts "Here is the tk systray output"} -button3 {puts "here is alternate output"}
Here is an example of modifying the tk systray icon:
image create photo book_page -data R0lGODlhCwAPAKIAAP//////AMDAwICAgAAA/wAAAAAAAAAAACwAAAAACwAPAAADMzi6CzAugiAgDGE68aB0RXgRJBFVX0SNpQlUWfahQOvSsgrX7eZJMlQMWBEYj8iQchlKAAA7 tk systray configure -image book_page -text "Updated sample" -button1 {puts "Different output from the tk systray"} -button3 {puts "and more different output from the tk systray"}
On Windows, the Tk image provided in the -image option must be a photo image. On other platforms either a bitmap image or a photo image may be provided.