diff options
Diffstat (limited to 'macosx/README')
-rw-r--r-- | macosx/README | 82 |
1 files changed, 60 insertions, 22 deletions
diff --git a/macosx/README b/macosx/README index a3f10b6..ac641b1 100644 --- a/macosx/README +++ b/macosx/README @@ -272,20 +272,24 @@ appearance. Part of the implementation of the Dark Mode was to make some of the named NSColors have dynamic values. Apple calls these "semantic colors" because the name does not specify a specific color, but rather refers to the context in which the color should be used. -Tk now provides the following semantic colors as system colors: -systemTextColor, systemTextBackgroundColor, systemSelectedTextColor, -systemSelectedTextBackgroundColor, systemControlTextColor, -systemDisabledControlTextColor, systemLabelColor, systemLinkColor, and -systemControlAccentColor. All of these except the last three were -present in OSX 10.0 (and those three are simulated in systems where they -do not exist). The change in 10.14 was that the RGB color value of -these colors became dynamic, meaning that the color value can change -when the application appearance changes. In particular, when a user -selects Dark Mode in the system preferences these colors change -appearance. For example systemTextColor is dark in Aqua and light in -DarkAqua. One additional color, systemSelectedTabTextColor, does not -exist in macOS but is used by Tk to match the different colors used -for Notebook tab text in different OS versions. +In particular, when a user selects Dark Mode in the system preferences +these colors change appearance. For example systemTextColor is dark in +Aqua and light in DarkAqua. + +Tk now provides colors corresponding to all of the NSColors in Apple's System +ColorList. The convention for naming these colors is that the Tk name is +generated by capitalizing the macOS name and adding the prefix "system". The +System ColorList differs between releases of macOS and some colors, such as +systemLinkColor and systemControlAccentColor, are simulated on older systems +which did not provide them. The following colors are available on all +supported macOS releases, although newer systems will support additional +colors: systemControlAccentColor, systemControlTextColor, +systemDisabledControlTextColor, systemLabelColor, systemLinkColor, +systemPlaceholderTextColor, systemSelectedTextBackgroundColor, +systemSelectedTextColor, systemSeparatorColor, systemTextBackgroundColor, and +systemTextColor. One additional color, systemSelectedTabTextColor, does not +exist in macOS but is used by Tk to match the different colors used for +Notebook tab titles in different OS versions. The default background and foreground colors of most of the Tk widgets have been set to semantic colors, which means that the widgets will change @@ -455,6 +459,20 @@ make overrides to the tk/macosx GNUmakefile, e.g. TCL_FRAMEWORK_DIR=$HOME/Library/Frameworks TCLSH_DIR=$HOME/usr/bin The Makefile variables TCL_FRAMEWORK_DIR and TCLSH_DIR were added with Tk 8.4.3. +- To build a Tcl.framework and Tk.framework for use as subframeworks in another +framework, use the install-embedded target and set SUBFRAMEWORK=1. Set the +DYLIB_INSTALL_DIR variable to the path which should be the install_name path of +the shared library and set the DESTDIR variable to the pathname of a staging +directory where the frameworks will be written. The Tcl framework must be +built first. +For example, running the commands: + make -C ../tcl8.6/macosx install-embedded SUBFRAMEWORK=1 DESTDIR=/tmp/tcltk \ + DYLIB_INSTALL_DIR=/Library/Frameworks/Some.framework/Versions/X.Y/Frameworks/Tcl.framework + make -C macosx install-embedded SUBFRAMEWORK=1 DESTDIR=/tmp/tcltk \ + DYLIB_INSTALL_DIR=/Library/Frameworks/Some.framework/Versions/X.Y/Frameworks/Tk.framework +will produce a Tcl.framework and a Tk.framework usable as subframeworks of +Some.framework. The frameworks will be found in /tmp/tcltk/Frameworks/ + 5. Details regarding the macOS port of Tk. ------------------------------------------- @@ -662,15 +680,35 @@ source and destination rectangles for the scrolling. The embedded windows are redrawn within the DisplayText function by some conditional code which is only used for macOS. -6.0 Virtual events on 10.14 -~~~~~~~~~~~~~~~~~~~~~~~~~~~ +6.0 Virtual events on macOS 10.14 and later +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The 10.14 release added support for system appearance changes, +including a "Dark Mode" that renders all window frames and menus in +dark colors. Tk 8.6.11 provides three virtual events <<LightAqua>>, +<<DarkAqua>> and <<AppearanceChanged>>, to allow you to update your Tk +app's appearance when the system appearance changes. These events are +generated in [NSView effectiveAppearanceChanged], which is called by +the Apple window manager when the General Preferences is changed +either by switching between Light Mode and Dark Mode or by changing +the Accent Color or Highlight Color. + +The <<AppearanceChanged>> virtual event has a data string which can be +accessed with the %d substitution. The format of the data string is +that it consists of 6 words: + "Appearance XXXX Accent YYYY Highlight ZZZZ" +For example, the following code will print the current appearance +name, accent color and highlight color when the <<AppearanceChanged>> +virtual event fires: + +bind . <<AppearanceChanged>> { + array set data [split %d] + puts " Appearance: $data(Appearance)" + puts " Accent: $data(Accent)" + puts " Highlight: $data(Highlight)\n" +} + -10.14 supports system appearance changes, and has added a "Dark Mode" -that casts all window frames and menus as black. Tk 8.6.9 has added two -virtual events, <<LightAqua>> and <<DarkAqua>>, to allow you to update -your Tk app's appearance when the system appearance changes. Just bind -your appearance-updating code to these virtual events and you will see -it triggered when the system appearance toggles between dark and light. 7.0 Mac Services ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |