cocoa

NSView mouse events after adding subview

安稳与你 提交于 2021-02-19 02:56:06
问题 After I add a subview to NSView, my mouse events respond to the area of NSView minus the addedSubVIew. How can I avoid that? I want it to respond on all of the superview. Thanks. 回答1: You can also implement the hitTest: method in the container view. - (NSView *) hitTest: (NSPoint) aPoint { return [super hitTest:aPoint] ? self : nil; } Now only the container view can receive the mouse events. 回答2: You can override the subviews [NSView hitTest:] method and return the superview. - (NSView *)

Mac App Sandbox Group Container problems

百般思念 提交于 2021-02-19 01:58:07
问题 I'm having some trouble with two Sandboxed applications in one Application Group. In my Entitlements file i have the following: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/ PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.application-groups</key> <array> <string>TEAM_ID.com.Company.AppName</string> </array> </dict> </plist> Where 'Company' and

Difference between innerhtml and outerhtml in cocoa WebView

时间秒杀一切 提交于 2021-02-18 22:39:30
问题 I am using cocoa webview for rich text editing in my application. Just confused with innerHtml and outerHtml method avaiable in webkit. Can anyone explain what is the difference between [(DOMHTMLElement *)[[[webView mainFrame] DOMDocument] documentElement] outerHTML]; AND [(DOMHTMLElement *)[[[webView mainFrame] DOMDocument] documentElement] outerText]; 回答1: innerHTML is a property of a DOM element that represents the HTML inside the element, i.e. between the opening and closing tags. It has

NSTextFinder action on NSTextView

筅森魡賤 提交于 2021-02-18 17:29:09
问题 I'm trying to capture all the NSTextFinderClient calls on my custom NSTextView subclass. The show action is called on my -(void)performTextFinderAction:(id)sender override, but for find next, find previous, etc. it's not called. Any ideas? Thanks! Edit: If you create a new project and drag an NSTextView from interface builder, command-g and command-shift-g (find next and find previous) don't work when the find bar is first responder. Why is this? I need a custom subclass of NSTextView to

NSTextFinder action on NSTextView

孤街浪徒 提交于 2021-02-18 17:28:27
问题 I'm trying to capture all the NSTextFinderClient calls on my custom NSTextView subclass. The show action is called on my -(void)performTextFinderAction:(id)sender override, but for find next, find previous, etc. it's not called. Any ideas? Thanks! Edit: If you create a new project and drag an NSTextView from interface builder, command-g and command-shift-g (find next and find previous) don't work when the find bar is first responder. Why is this? I need a custom subclass of NSTextView to

Setting the front most window using accessibility API

浪子不回头ぞ 提交于 2021-02-18 07:35:09
问题 I want to set a certain window, from an external app (for example textedit), to be front most. I can successfully get a reference to the app itself using GetFrontProcess, and check whether it is front most. If it is not, I can use setFrontProcess to make it focussed. I can then use the the accessibility API to examine all the windows under that application. I am checking that a certain window exists, and if so I compare it against the front most window of the application: //get the front

Setting the front most window using accessibility API

萝らか妹 提交于 2021-02-18 07:32:24
问题 I want to set a certain window, from an external app (for example textedit), to be front most. I can successfully get a reference to the app itself using GetFrontProcess, and check whether it is front most. If it is not, I can use setFrontProcess to make it focussed. I can then use the the accessibility API to examine all the windows under that application. I am checking that a certain window exists, and if so I compare it against the front most window of the application: //get the front

Setting the front most window using accessibility API

蓝咒 提交于 2021-02-18 07:32:13
问题 I want to set a certain window, from an external app (for example textedit), to be front most. I can successfully get a reference to the app itself using GetFrontProcess, and check whether it is front most. If it is not, I can use setFrontProcess to make it focussed. I can then use the the accessibility API to examine all the windows under that application. I am checking that a certain window exists, and if so I compare it against the front most window of the application: //get the front

mouseover detection in NSTableView's NSCell?

こ雲淡風輕ζ 提交于 2021-02-18 06:21:44
问题 I am wanting to change the text background color on a tableview's cell when it is hovered upon, similar to how AddressBook "highlights" the label of a contact's element when you mouseover the label names. However I cannot figure out how to accomplish... detecting a mouseover on a particular NSCell and... After detecting the cell his hovered upon, highlighting the text in that cell (not highlighting the entire row as if the user selected that row) As NSCell is not a subclass of NSView this

mouseover detection in NSTableView's NSCell?

五迷三道 提交于 2021-02-18 06:21:08
问题 I am wanting to change the text background color on a tableview's cell when it is hovered upon, similar to how AddressBook "highlights" the label of a contact's element when you mouseover the label names. However I cannot figure out how to accomplish... detecting a mouseover on a particular NSCell and... After detecting the cell his hovered upon, highlighting the text in that cell (not highlighting the entire row as if the user selected that row) As NSCell is not a subclass of NSView this