NSAlert accessory view fill horizontal space, respecting margins

2022-11-02 Thread Tor Arne Vestbø via Cocoa-dev
Hi all, I’m trying to get the accessory view of an NSAlert to layout similarity to the the text fields of the messageText and informativeText. That is: *Fill the the available horizontal space of the alert, respecting margins * Including accounting for the different margins

Re: MacOS: nonmodal NSAlert panel

2021-05-12 Thread Ben Kennedy via Cocoa-dev
> On 12 May 2021, at 11:17 am, Carl Hoefs via Cocoa-dev > wrote: > > I'd like to present an informational alert for n seconds then dismiss it > without user interaction. But I don't see any way to dismiss, terminate, > cancel, invalidate, etc. an NSAlert object. I recen

Re: MacOS: nonmodal NSAlert panel

2021-05-12 Thread James Walker via Cocoa-dev
On 5/12/21 11:17 AM, Carl Hoefs via Cocoa-dev wrote: I had thought it was possible on MacOS to run an NSAlert panel nonmodally... I'd like to present an informational alert for n seconds then dismiss it without user interaction. But I don't see any way to dismiss, terminate, cancel

Re: MacOS: nonmodal NSAlert panel

2021-05-12 Thread Keary Suska via Cocoa-dev
; wrote: > > I had thought it was possible on MacOS to run an NSAlert panel nonmodally... > > I'd like to present an informational alert for n seconds then dismiss it > without user interaction. But I don't see any way to dismiss, terminate, > cancel, invalidate, e

Re: MacOS: nonmodal NSAlert panel

2021-05-12 Thread Jens Alfke via Cocoa-dev
> On May 12, 2021, at 11:17 AM, Carl Hoefs via Cocoa-dev > wrote: > > I had thought it was possible on MacOS to run an NSAlert panel nonmodally… Alerts are modal by definition, per the HIG (IIRC). If you want a non-modal panel, it wouldn't be an alert; you'd have to implement

MacOS: nonmodal NSAlert panel

2021-05-12 Thread Carl Hoefs via Cocoa-dev
I had thought it was possible on MacOS to run an NSAlert panel nonmodally... I'd like to present an informational alert for n seconds then dismiss it without user interaction. But I don't see any way to dismiss, terminate, cancel, invalidate, etc. an NSAlert object. I know this is possible

Re: NSAlert runModal in outlineView:acceptDrop crashes with may not be invoked inside of transaction begin/commit pair

2020-10-31 Thread Rob Petrovec via Cocoa-dev
I have an OutlineView. Whenever I drag and drop a child item within the > Outline-View my application crashes when I open do an "NSAlert runModal" like > in the code below: > > - (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id < > NSDraggingInf

NSAlert runModal in outlineView:acceptDrop crashes with may not be invoked inside of transaction begin/commit pair

2020-10-31 Thread Michael Kloske via Cocoa-dev
Hello, I have an OutlineView. Whenever I drag and drop a child item within the Outline-View my application crashes when I open do an "NSAlert runModal" like in the code below: - (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id < NSDraggingInfo >)info item:(id

Re: NSAlert

2018-09-10 Thread Richard Charles
> On Sep 10, 2018, at 12:17 PM, Ben Kennedy wrote: > > Son of a gun. Thanks for elucidating this Richard. Actually Andy Lee was right on when he suggested "it may depend on the setting in System Preferences that governs whether all controls can get keyboard focus". However I could not see

Re: NSAlert

2018-09-10 Thread Ben Kennedy
> On 10 Sep 2018, at 11:06 am, Richard Charles wrote: > > On my development machine running 10.12.6 pressing the spacebar will dismiss > a simple NSAlert. This is because in System Preferences > Keyboard > > Shortcuts > Full Keyboard Access > All Controls was se

Re: NSAlert

2018-09-10 Thread Richard Charles
g > in System Preferences that governs whether all controls can get > keyboard focus. > On Sep 8, 2018, at 6:52 PM, Alex Zavatone wrote: > > Which version of macOS are you running? Thanks for the comments. On my development machine running 10.12.6 pressing the spacebar will dismiss a s

Re: NSAlert

2018-09-08 Thread Alex Zavatone
Which version of macOS are you running? Sent from my iPhone > On Sep 8, 2018, at 5:53 PM, Richard Charles wrote: > > I have a simple NSAlert presented as an attached sheet with a single default > OK button. > > When the spacebar is pressed the alert is dismissed. >

Re: NSAlert

2018-09-08 Thread Andy Lee
us. --Andy On Sat, Sep 8, 2018, at 6:53 PM, Richard Charles wrote: > I have a simple NSAlert presented as an attached sheet with a single > default OK button. > > When the spacebar is pressed the alert is dismissed. > > It this a new thing? > > Is this document

NSAlert

2018-09-08 Thread Richard Charles
I have a simple NSAlert presented as an attached sheet with a single default OK button. When the spacebar is pressed the alert is dismissed. It this a new thing? Is this documented anywhere? --Richard Charles ___ Cocoa-dev mailing list (Cocoa-dev

Re: NSAlert::runModal doesn't work on 10.6

2016-08-24 Thread corbin dunn
> On Aug 23, 2016, at 4:31 PM, dangerwillrobinsondan...@gmail.com wrote: > > > >> On Aug 24, 2016, at 2:56 AM, Andreas Falkenhahn >> wrote: >> >> Is that your personal opinion or is this documented anywhere? > There's not anything to the contrary I've seen. Andreas

Re: NSAlert::runModal doesn't work on 10.6

2016-08-23 Thread dangerwillrobinsondanger
> On Aug 24, 2016, at 2:56 AM, Andreas Falkenhahn > wrote: > > Is that your personal opinion or is this documented anywhere? There's not anything to the contrary I've seen. Look no further than LSUIElement. There is an info plist key that says you have no UI, and

Re: NSAlert::runModal doesn't work on 10.6

2016-08-23 Thread Graham Cox
> On 24 Aug 2016, at 12:52 AM, Andreas Falkenhahn > wrote: > > I really can't use NSApplicationMain() because AFAICS it also expects > to load a NIB file from the app bundle which simply doesn't exist for > my app because I'm not using Xcode at all and everything is set

Re: NSAlert::runModal doesn't work on 10.6

2016-08-23 Thread Andreas Falkenhahn
On 23.08.2016 at 19:30 dangerwillrobinsondan...@gmail.com wrote: > You don't have to have a nib unless your plist says you will. Is that your personal opinion or is this documented anywhere? Apple's documentation of NSApplicationMain() clearly states that this function "loads the main nib file

Re: NSAlert::runModal doesn't work on 10.6

2016-08-23 Thread dangerwillrobinsondanger
It may load it any way. You don't have to have a nib unless your plist says you will. Sent from my iPhone > On Aug 24, 2016, at 12:45 AM, Scott Ribe wrote: > >> On Aug 23, 2016, at 8:52 AM, Andreas Falkenhahn >> wrote: >> >> I really

Re: NSAlert::runModal doesn't work on 10.6

2016-08-23 Thread Andreas Falkenhahn
On 23.08.2016 at 17:45 Scott Ribe wrote: > On Aug 23, 2016, at 8:52 AM, Andreas Falkenhahn > wrote: >> I really can't use NSApplicationMain() because AFAICS it also expects >> to load a NIB file from the app bundle > The nib to load at startup is specified in the

Re: NSAlert::runModal doesn't work on 10.6

2016-08-23 Thread Scott Ribe
On Aug 23, 2016, at 8:52 AM, Andreas Falkenhahn wrote: > > I really can't use NSApplicationMain() because AFAICS it also expects > to load a NIB file from the app bundle The nib to load at startup is specified in the plist, I bet if you leave that entry out, it won't

Re: NSAlert::runModal doesn't work on 10.6

2016-08-23 Thread Andreas Falkenhahn
On 23.08.2016 at 01:17 Graham Cox wrote: >> On 23 Aug 2016, at 1:46 AM, Andreas Falkenhahn >> wrote: >> It is unusual in the way that it's not calling NSApplicationMain() but tries >> to imitate what NSApplicationMain() does. Here goes the code that is executed >> to

Re: NSAlert::runModal doesn't work on 10.6

2016-08-22 Thread Graham Cox
> On 23 Aug 2016, at 1:46 AM, Andreas Falkenhahn wrote: > > It is unusual in the way that it's not calling NSApplicationMain() but tries > to imitate what NSApplicationMain() does. Here goes the code that is executed > to set up the NSApp: There’s your problem. You’re

Re: NSAlert::runModal doesn't work on 10.6

2016-08-22 Thread Andreas Falkenhahn
can rule out the possibility that such a fundamental functionality like "runModal" is broken completely in 10.6 for NSAlert, NSOpenPanel, NSSavePanel... I'm pretty certain that it will work correctly when doing things the proper way using NSApplicationMain(). Still, it must be possible to get t

Re: NSAlert::runModal doesn't work on 10.6

2016-08-22 Thread Ken Thomases
On Aug 22, 2016, at 10:46 AM, Andreas Falkenhahn <andr...@falkenhahn.com> wrote: > > On 22.08.2016 at 17:30 Ken Thomases wrote: > >> On Aug 22, 2016, at 8:26 AM, Andreas Falkenhahn <andr...@falkenhahn.com> >> wrote: > >>> I've created an

Re: NSAlert::runModal doesn't work on 10.6

2016-08-22 Thread Andreas Falkenhahn
On 22.08.2016 at 17:30 Ken Thomases wrote: > On Aug 22, 2016, at 8:26 AM, Andreas Falkenhahn <andr...@falkenhahn.com> > wrote: >> I've created an NSAlert dialog as described here: >> https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Dialog/Tasks/Usin

Re: NSAlert::runModal doesn't work on 10.6

2016-08-22 Thread Ken Thomases
On Aug 22, 2016, at 8:26 AM, Andreas Falkenhahn <andr...@falkenhahn.com> wrote: > > I've created an NSAlert dialog as described here: > https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Dialog/Tasks/UsingAlerts.html#//apple_ref/doc/uid/2871-129009-BCIFAAEJ

Re: NSAlert::runModal doesn't work on 10.6

2016-08-22 Thread じょいすじょん
anything that could help me here. If you have > anything more than just a Google search for "NSAlert 10.6", please > elaborate... (or send a link) > > -- > Best regards, > Andreas Falkenhahnmailto:andr...@falkenhahn.com > H

Re: NSAlert::runModal doesn't work on 10.6

2016-08-22 Thread Steve Mills
On Aug 22, 2016, at 09:04 AM, Andreas Falkenhahn <andr...@falkenhahn.com> wrote: You really think I didn't Google before asking? I certainly did, but so far I haven't found anything that could help me here. If you have anything more than just a Google search for "NSAlert 10.6",

Re: NSAlert::runModal doesn't work on 10.6

2016-08-22 Thread Andreas Falkenhahn
//bfy.tw/7Kcc > there is a great resource here. You really think I didn't Google before asking? I certainly did, but so far I haven't found anything that could help me here. If you have anything more than just a Google search for "NSAlert 10.6", please elaborate... (or send

Re: NSAlert::runModal doesn't work on 10.6

2016-08-22 Thread dangerwillrobinsondanger
> On Aug 22, 2016, at 10:26 PM, Andreas Falkenhahn > wrote: > > Does anybody have an idea > what could cause this behaviour on 10.6 and how I can fix this? http://bfy.tw/7Kcc there is a great resource here. ___ Cocoa-dev

NSAlert::runModal doesn't work on 10.6

2016-08-22 Thread Andreas Falkenhahn
I've created an NSAlert dialog as described here: https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Dialog/Tasks/UsingAlerts.html#//apple_ref/doc/uid/2871-129009-BCIFAAEJ When I run it using [alert runModal]; it shows up correctly but pressing a button doesn't do

Re: NSAlert and threading

2016-05-23 Thread Jens Alfke
> On May 23, 2016, at 2:41 PM, Fritz Anderson wrote: > > Hence the rule that you don’t do _anything_ lengthy on the main (GUI-runloop) > thread. You can see how using a separate thread would solve your problem. > Welcome to 2003. Less dogmatically, you can use

Re: NSAlert and threading

2016-05-23 Thread Fritz Anderson
On 23 May 2016, at 4:14 PM, Tom Doan <t...@estima.com> wrote: > > I have an menu operation which, before it fully executes, pops up > an NSAlert asking a Yes/No question ("Selection Only(Y/N)?") then, > depending upon the answer will either apply to the whole l

NSAlert and threading

2016-05-23 Thread Tom Doan
I have an menu operation which, before it fully executes, pops up an NSAlert asking a Yes/No question ("Selection Only(Y/N)?") then, depending upon the answer will either apply to the whole list or just the selection. However, no matter what I do (other than putting the operation in

RE: Return values of NSAlert

2014-10-22 Thread Lee Ann Rucker
@lists.apple.com [cocoa-dev-bounces+lrucker=vmware@lists.apple.com] on behalf of Gerriet M. Denkmann [gerr...@mdenkmann.de] Sent: Tuesday, October 21, 2014 8:59 PM To: cocoa-dev@lists.apple.com Subject: Return values of NSAlert NSAlert has: - (void)beginSheetModalForWindow:(NSWindow *)sheetWindow

Return values of NSAlert

2014-10-21 Thread Gerriet M. Denkmann
NSAlert has: - (void)beginSheetModalForWindow:(NSWindow *)sheetWindow completionHandler:(void (^)(NSModalResponse returnCode))handler NSModalResponse has three values: Stop, Abort, Continue - none of which bear any resemblance with the buttons: Default, Alternate, Other in my

Re: Return values of NSAlert

2014-10-21 Thread Marco S Hyman
to work. var alert = NSAlert() alert.addButtonWithTitle(NSLocalizedString(SAVE, comment: Save)) alert.addButtonWithTitle(NSLocalizedString(CANCEL, comment: Cancel)) alert.addButtonWithTitle(NSLocalizedString(DONT_SAVE, comment: Don't Save)) alert.messageText = NSLocalizedString

Re: Return values of NSAlert

2014-10-21 Thread Ken Thomases
On Oct 21, 2014, at 10:59 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: NSAlert has: - (void)beginSheetModalForWindow:(NSWindow *)sheetWindow completionHandler:(void (^)(NSModalResponse returnCode))handler NSModalResponse has three values: Stop, Abort, Continue - none

Prompting user (NSAlert) during document reading

2014-08-27 Thread Matthew LeRoy
code which determines the format and, if it’s the old format, creates and displays an NSAlert to ask the user if they want to update the document in-place or create a copy. This seems to work in initial testing — the alert displays — but I get a message in the console telling me that “NSAlert

Re: Prompting user (NSAlert) during document reading

2014-08-27 Thread edward taffel
On Aug 27, 2014, at 11:30 AM, Matthew LeRoy mle...@minitab.com wrote: This seems to work in initial testing — the alert displays — but I get a message in the console telling me that “NSAlert is being used from a background thread, which is not safe. This is probably going to crash

Re: Prompting user (NSAlert) during document reading

2014-08-27 Thread Kyle Sluder
On Aug 27, 2014, at 8:43 AM, edward taffel etaf...@me.com wrote: On Aug 27, 2014, at 11:30 AM, Matthew LeRoy mle...@minitab.com wrote: This seems to work in initial testing — the alert displays — but I get a message in the console telling me that “NSAlert is being used from a background

Re: Prompting user (NSAlert) during document reading

2014-08-27 Thread edward taffel
; } - showWindows { [super showWindows]; if (_autoConverted) { NSAlert *autoConversionAlert = …; NSWindow *docWindow = self.windowControllers[0].window; [alert beginSheetModalForWindow:window completionHandler:…]; } --Kyle Sluder ___ Cocoa

Re: Prompting user (NSAlert) during document reading

2014-08-27 Thread Matthew LeRoy
telling me that ³NSAlert is being used from a background thread, which is not safe. This is probably going to crash sometimes. Š² Presumably this is because I have overridden +canConcurrentlyReadDocumentsOfType: to return YES for my documents, resulting in document reading happening on a background

Re: NSAlert - Default Cancel also respond to Escape? [Solution]

2014-06-08 Thread Seth Willits
button, but *not* default button. Responds to Command-Delete Cancel - Default button, responds to both the Return and Escape keys. Solution: NSAlert * alert = [[NSAlert alloc] init]; [alert addButtonWithTitle:@Delete]; [alert addButtonWithTitle:@Cancel

NSAlert NSOpenPanel on a background thread

2014-05-22 Thread edward taffel
opening an NSAlert while scanning an autosaved document now engenders the following log item: NSAlert is being used from a background thread, which is not safe. This is probably going to crash sometimes. Break on void _NSAlertWarnUnsafeBackgroundThreadUsage() to debug. This will be logged

Re: NSAlert NSOpenPanel on a background thread

2014-05-22 Thread Jens Alfke
On May 22, 2014, at 8:29 AM, edward taffel etaf...@me.com wrote: this i have remedied. however, given the scenario where a url has vanished, i first show an NSAlert then an NSOpenPanel to offer relink. NSOpenPanel causes no such background thread issue: do the two have variant thread

Re: NSAlert NSOpenPanel on a background thread

2014-05-22 Thread edward taffel
On May 22, 2014, at 11:41 AM, Jens Alfke j...@mooseyard.com wrote: On May 22, 2014, at 8:29 AM, edward taffel etaf...@me.com wrote: this i have remedied. however, given the scenario where a url has vanished, i first show an NSAlert then an NSOpenPanel to offer relink. NSOpenPanel

Re: NSAlert NSOpenPanel on a background thread

2014-05-22 Thread Fritz Anderson
On 22 May 2014, at 10:54 AM, edward taffel etaf...@me.com wrote: i find no mention of thread safety in the NSOpenPanel doc, but the doc mentions ‘Open panels are drawn in a separate process by the powerbox’: perhaps this is the reason. This is one of those rules so universal in Apple APIs

Re: NSAlert NSOpenPanel on a background thread

2014-05-22 Thread Jens Alfke
On May 22, 2014, at 8:54 AM, edward taffel etaf...@me.com wrote: i find no mention of thread safety in the NSOpenPanel doc, but the doc mentions ‘Open panels are drawn in a separate process by the powerbox’: perhaps this is the reason. That’s done because the Open panel itself can’t be

Re: NSAlert NSOpenPanel on a background thread

2014-05-22 Thread edward taffel
On May 22, 2014, at 12:24 PM, Jens Alfke j...@mooseyard.com wrote: On May 22, 2014, at 8:54 AM, edward taffel etaf...@me.com wrote: i find no mention of thread safety in the NSOpenPanel doc, but the doc mentions ‘Open panels are drawn in a separate process by the powerbox’: perhaps

Re: NSAlert - Default Cancel also respond to Escape?

2014-05-20 Thread Andy Lee
On May 19, 2014, at 4:30 PM, Seth Willits sli...@araelium.com wrote: Any ideas on how to get a Cancel button which is both the default button and responds to escape? Both require setting the button's key equivalent and there can only be one. This seems to work: NSAlert *alert

NSAlert - Default Cancel also respond to Escape?

2014-05-19 Thread Seth Willits
Any ideas on how to get a Cancel button which is both the default button and responds to escape? Both require setting the button's key equivalent and there can only be one. -- Seth Willits -- Seth Willits ___ Cocoa-dev mailing list

Re: NSAlert - Default Cancel also respond to Escape?

2014-05-19 Thread Jerry Krinock
On 2014 May 19, at 13:30, Seth Willits sli...@araelium.com wrote: Any ideas on how to get a Cancel button which is both the default button and responds to escape? Both require setting the button's key equivalent and there can only be one. Maybe override -keyDown: somewhere.

Re: error details in a NSAlert

2014-04-07 Thread Fritz Anderson
On 6 Apr 2014, at 2:52 PM, Daniel Luis dos Santos daniel.d...@gmail.com wrote: I want to display some text indicating a list of errors the user should correct before submitting data. I am using a modal NSAlert in which i set a message with a localised string from a table. I want

Re: error details in a NSAlert

2014-04-06 Thread Scott Ribe
On Apr 5, 2014, at 7:19 PM, Daniel Luis dos Santos daniel.d...@gmail.com wrote: I want to include the error details and for that I was setting the informativeText field but it doesn’t show up unless its a string literal. That's simply not true, so you're not setting up your string variable

error details in a NSAlert

2014-04-06 Thread Daniel Luis dos Santos
Hello all, I want to display some text indicating a list of errors the user should correct before submitting data. I am using a modal NSAlert in which i set a message with a localised string from a table. I want to include the error details and for that I was setting the informativeText field

Re: error details in a NSAlert

2014-04-06 Thread Daniel Luis dos Santos
Sorry, my mistake String was empty. Conditional that populated it failed. On 06 Apr 2014, at 16:18, Scott Ribe scott_r...@elevated-dev.com wrote: On Apr 5, 2014, at 7:19 PM, Daniel Luis dos Santos daniel.d...@gmail.com wrote: I want to include the error details and for that I was setting

error details in a NSAlert

2014-04-05 Thread Daniel Luis dos Santos
Hello all, I want to display some text indicating a list of errors the user should correct before submitting data. I am using a modal NSAlert in which i set a message with a localised string from a table. I want to include the error details and for that I was setting the informativeText field

Re: error details in a NSAlert

2014-04-05 Thread Quincey Morris
. The question of whether it’s a string literal is irrelevant, since the string is passed as a parameter to a NSAlert method, regardless of origin. Can you show code? I also tried setting an accessory view but nothing is showed. The code that uses the accessory view is below. NSTextView

Re: Get the current displayed NSAlert

2012-12-04 Thread Brad O'Hearne
In general -- any alert that requires user attention (especially ones with multiple button alternatives) can be left on the screen indefinitely by a user. If you are monitoring environmental conditions (such as network, server, or Internet reachability) that arise, it is always possible that

Re: Get the current displayed NSAlert

2012-12-04 Thread Kyle Sluder
On Dec 4, 2012, at 7:49 AM, Brad O'Hearne br...@bighillsoftware.com wrote: In general -- any alert that requires user attention (especially ones with multiple button alternatives) can be left on the screen indefinitely by a user. If you are monitoring environmental conditions (such as

Get the current displayed NSAlert

2012-12-03 Thread Brad O'Hearne
Hello all, Is there a way to get a reference to the currently displayed modal NSAlert, or to be able to globally determine if a modal alert is presently showing in a Cocoa app, though you have no knowledge of where in the app it originated from? Thanks, Brad Brad O'Hearne Founder/Lead

Re: Get the current displayed NSAlert

2012-12-03 Thread Kyle Sluder
On Mon, Dec 3, 2012, at 05:13 PM, Brad O'Hearne wrote: Hello all, Is there a way to get a reference to the currently displayed modal NSAlert, or to be able to globally determine if a modal alert is presently showing in a Cocoa app, though you have no knowledge of where in the app

Re: Get the current displayed NSAlert

2012-12-03 Thread Brad O'Hearne
was behind the question. If an app could easily request a reference to any NSAlert that was currently being displayed, it might suggest an alternative to handling it. Presently, each plugin has to handle dismissing its own potentially displayed alerts when the workflow manager decides it needs

Re: Get the current displayed NSAlert

2012-12-03 Thread Kyle Sluder
of these exceptional conditions. Whether the workflow manager then runs the NSAlert itself, or waits for the plugin to do so, that paused state is now captured by the workflow manager, and there is no need to consult AppKit about the currently running NSAlert. In general, I think it's a bad idea

Re: Get the current displayed NSAlert

2012-12-03 Thread Peter
Do you mean something like [[self window] attachedSheet] Am 04.12.2012 um 02:13 schrieb Brad O'Hearne: Hello all, Is there a way to get a reference to the currently displayed modal NSAlert, or to be able to globally determine if a modal alert is presently showing in a Cocoa app

Re: Get the current displayed NSAlert

2012-12-03 Thread jonat...@mugginsoft.com
On 4 Dec 2012, at 06:26, Kyle Sluder k...@ksluder.com wrote: I think you're thinking about the problem too generally. The workflow manager is probably going to need to understand that the plugins it's running can have encounter exceptional conditions. Therefore, there should be a mechanism

Issue with NSAlert in ARC !!

2012-02-22 Thread Naresh Kongara
() #6 0x7fff935e97dc in _dispatch_worker_thread2 () #7 0x7fff8a9b93da in _pthread_wqthread () #8 0x7fff8a9bab85 in start_wqthread () I'm creating the alert with class method in NSAlert and running it with runModal. NSAlert *alert =[NSAlert

Re: What could cause an NSAlert to not dismiss on a button press?

2011-07-15 Thread Jerry Krinock
On 2011 Jul 13, at 05:58, Graham Westlake wrote: I'm showing an NSAlert with runModal, but despite the buttons being responsive, the alert box will not dismiss and runModal never returns. I can't understand what state the run loop is in for this to be happening. This doesn't quite make

What could cause an NSAlert to not dismiss on a button press?

2011-07-13 Thread Graham Westlake
I'm showing an NSAlert with runModal, but despite the buttons being responsive, the alert box will not dismiss and runModal never returns. I can't understand what state the run loop is in for this to be happening. It's actually a Qt application, and I am showing the alert at startup

Re: -commitEditing NSAlert not always presented as a sheet

2010-02-24 Thread Keith Duncan
On 23 Feb 2010, at 18:17, Kyle Sluder wrote: On Tue, Feb 23, 2010 at 7:05 AM, Keith Duncan ke...@33software.com wrote: However, if I click my 'Done' button, which first attempts to -commitEditing for the hosting view controller, and will then close the hosting child window if

-commitEditing NSAlert not always presented as a sheet

2010-02-23 Thread Keith Duncan
I have a text field whose value is bound to a property which is validated. When editing the field and hitting enter, if the value fails to validate the error is presented as a sheet - this is the desired behaviour. However, if I click my 'Done' button, which first attempts to -commitEditing

Re: -commitEditing NSAlert not always presented as a sheet

2010-02-23 Thread Kyle Sluder
On Tue, Feb 23, 2010 at 7:05 AM, Keith Duncan ke...@33software.com wrote: However, if I click my 'Done' button, which first attempts to -commitEditing for the hosting view controller, and will then close the hosting child window if -commitEditing returns YES; the error is presented as a

Re: NSAlert query

2010-01-25 Thread jonat...@mugginsoft.com
On 25 Jan 2010, at 04:27, Poonam Virupaxi Shigihalli wrote: hi all, When alert messages are displayed using runModal, it blocks the thread until the user clicks on the button. Is there anyway to avoid blocking of the thread when alert is displayed? Try displaying your alerts as

NSAlert query

2010-01-24 Thread Poonam Virupaxi Shigihalli
hi all, When alert messages are displayed using runModal, it blocks the thread until the user clicks on the button. Is there anyway to avoid blocking of the thread when alert is displayed? Regards, Poonam. ___ Cocoa-dev mailing list

Re: NSAlert query

2010-01-24 Thread Graham Cox
On 25/01/2010, at 3:27 PM, Poonam Virupaxi Shigihalli wrote: When alert messages are displayed using runModal, it blocks the thread until the user clicks on the button. Is there anyway to avoid blocking of the thread when alert is displayed? NSAlert does not block the thread, it runs

Re: NSAlert or what?

2009-12-19 Thread Scott Ribe
So the problem I was having with my googling was that I was trying alert, popup and dialog - not sheet ;o) Yep. Just a heads up for future reference (not related to your current question), as you continue on your newbie path, you may find that certain methods dealing with modal windows that

Re: NSAlert or what?

2009-12-19 Thread David A. Lyons
Dialogs Types of Dialogs and When to Use Them Sheets (Document-Modal Dialogs) ...reveals the key word sheet, which in NSAlert.h will lead you straight to -[NSAlert

NSAlert or what?

2009-12-18 Thread Michael Davey
Hi, Sorry for the really noob posting, but I am currently using the NSAlert class to display alerts in my application, but what I would rather do is display one of the alert boxes that slide out of the title bar, as with the installer, firefox and a slew of other applications. Does anyone know

Re: NSAlert or what?

2009-12-18 Thread Ken Thomases
On Dec 19, 2009, at 12:37 AM, Michael Davey wrote: Sorry for the really noob posting, but I am currently using the NSAlert class to display alerts in my application, but what I would rather do is display one of the alert boxes that slide out of the title bar, as with the installer, firefox

Re: NSAlert or what?

2009-12-18 Thread Michael Davey
will lead you straight to -[NSAlert beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:] In the old days, the HI Guidelines always left us to discover the appropriate implementation ourselves. I like the new Implementation sections a lot, though currently they seem

Re: NSAlert or what?

2009-12-18 Thread Michael Davey
So the problem I was having with my googling was that I was trying alert, popup and dialog - not sheet ;o) On 19 Dec 2009, at 18:41, Ken Thomases wrote: On Dec 19, 2009, at 12:37 AM, Michael Davey wrote: Sorry for the really noob posting, but I am currently using the NSAlert class

NSAlert - multiple key equivalents for buttons?

2009-10-07 Thread David Reitter
What is the easiest way to get my customized NSAlert to allow multiple key equivalents for its buttons? For instance, I'd like to assign not just the default Command-D to Don't Save, but also another key with which my users are very familiar. I think it might be possibly to replace

Re: NSAlert - multiple key equivalents for buttons?

2009-10-07 Thread Kyle Sluder
On Wed, Oct 7, 2009 at 10:58 AM, David Reitter david.reit...@gmail.com wrote: What is the easiest way to get my customized NSAlert to allow multiple key equivalents for its buttons? You're probably going to need to stop using NSAlert and start using your own window as a sheet. Then you should

Re: NSAlert - multiple key equivalents for buttons?

2009-10-07 Thread Jens Alfke
On Oct 7, 2009, at 10:58 AM, David Reitter wrote: What is the easiest way to get my customized NSAlert to allow multiple key equivalents for its buttons? I think the best way is to create your own alert panel in a nib and run it modally. That way you have total control — you can set your

Re: NSAlert - multiple key equivalents for buttons?

2009-10-07 Thread David Reitter
on it because the layout was painful to control, and the sheet animation wasn't quite right. Future compatibility is an important consideration. Of course I'm already subclassing NSAlert. On Oct 7, 2009, at 2:04 PM, Kyle Sluder wrote: You're probably going to need to stop using NSAlert and start

Re: NSAlert - multiple key equivalents for buttons?

2009-10-07 Thread Kyle Sluder
On Wed, Oct 7, 2009 at 11:19 AM, David Reitter david.reit...@gmail.com wrote: window = (MyNSAlert*)  [window clone]; What is this -clone method? That way I could get NSAlert to do all the layout and prepare the window, but then take over and roll my own? No, because even granting

Re: NSAlert - multiple key equivalents for buttons?

2009-10-07 Thread David Reitter
On Oct 7, 2009, at 2:48 PM, Kyle Sluder wrote: On Wed, Oct 7, 2009 at 11:19 AM, David Reitter david.reit...@gmail.com wrote: window = (MyNSAlert*) [window clone]; What is this -clone method? I meant NSObject's -copy. Confused it with Java's clone method. That way I could get NSAlert

Re: NSAlert - multiple key equivalents for buttons?

2009-10-07 Thread Kyle Sluder
, the alerts are run with beginModalSessionForWindow and runModalSession. So I don't understand why you're so intent on using NSAlert if you're not using its -beginSheetModalForWindow:… convenience method? Would it be possible to add a control to the alert that is invisible, but has the desired

Re: NSAlert - multiple key equivalents for buttons?

2009-10-07 Thread David Reitter
On Oct 7, 2009, at 3:12 PM, Kyle Sluder wrote: FWIW, the alerts are run with beginModalSessionForWindow and runModalSession. So I don't understand why you're so intent on using NSAlert if you're not using its -beginSheetModalForWindow:… convenience method? Oh, I use it. But because

Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.

2009-09-07 Thread Joshua Garnham
How would I do this? The Outline View is being used with Core Data. Cheers, Josh. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at

Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.

2009-09-07 Thread Steven Degutis
NSArrayController's -remove: method, and assuming you're using NSArrayController for this in the first place, simply subclass your NSArrayController and provide the NSAlert behavior by overriding -remove: and then call super's -remove: once the NSAlert has come back positive (for chlamydia

Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.

2009-09-07 Thread Joshua Garnham
: Steven Degutis steven.degu...@gmail.com To: Joshua Garnham joshua.garn...@yahoo.co.uk Cc: cocoa-dev@lists.apple.com Sent: Monday, 7 September, 2009 17:20:50 Subject: Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children. Josh

Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.

2009-09-07 Thread Kyle Sluder
On Sep 7, 2009, at 8:14 AM, Joshua Garnham joshua.garn...@yahoo.co.uk wrote: How would I do this? http://www.whathaveyoutried.com --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.

2009-09-07 Thread Joshua Garnham
); } } From: Kyle Sluder kyle.slu...@gmail.com To: Joshua Garnham joshua.garn...@yahoo.co.uk Cc: cocoa-dev@lists.apple.com cocoa-dev@lists.apple.com Sent: Monday, 7 September, 2009 17:52:26 Subject: Re: Making an NSAlert be displayed when the User attempts to delete a row from

Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.

2009-09-07 Thread Volker in Lists
Hi, NSArray *selectedRow = [treeController selectedObjects]; you get an NSArray - so you should enumerate through the objects of the array NSInteger childrenCount = [selectedRow.children count]; Does not get the children count of anything but the NSArray, which it doesn't have.

Re: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.

2009-09-07 Thread Kyle Sluder
On Sep 7, 2009, at 10:20 AM, Joshua Garnham joshua.garn...@yahoo.co.uk wrote: This. Excellent response. In the future, it is always better if you include code or a description of your attempts (even if it's just looking at the documentation). - (IBAction)remove:(id)sender {

Re: Special requirements for the window param of NSAlert beginSheetModalForWindow?

2009-05-14 Thread Michael Ash
On Thu, May 14, 2009 at 12:27 AM, Sean McBride cwat...@cam.org wrote: Michael Ash (michael@gmail.com) on 2009-05-13 11:07 PM said: 2) Display the second window as a modal panel instead of a sheet. Apple does this with NSSavePanel if you try to save over an existing file. It's easy and works

Re: Special requirements for the window param of NSAlert beginSheetModalForWindow?

2009-05-14 Thread Keary Suska
On May 13, 2009, at 9:07 PM, Michael Ash wrote: 3) Use performSelector:withObject:afterDelay: with a 0 delay to run the code to show the new sheet after the old sheet has truly gone away. This will result in one sheet being followed by another sheet as you desire. I have had success with

  1   2   >