macos

NSVisualEffectView with rounded corners

£可爱£侵袭症+ 提交于 2021-02-20 18:56:04
问题 How display a NSVisualEffectView with with rounded corners in OS X? My code to add my NSVisualEffectView: let visualEffectView = NSVisualEffectView(frame: NSMakeRect(0, 0, 300, 300)) visualEffectView.material = NSVisualEffectMaterial.Dark visualEffectView.blendingMode = NSVisualEffectBlendingMode.BehindWindow self.addSubview(visualEffectView) 回答1: You can enable layer backed views for your NSVisualEffectView by setting wantsLayer to true and then set the cornerRadius of the backing layer: let

NSVisualEffectView with rounded corners

情到浓时终转凉″ 提交于 2021-02-20 18:55:07
问题 How display a NSVisualEffectView with with rounded corners in OS X? My code to add my NSVisualEffectView: let visualEffectView = NSVisualEffectView(frame: NSMakeRect(0, 0, 300, 300)) visualEffectView.material = NSVisualEffectMaterial.Dark visualEffectView.blendingMode = NSVisualEffectBlendingMode.BehindWindow self.addSubview(visualEffectView) 回答1: You can enable layer backed views for your NSVisualEffectView by setting wantsLayer to true and then set the cornerRadius of the backing layer: let

pip command not found after installed it

佐手、 提交于 2021-02-20 16:16:25
问题 I'm stuck with an issue. I have a Python script that I would like to run on my OSX but seems that I crossed on many issues. To run the script I should have both Python and Moviepy installed. To install Moviepy I used this command: sudo pip install moviepy The response was: sudo: pip: command not found So I tried to install pip, with the command: sudo easy_install pip And got this answer: Searching for pip Best match: pip 9.0.1 Processing pip-9.0.1-py2.7.egg pip 9.0.1 is already the active

pip command not found after installed it

江枫思渺然 提交于 2021-02-20 16:16:05
问题 I'm stuck with an issue. I have a Python script that I would like to run on my OSX but seems that I crossed on many issues. To run the script I should have both Python and Moviepy installed. To install Moviepy I used this command: sudo pip install moviepy The response was: sudo: pip: command not found So I tried to install pip, with the command: sudo easy_install pip And got this answer: Searching for pip Best match: pip 9.0.1 Processing pip-9.0.1-py2.7.egg pip 9.0.1 is already the active

NSView mouse tracking

这一生的挚爱 提交于 2021-02-20 09:56:00
问题 I'm facing a strange behavior with Cocoa NSView on Mac OS X. I've a custom NSView in a NSView container, this custom NSView tracks mouse movements, clicks, and has a tooltip. When I add a NSView above the described view, I can still see the tooltips even if the view with the tooltip is under, behind and not visible. I'm pretty sure that I misunderstood something in the event handling chain. Any help is really appreciated! 回答1: The core issue is that you are not supposed to have overlapping

NSView mouse tracking

风格不统一 提交于 2021-02-20 09:54:14
问题 I'm facing a strange behavior with Cocoa NSView on Mac OS X. I've a custom NSView in a NSView container, this custom NSView tracks mouse movements, clicks, and has a tooltip. When I add a NSView above the described view, I can still see the tooltips even if the view with the tooltip is under, behind and not visible. I'm pretty sure that I misunderstood something in the event handling chain. Any help is really appreciated! 回答1: The core issue is that you are not supposed to have overlapping

How to create a directory in downloads folder with swift on macos? Permission exception.

谁说我不能喝 提交于 2021-02-20 06:54:50
问题 I am struggling to simply create a folder in the users download directory on macos with this code: static func createFolderInDownloadsDirectory() { let downloadsDirectory = FileManager.default.urls(for: .downloadsDirectory, in: .userDomainMask).first! let downloadsDirectoryWithFolder = downloadsDirectory.appendingPathComponent("FolderToCreate") do { try FileManager.default.createDirectory(at: downloadsDirectoryWithFolder, withIntermediateDirectories: true, attributes: nil) } catch let error

How to create a directory in downloads folder with swift on macos? Permission exception.

浪尽此生 提交于 2021-02-20 06:53:49
问题 I am struggling to simply create a folder in the users download directory on macos with this code: static func createFolderInDownloadsDirectory() { let downloadsDirectory = FileManager.default.urls(for: .downloadsDirectory, in: .userDomainMask).first! let downloadsDirectoryWithFolder = downloadsDirectory.appendingPathComponent("FolderToCreate") do { try FileManager.default.createDirectory(at: downloadsDirectoryWithFolder, withIntermediateDirectories: true, attributes: nil) } catch let error

Link errors using Homebrew's Boost::Log in OSX El Capitan

六眼飞鱼酱① 提交于 2021-02-20 04:39:11
问题 OSX 10.11.3 (El Capitan) I'm getting link errors while building the first example from the Boost::Log tutorial. #include <boost/log/trivial.hpp> int main(int, char*[]) { BOOST_LOG_TRIVIAL(trace) << "A trace severity message"; BOOST_LOG_TRIVIAL(debug) << "A debug severity message"; BOOST_LOG_TRIVIAL(info) << "An informational severity message"; BOOST_LOG_TRIVIAL(warning) << "A warning severity message"; BOOST_LOG_TRIVIAL(error) << "An error severity message"; BOOST_LOG_TRIVIAL(fatal) << "A

Where is the window outlet in an NSDocument

吃可爱长大的小学妹 提交于 2021-02-20 04:23:05
问题 My app was converted from a non-document-based app to a document-based one. I did that by creating a subclass of NSDocument , called Document . I also created a Document.xib and set its "File's Owner" to Document . Now in Document.xib , I can see there is a window outlet in its "File's Owner". I don't have a window outlet defined in Document . Where does it come from? I guess it is from the super class NSDocument , but I have no access to that variable in Document . What's up with this weird