Questions tagged [nsalert]

126 questions
2
votes
1 answer

Bolding part of a string in an NSAlert

I'm creating a Mac OS X app and have some issues about formatting strings on an NSAlert. I want the informative text to be formatted as follows : something something something something -------something bold in the middle--------- other things…
2
votes
1 answer

Running NSAlert within NSPopover

we are developing a menu bar item app, and I'd love to write a NSAlert category which shows the alert within a NSPopover, that appears below the NSStatusItem. So far, the category implements the following new method: - (void)…
Raffael
  • 1,119
  • 10
  • 20
2
votes
2 answers

Calling an NSAlert from didEndSelector of another NSAlert

I need to bring up an NSAlert based on the response from another NSAlert. However, when I try to call it from the didEndSelector of the first one, all kinds of nasty things happen (like my document window disappearing and warnings about ordering…
toastie
  • 1,934
  • 3
  • 22
  • 35
2
votes
1 answer

osx Add inputs to NSAlert

I would like to use a NSAlert in my OSX application to deal with user authentication. The answer to this question pop up style dialog covers the basics but I can't figure out how to expand a accessoryView to include two inputs and a label for…
ThunderHorse
  • 365
  • 1
  • 4
  • 18
1
vote
1 answer

Response buttons not aligned on right for NSAlert

I've an NSAlert with an accessory view and three buttons, the buttons aren't aligned to right (for LTR system) but seems to expand to the width of accessory view as shown below Also removing the accessory view the three buttons aren't correctly…
dafi
  • 3,492
  • 2
  • 28
  • 51
1
vote
1 answer

How do I set the text in the title bar of an NSAlert modal dialog

I am starting with Swift and Cocoa under MacOS and I am writing a simple Hello World app with an NSAlert modal dialog. Now, it seems standard that these dialog boxes do not have a title in the title bar, which I find problematic because the user…
amsmath
  • 119
  • 7
1
vote
2 answers

NSAlert won't disappear

I'm using a simple NSAlert based on Apple's sample code, and while it displays fine, it never disappears. Code: void DisplayAlert() { NSAlert *alert = [[NSAlert alloc] init]; NSLog(@"TEST"); [alert addButtonWithTitle:@"OK"]; [alert…
ashgromnies
  • 3,266
  • 4
  • 27
  • 43
1
vote
1 answer

NSAlert - Added Buttons not appearing in the correct Order

I'm trying to create an NSAlert with 2 buttons. let a = NSAlert() a.messageText = "Do you want go to A or B?" a.alertStyle = .informational a.addButton(withTitle: "Yes") a.addButton(withTitle: "No") …
techno
  • 6,100
  • 16
  • 86
  • 192
1
vote
1 answer

NSAlert prompting for text input spawned by a process running as root

I have a process that runs as root in the background. When a certain even occurs, I have it pop up an NSAlert with an NSTextField on it so the user can provide some info. However, the user is unable to click on the TextField or type anything into…
Tagnal
  • 56
  • 6
1
vote
1 answer

Cocoa NSAlert does not show alert as sheet

I have the following code which expects to show alert as sheet in AppDelegate.m. - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender { if ([self.socket.inputStream streamStatus] == 2) { NSStoryboard…
xanadu6291
  • 931
  • 10
  • 20
1
vote
1 answer

OSX NSTextView becomes uneditable after showing NSAlert,NSOpenPanel

I've got a NSTextView in my view that works as it should, but when I show a NSAlert and close it, it becomes uneditable (with text still selectable). The NSAlert is a save/cancel alert that updates the textView's string when the user selects save,…
Steven B.
  • 1,429
  • 2
  • 19
  • 38
1
vote
0 answers

Application crash when clicking NSButton of NSAlert's accessoryView

I'm trying to add an accessory view to an NSAlert with a button on it. When you click on the button in the alert, it should print some text to the console. The problem is that the application crashes when I don't write the name of the variable that…
BoilingFire
  • 191
  • 1
  • 9
1
vote
0 answers

Xcode Error: Value of type 'int' has no member 'Type' / but what member should I use in that situation?

what member should I use in that situation? let alertController = NSAlert(title: nil, message: "Place Not Found", preferredStyle: NSAlertFirstButtonReturn.Type) the whole block: if localSearchResponse == nil{ let alertController…
Ezekiel
  • 91
  • 11
1
vote
0 answers

The added NSTextField on NSAlert doesn't allow to type text

I have used the following code to add a NSTextField onto the NSAlert successfully: NSAlert *alert = [NSAlert alertWithMessageText: @"Password" defaultButton:@"OK" …
1
vote
2 answers

Set level for NSAlert in Cocoa

In my application I've subclassed the NSWindow and set the window level as 25. Since the window level is 25 the alert box and error dialog box were being hidden by the window. Is there any chance to set the level of NSAlert
user3748791
  • 31
  • 1
  • 5
1 2 3
8 9