Questions tagged [nsapplication]

NSApplication is the central class in Apple's AppKit framework.

The NSApplication class is the central class in Apple's AppKit framework (). It is responsible for starting the main run loop and provides the central framework for your application’s execution.

References:

178 questions
1
vote
1 answer

How to terminate cocoa app in applicationWillFinishLaunching delegate

I have to show the custom license Agreement dialog to the user before they start using my application.So, I have added new window in my mainMenu.xib and showing that window modally using [NSApp runModalForWindow:licenseWindow]; in…
AmitSri
  • 1,209
  • 1
  • 20
  • 48
1
vote
1 answer

Disabling tooltips globally

Ok, I have used interface builder and added tooltips to all controls. I would like to offer the user a menu item "disable tooltips". How do I disable all tooltips globally on a cocoa application?
Duck
  • 34,902
  • 47
  • 248
  • 470
1
vote
2 answers

NSWindow hide active window and focus on other

How to hide the active current NSWindow A and focus on the last other one B (one level behind the current window) and make it active? I'm trying with this followed code but it does not work (B will become to front window but not…
Quang Nguyen
  • 354
  • 1
  • 5
  • 20
1
vote
0 answers

Change color for setBadgelabel Node Webkit

I am currently trying to make a chat desktop application using nodeJS, angularJs, and nodewebkit. For notifying the user, in the icon in the taskbar, I used setBadgelabel(). How can I change the color of the default badge label by the function…
Amala James
  • 1,336
  • 3
  • 16
  • 32
1
vote
0 answers

CustomView Does not show up in StatusBar

I am trying to make a SystemStatusBar popover for Mac. (Roughly, translating this Cocoa app to a Swift app). However, the view that I am using never shows up and the popup appears in the bottom left of the screen replicating the StatusBarItem. This…
TJ-
  • 14,085
  • 12
  • 59
  • 90
1
vote
1 answer

Always appending file extensions in NSDocument

What would be the best way to always ensure the file saved to disk (or iCloud) contains the default file extension for our document format in an NSDocument based Cocoa app? Background: Users can load legacy files into the app that still use…
cacau
  • 3,606
  • 3
  • 21
  • 42
1
vote
1 answer

How Do I Run Full-Screen Across Multiple Screens in OSX

I am making a Cocoa application that presents a slide show of videos and images. If there are multiple screens connected (to a Mac Mini for example) I want different content to be shown on each screen. Each NSWindow should be full screen on each…
Giles
  • 1,428
  • 11
  • 21
1
vote
1 answer

Launch Daemon Listen for NSWorkspaceDidLaunchApplicationNotification

I have a launch daemon and I would like it to run a function every time an application launches. I'm currently using NSWorkspace to check for the launch of applications. parasited.plist in /Library/LaunchDaemons/
atomikpanda
  • 1,845
  • 5
  • 33
  • 47
1
vote
1 answer

NSApplication mainMenu returns nil

the problem I'm having is I cannot add a menu to my app programmatically! here's where I'm at: in app delegate applicationDidFinishLaunching: create a window and make key and order front. EDIT:( here if I log [NSApplication…
user1411443
1
vote
2 answers

Deactivate agent app after launch in Cocoa

What method should be called to deactivate an app right after it's launch in applicationDidFinishLaunching: delegate method has been called? Or maybe there is a better place to do that? The documentation for deactivate method for NSApplication says…
Eimantas
  • 48,927
  • 17
  • 132
  • 168
1
vote
1 answer

applicationShouldTerminateAfterLastWindowClosed: does not seem to work when the red x is used to close my Cocoa app

I have a small OSX Cocoa app that just bring up an IKPicutreTaker and saves the picture to a file if one is set. I use applicationShouldTerminateAfterLastWindowClosed: to close the application when the pictureTaker is closed. This all works fine…
Mike2012
  • 7,629
  • 15
  • 84
  • 135
1
vote
0 answers

Show Dock icon, but no standard Main Menu

Is it possible to have a Dock icon for the application, but no main menu in the menu bar? Fiddling around with LSUIElement and LSUIBackgroundOnly doesn't lead to my goal. Setting [NSApp setMainMenu:nil] didn't work. EDIT: To be more concrete: I do…
Raffael
  • 1,119
  • 10
  • 20
1
vote
1 answer

can't call beginSheet after OK is pressed in NSSavePanel?

My cocoa program has a save feature, which when user selected the saving destination, I'll have to bring up another NSPanel, to display some sort of status (ie. how long it will take to finished saving the file. Here is my code: -…
Josh
  • 692
  • 2
  • 9
  • 38
1
vote
1 answer

OS X application in full screen mode on two monitor setup

Basically I would like to run OS X application in full screen mode on two monitors. There is no specific layout I would like to accomplish, I would just like to zoom in application to use whole two screens. Only application that I saw behaves that…
Gossamer
  • 309
  • 2
  • 16
1
vote
1 answer

Can I get the actual Menu Bar from an NSRunningApplication?

I'm trying to access the menu of an NSRunningApplication object in OS X. it has an ownsMenuBar @property, however no instance of an actual menu bar (which makes sense). I'm curious, instead, how to get access to that menu-bar that…