diff options
author | kevin_walzer <kevin_walzer@noemail.net> | 2017-11-28 02:57:45 (GMT) |
---|---|---|
committer | kevin_walzer <kevin_walzer@noemail.net> | 2017-11-28 02:57:45 (GMT) |
commit | 30e8249b1fb6ad52eb49a9d3fa7db6a30f7b4ee3 (patch) | |
tree | ab4d12e4e530dfca6fbf751a267c8b60c724f379 | |
parent | 049994cb09129140eead6db390e9277de7bd0c13 (diff) | |
parent | 965ac1fca626f11c0e88a3c55772ddac779e8080 (diff) | |
download | tk-30e8249b1fb6ad52eb49a9d3fa7db6a30f7b4ee3.zip tk-30e8249b1fb6ad52eb49a9d3fa7db6a30f7b4ee3.tar.gz tk-30e8249b1fb6ad52eb49a9d3fa7db6a30f7b4ee3.tar.bz2 |
Merge in remove_mac_decorations branch
FossilOrigin-Name: 7a7a1baac78ff3d189516179dd474afca07aeb37ae3a06a0430a2a5f7b04e07c
-rw-r--r-- | macosx/README | 33 | ||||
-rw-r--r-- | macosx/tkMacOSXWindowEvent.c | 10 | ||||
-rw-r--r-- | macosx/tkMacOSXWm.c | 54 |
3 files changed, 4 insertions, 93 deletions
diff --git a/macosx/README b/macosx/README index 2822968..bcd5dce 100644 --- a/macosx/README +++ b/macosx/README @@ -178,43 +178,14 @@ Window attribute names: verticalZoom, closeBox, collapseBox, toolbarButton, sideTitlebar, noTitleBar, unifiedTitleAndToolbar, metal, hud, noShadow, doesNotCycle, noActivates, hideOnSuspend, inWindowMenu, ignoreClicks, doesNotHide, - canJoinAllSpaces, moveToActiveSpace, nonActivating, black, dark, light, - gray, red, green, blue, cyan, yellow, magenta, orange, purple, - brown, clear, opacity + canJoinAllSpaces, moveToActiveSpace, nonActivating Note that not all attributes are valid for all window classes. Support for the 3 argument form was added with the Cocoa-based Tk 8.5.7, at the same time support for some legacy Carbon-specific classes and attributes was removed (they are still accepted by the command but no longer have any effect). -The color window attributes (black, dark, red, etc.) and the "opacity" allow one to set the background and opacity of a textured ("metal") window. This allows a Tk window to implement a window without the dividing line between the titlebar and the rest of the window, or the "unified toolbar" effect, which is increasingly standard in Mac applications. An example: - -toplevel .f -tk::unsupported::MacWindowStyle style .f document {metal light opaque closeBox collapseBox resizable standardDocument } - -pack [label .f.f -bg #ababab -text "This is a textured window\nwith opacity and a gray background\nsimilar to other Mac applications"] -fill both -expand yes - -The color attributes correspond to system-defined NSColor constants (e.g., red is [NSColor redColor]. The "light" and "dark" attributes correspond to lightGrayColor and darkGrayColor, respectively (because of the way the attributes are parsed, using "lightgray" and "darkgray" would cause a conflict with the core "gray" attribute). - -Below are the corresponding hex and/or Tk-defined colors that can be used from Tk widgets to match the NSColor-based attributes: - -black #000000 -dark #545454 -light #ababab -white #ffffff -gray #7f7f7f -red #ff0000 -green #00ff00 -blue #0000ff -cyan #00ffff -yellow #ffff00 -magenta #ff00ff -orange #ff8000 -purple #800080 -brown #996633 -clear systemTransparent - -- If you want to use Remote Debugging with Xcode, you need to set the +If you want to use Remote Debugging with Xcode, you need to set the environment variable XCNOSTDIN to 1 in the Executable editor for Wish. That will cause us to force closing stdin & stdout. Otherwise, given how Xcode launches Wish remotely, they will be left open and then Wish & gdb will fight for stdin. diff --git a/macosx/tkMacOSXWindowEvent.c b/macosx/tkMacOSXWindowEvent.c index 4ed5d8c..ccdb937 100644 --- a/macosx/tkMacOSXWindowEvent.c +++ b/macosx/tkMacOSXWindowEvent.c @@ -43,8 +43,7 @@ extern NSString *NSWindowWillOrderOnScreenNotification; extern NSString *NSWindowDidOrderOnScreenNotification; extern NSString *NSWindowDidOrderOffScreenNotification; #endif - -extern BOOL opaqueTag; + @implementation TKApplication(TKWindowEvent) @@ -959,13 +958,8 @@ ConfigureRestrictProc( { NSWindow *w = [self window]; - if (opaqueTag) { - return YES; - } else { - - return (w && (([w styleMask] & NSTexturedBackgroundWindowMask) || + return (w && (([w styleMask] & NSTexturedBackgroundWindowMask) || ![w isOpaque]) ? NO : YES); - } } - (BOOL) wantsDefaultClipping diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index b51fb6b..3ecb651 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -55,9 +55,6 @@ | tkCanJoinAllSpacesAttribute | tkMoveToActiveSpaceAttribute \ | tkNonactivatingPanelAttribute | tkHUDWindowAttribute) -/*Objects for use in setting background color and opacity of window.*/ -NSColor *colorName = NULL; -BOOL opaqueTag = FALSE; static const struct { const UInt64 validAttrs, defaultAttrs, forceOnAttrs, forceOffAttrs; @@ -5247,47 +5244,6 @@ TkUnsupported1ObjCmd( return TCL_ERROR; } - /* - * Iterate through objc/objv to set correct background color and toggle - * opacity of window. - */ - - for (i= 0; i < objc; i++) { - if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*black*")) { - colorName = [NSColor blackColor]; // use #000000 in Tk scripts to match - } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*dark*")) { - colorName = [NSColor darkGrayColor]; //use #545454 in Tk scripts to match - } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*light*")) { - colorName = [NSColor lightGrayColor]; //use #ababab in Tk scripts to match - } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*white*")) { - colorName = [NSColor whiteColor]; //use #ffffff in Tk scripts to match - } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "gray*")) { - colorName = [NSColor grayColor]; //use #7f7f7f in Tk scripts to match - } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*red*")) { - colorName = [NSColor redColor]; //use #ff0000 in Tk scripts to match - } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*green*")) { - colorName = [NSColor greenColor]; //use #00ff00 in Tk scripts to match - } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*blue*")) { - colorName = [NSColor blueColor]; //use #0000ff in Tk scripts to match - } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*cyan*")) { - colorName = [NSColor cyanColor]; //use #00ffff in Tk scripts to match - } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*yellow*")) { - colorName = [NSColor yellowColor]; //use #ffff00 in Tk scripts to match - } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*magenta*")) { - colorName = [NSColor magentaColor]; //use #ff00ff in Tk scripts to match - } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*orange*")) { - colorName = [NSColor orangeColor]; //use #ff8000 in Tk scripts to match - } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*purple*")) { - colorName = [NSColor purpleColor]; //use #800080 in Tk scripts to match - } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*brown*")){ - colorName = [NSColor brownColor]; //use #996633 in Tk scripts to match - } else if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*clear*")) { - colorName = [NSColor clearColor]; //use systemTransparent in Tk scripts to match - } - if (Tcl_StringMatch(Tcl_GetString(objv[i]), "*opacity*")) { - opaqueTag = YES; - } - } winPtr = (TkWindow *) Tk_NameToWindow(interp, Tcl_GetString(objv[2]), tkwin); @@ -5669,16 +5625,6 @@ TkMacOSXMakeRealWindowExist( [window setMovableByWindowBackground:NO]; } - - /* Set background color and opacity of window if those flags are set. */ - if (colorName != NULL) { - [window setBackgroundColor: colorName]; - } - - if (opaqueTag) { - [window setOpaque: opaqueTag]; - } - [window setDocumentEdited:NO]; wmPtr->window = window; macWin->view = window.contentView; |