nswindow

Round corners on a borderless NSWindow

不想你离开。 提交于 2020-01-13 03:41:39
问题 I'm creating an application and I don't want a title bar: If the title remains the same all the time, does it make sense to show it? For example, if an app doesn’t show the names of documents, or any other assets that it opens, and there is plenty of space at the top around other controls to grab onto if you want to move the window around, does the title serve much purpose? The problem is: how do I do this? I tried using [mainWindow setStyleMask:NSBorderlessWindowMask]; but I can't make it

How do I disable the Show Tab Bar menu option in Sierra apps?

≡放荡痞女 提交于 2020-01-12 13:41:15
问题 I've got an app that uses a Toolbar in a NSWindow. I don't want users to be able to customize this toolbar for aesthetic reasons. In Sierra there's a new Menu option that gets inserted into "Menu > View" called Show Tab Bar . How do I disable this? Enabling it only seems to increase the tool bar's height as I don't have extra labels showing under the icons. 回答1: You can also do this on IB, on the Window’s attributes inspector 回答2: On 10.12, you need to now set the following when the window is

iTunes-style NSWindow subclass?

*爱你&永不变心* 提交于 2020-01-09 09:16:12
问题 Is there an open-source library for Cocoa to create a window following iTunes' style? That is the window controls are laid out vertically instead of horizontally: I find it space-saving and good for utility-type applications that doesn't need a window title. 回答1: This quickly hacked away NSWindow delegate should get you started: //VerticalTrafficLightsWindowDelegate.h #import <Cocoa/Cocoa.h> @interface VerticalTrafficLightsWindowDelegate : NSObject <NSWindowDelegate> { NSWindow *window; }

Hide content view of NSApplication window in order to navigate to main screen

≡放荡痞女 提交于 2020-01-06 21:31:44
问题 Initially I have my own setup on application main window, i.e. an image view(for background) and on it I have a set of buttons. Now when user taps on the buttons, respective lesson is launched, i.e. user is being navigated to the corresponding screen, i.e. I add the view to window's content view.... [self.window.contentView addSubview:self.lessonScreen.view]; Actually I know there is an approach of taking a view(custom view) on window, keeping on adding our views to that(for navigation). Then

Hide content view of NSApplication window in order to navigate to main screen

老子叫甜甜 提交于 2020-01-06 21:31:04
问题 Initially I have my own setup on application main window, i.e. an image view(for background) and on it I have a set of buttons. Now when user taps on the buttons, respective lesson is launched, i.e. user is being navigated to the corresponding screen, i.e. I add the view to window's content view.... [self.window.contentView addSubview:self.lessonScreen.view]; Actually I know there is an approach of taking a view(custom view) on window, keeping on adding our views to that(for navigation). Then

Is it proper to archive/unarchive NSWindowController?

☆樱花仙子☆ 提交于 2020-01-06 05:01:40
问题 I'm having a difficult time understanding what's going wrong. I have an NSWindowController with a NSWindow and a NSTextView. I want to archive that NSWindowController and NSWindow (along with all of its controls) to a file. Then, I want to unarchive that same NSWindowController and the NSWindow and all views from the file. But Apple docs say: Note: Although the NSWindow class inherits the NSCoding protocol from NSResponder, the class does not support coding. Legacy support for archivers

App window on top of all windows including others app windows

人盡茶涼 提交于 2020-01-05 07:49:48
问题 I like to have my NSWindow top of everything including other app windows. How this is possible? This is how my custom NSWindow looks like? override init(contentRect: NSRect, styleMask style: NSWindow.StyleMask, backing backingStoreType: NSWindow.BackingStoreType, defer flag: Bool) { super.init(contentRect: contentRect, styleMask: NSWindow.StyleMask.borderless, backing: NSWindow.BackingStoreType.buffered, defer: false) // Manage window appearance and size // this window manages video view

Delphi OS X subclass NSWindow borderless with mouse events

跟風遠走 提交于 2020-01-05 06:01:42
问题 How to create a derived class of NSWindow in delphi firemonkey? I've succeeded in creating a Cocoa window that contains only a webview. (using NSWindow.Wrap, setContentView, orderFront etc) I made it borderless, but the problem is that it does not accept mouse moved events, as described here: Why NSWindow without styleMask:NSTitledWindowMask can not be keyWindow? Is it possible to subclass NSWindow in delphi and override canBecomeKeyWindow? It's not working (compiles, but method not called):

Delphi OS X subclass NSWindow borderless with mouse events

与世无争的帅哥 提交于 2020-01-05 06:00:48
问题 How to create a derived class of NSWindow in delphi firemonkey? I've succeeded in creating a Cocoa window that contains only a webview. (using NSWindow.Wrap, setContentView, orderFront etc) I made it borderless, but the problem is that it does not accept mouse moved events, as described here: Why NSWindow without styleMask:NSTitledWindowMask can not be keyWindow? Is it possible to subclass NSWindow in delphi and override canBecomeKeyWindow? It's not working (compiles, but method not called):

How to get Window reference (CGWindow, NSWindow or WindowRef) from CGWindowID in Swift?

ε祈祈猫儿з 提交于 2020-01-04 05:34:08
问题 How to get Window reference (CGWindow, NSWindow or WindowRef) from CGWindowID in Swift on XCode 7.3 Mac Playground? I referenced from Apple's document - Window Manager Reference, and from the sample code SonofGrab, but I didn't find an answer in obj-C nor Swift. How should I do it? 回答1: This should work for NSWindow from CGWindowID NSWindow * ns_window; ns_window = [NSApp windowWithWindowNumber: windowNumber]; To get CGWindowID from NSWindow use CGWindowID window_id = (CGWindowID)[ns_window