nswindow

Mac OS X Lion: Detect if another application is running in full screen mode?

为君一笑 提交于 2020-01-01 04:04:10
问题 In a Cocoa app, is there a way to tell if another application currently is in full screen mode? My application is configured to show up on all Spaces and listens for mouseEntered events to order itself to the front. Problem is that when another app is in full screen mode and the user happens to move the mouse across the black area where my app's window is located, it is brought to the front (happens with multiple monitors). I've only seen the above behavior with [self setCollectionBehavior:

Why isn't my sheet attached to the window it's run for?

ぐ巨炮叔叔 提交于 2019-12-31 17:53:00
问题 I have a NIB which contains two windows, one is the app's main window visible at launch and the other is a custom sheet (and therefore not visible at launch). When the sheet is required my controller calls: [NSApp beginSheet: sheetWindow modalForWindow: mainWindow modalDelegate: self didEndSelector: @selector(didEndSheet:returnCode:contextInfo:) contextInfo: nil]; which displays the sheet window and starts a modal session, but the window has a standard Aqua title bar, is not 'connected' to

NSWindow flip animation (easy and universal)

人盡茶涼 提交于 2019-12-31 04:54:05
问题 How to make flip animation for OS X application windows without complex coding? 回答1: Finally, I did it. I have created object that work with NSWindowController objects instead of NSWidows. ALWindowFlipAnimator.h #import <Foundation/Foundation.h> //............................................................................................................ // Shorten macroes: #define FLIPANIMATOR [ALWindowFlipAnimator sharedWindowFlipAnimator] //.................................................

NSWindow textured background with NStextField

北城以北 提交于 2019-12-30 02:36:05
问题 I have a super strange problem. I want a Textured window to have it normal gradient color. I have an NSTextField in this window, the text field is destined to be an URL input field so it need to be large. The problem is that when it is too large (approximately more than 1/3 of the window width) it just switch the textured window to draw a darker version of it gradient. Here is an example project (very simple...) for you to test. http://raven.ipodtutofast.com/test.zip When you will build and

How to get a list of all open NSWindow from all running application?

萝らか妹 提交于 2019-12-28 05:35:33
问题 Is there a way to get list of open or visible NSWindow from mac desktop? 回答1: Note that not all windows are necessarily NSWindows , and that NSWindow only provides an interface to windows in your own address space. The supported way to access every window is the CGWindow API. Take a look at the Son of Grab sample code to see how it's done. 回答2: You can use the accessibility API (accessibility must be enabled under System Preferences for it to work) to get information on windows (and other UI

nswindowcontroller + program execution [duplicate]

限于喜欢 提交于 2019-12-25 04:32:01
问题 This question already has an answer here : Closed 8 years ago . Possible Duplicate: Cocoa: I've got my user's input - Now what? I am trying to use nswindows controller to handle user inputs during the program execution. I am able to get the user input in a nstextfield but when i am clicking on the ok or cancel button, their respective IBAction methods are getting executed and the control is not getting returned to the previous execution place that should execute after the nswindowcontroller

Weird issue with NSWindowController and ARC

Deadly 提交于 2019-12-24 08:57:41
问题 OK, here's a weird situation I'm facing : I've got an NSWindowController subclass, a window in myMainWindow.xib and the AppDelegate.m invoking the NSWindowController like this : myWindowController* controller = [[myWindowController alloc] initWithWindowNibName:@"myMainWindow"]; [controller showWindow:self]; Now here's what : When ARC is set to NO , then the app runs fine and the windows shows up ok, too. When I set ARC to YES - immediately after I set it (and for JUST 1 run) - it shows a

Textured NSWindow with setBackgroundColor has a tinged grey background

五迷三道 提交于 2019-12-24 08:22:41
问题 Basically I want to make a simple about window that has a unified title bar and window (i.e textured) and a white background, like Xcode's about window: So I have a textured window in IB and I have it connected to my app delegate via bindings. I then add this line of code to the app delegate: [about setBackgroundColor:[NSColor whiteColor]]; Whilst for other colours like red and blue the window seems to change colour fine, but whenever I use [NSColor whiteColor] the window looks nowhere near

Disable bringing app window to front. After closing another window

谁说胖子不能爱 提交于 2019-12-23 22:10:28
问题 I have OSX App that contains 2 NSWindowControllers. My problem is described by few steps: Launch the app with 2 windows Select the window of another app Put 1 of the windows in front of anther app window and the second will stay in the bottom. Close the window in the top. The second window will be brought to the top immediately.(I need to fix it and keep my second window in the bottom.) Also I hope to cancel this behavior. Not just make an opposite action like NSApp.hide()/NSApp.deactivate

NSWindow: place part of image outside window

☆樱花仙子☆ 提交于 2019-12-23 16:17:06
问题 I've a Cocoa application with a NSWindow with the style NSBorderlessWindowMask (without titlebar). I would like to place a image in the window but a part of the image should be places outside of the window. How can this be done? 回答1: Here are two articles I found related to what you want to do. Cocoa With Love Example parmanoir.com example The gist is to subclass NSWindow to make it a borderless transparent window, then make a sub view that draws your custom shape and make it the windows