diff options
author | Kevin Walzer <kw@codebykevin.com> | 2019-06-21 12:03:28 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2019-06-21 12:03:28 (GMT) |
commit | 29eb13819fbe92822a05cd43e696c81b77ce1ac4 (patch) | |
tree | 99d88cd508d14790684b221b535a8a3bed927b84 /macosx | |
parent | aea98214f4498a5a6aed07652911d3643f7331da (diff) | |
download | tk-29eb13819fbe92822a05cd43e696c81b77ce1ac4.zip tk-29eb13819fbe92822a05cd43e696c81b77ce1ac4.tar.gz tk-29eb13819fbe92822a05cd43e696c81b77ce1ac4.tar.bz2 |
Documentation cleanup and removal of redundant constants; thanks to Christopher Chavez for reports and patch
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/README | 29 | ||||
-rw-r--r-- | macosx/tkMacOSXConstants.h | 14 |
2 files changed, 14 insertions, 29 deletions
diff --git a/macosx/README b/macosx/README index c2fa040..3e8b031 100644 --- a/macosx/README +++ b/macosx/README @@ -1,4 +1,4 @@ -Tcl/Tk macOS README +Tcl/Tk macOS README ---------------------- This is the README file for the macOS/Darwin version of Tcl/Tk. @@ -26,7 +26,7 @@ before asking on the list, many questions have already been answered). --------------------------- - There are two versions of Tk available on macOS: TkAqua using the native -aqua widgets and look&feel, and TkX11 using the traditional unix X11 wigets. +aqua widgets and look&feel, and TkX11 using the traditional unix X11 widgets. TkX11 requires an X11 server to be installed, such as Apple's X11 (which is available as an optional or default install on recent macOS). TkAqua and TkX11 can be distinguished at runtime via [tk windowingsystem]. @@ -490,7 +490,7 @@ The macOS Tk application does not call the [NSApp run] method at all. Instead it uses the event loop built in to Tk. So the application must take care to replicate the important features of the method ourselves. The way that autorelease pools are handled is -discussed in 4.2 below. Here we discuss the event handling itself. +discussed in 5.2 below. Here we discuss the event handling itself. The Tcl event loop simply consists of repeated calls to TclDoOneEvent. Each call to TclDoOneEvent begins by collecting all pending events from @@ -523,7 +523,7 @@ event to the Tcl queue. In order to carry out the job of managing autorelease pools, which would normally be handled by the [NSApp run] method, a private -NSAUtoreleasePool* property is added to the TkApplication subclass of +NSAutoreleasePool* property is added to the TkApplication subclass of NSApplication. The TkpInit function calls [NSApp _setup] which initializes this property by creating an NSAutoreleasePool prior to calling [NSApp finishLaunching]. This mimics the behavior of the @@ -548,7 +548,7 @@ in nested calls to CheckProc. One additional minor caveat for developers is that there are several steps of the Tk initialization which precede the call to TkpInit. Notably, the font package is initialized first. Since there is no -NSAUtoreleasePool in scope prior to calling TkpInit, the functions +NSAutoreleasePool in scope prior to calling TkpInit, the functions called in these preliminary stages need to create and drain their own NSAutoreleasePools whenever they call methods of Appkit objects (e.g. NSFont). @@ -568,7 +568,7 @@ window. (Normally, the clipping rectangle is the same as the bounding rectangle, but drawing can be clipped to a smaller rectangle by calling TkpClipDrawableToRect.) The aboveVisRgn is the intersection of the window's bounding rectangle with the bounding rectangle of the -parent window. Much of the code in tkMacOSXSubindows.c is devoted to +parent window. Much of the code in tkMacOSXSubwindows.c is devoted to rebuilding these clipping regions whenever something changes in the layout of the windows. This turns out to be a tricky thing to do and it is extremely prone to errors which can be difficult to trace. @@ -663,16 +663,15 @@ 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. Virtual events on 10.14 ---------------------------- +6.0 Virtual events on 10.14 +~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 supports Dark -Mode by having the window decorations, menus, and dialogs automatically -take on the appropriate appearance when the system appearance is changed. -Because the window content itself is drawn by Tk, it will not change when -the system mode changes. - +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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -703,7 +702,7 @@ that LaunchServices is launching the correct Wish.app. Instructions for doing this are provided below. The command line tool which manages the LaunchServices database has -an amazingly unwieldy path name. So, first, run this command: +an amazingly unwieldy path name. So, first, run this command: alias lsregister='/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister' diff --git a/macosx/tkMacOSXConstants.h b/macosx/tkMacOSXConstants.h index 0badf1a..8ef535c 100644 --- a/macosx/tkMacOSXConstants.h +++ b/macosx/tkMacOSXConstants.h @@ -79,22 +79,8 @@ #define NSInformationalAlertStyle NSAlertStyleInformational #define NSCriticalAlertStyle NSAlertStyleCritical #define NSCenterTextAlignment NSTextAlignmentCenter -#define NSDeviceIndependentModifierFlagsMask NSEventModifierFlagDeviceIndependentFlagsMask -#define NSCommandKeyMask NSEventModifierFlagCommand -#define NSShiftKeyMask NSEventModifierFlagShift -#define NSAlphaShiftKeyMask NSEventModifierFlagCapsLock -#define NSAlternateKeyMask NSEventModifierFlagOption -#define NSControlKeyMask NSEventModifierFlagControl -#define NSNumericPadKeyMask NSEventModifierFlagNumericPad -#define NSFunctionKeyMask NSEventModifierFlagFunction -#define NSKeyUp NSEventTypeKeyUp -#define NSKeyDown NSEventTypeKeyDown -#define NSFlagsChanged NSEventTypeFlagsChanged -#define NSAlphaShiftKeyMask NSEventModifierFlagCapsLock -#define NSShiftKeyMask NSEventModifierFlagShift #define NSAnyEventMask NSEventMaskAny #define NSApplicationDefinedMask NSEventMaskApplicationDefined -#define NSTexturedBackgroundWindowMask NSWindowStyleMaskTexturedBackground #define NSUtilityWindowMask NSWindowStyleMaskUtilityWindow #define NSNonactivatingPanelMask NSWindowStyleMaskNonactivatingPanel #define NSDocModalWindowMask NSWindowStyleMaskDocModalWindow |