Re: Selected text in NSTextField
Re: Selected text in NSTextField
- Subject: Re: Selected text in NSTextField
- From: Graham Cox <email@hidden>
- Date: Fri, 03 Feb 2012 10:02:31 +1100
On 03/02/2012, at 9:37 AM, Quincey Morris wrote:
> You're the second person who's scorned the idea of adding things to an alert. In fact, NSAlert is explicitly designed to allow adding controls via an accessory subview:
>
> http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Dialog/Articles/CustomAlertDialogs.html
>
> One of the benefits of using a customized alert is that you don't have to worry about resizing the window based on the size of the message and informative text.
>
> OTOH, looking at the OP's links to screenshots, two things are obvious:
>
> 1. This particular task isn't one that NSAlert is suitable for. It's not actually an alert.
We used to call these 'dialogs'. Panels seems to be the preferred Cocoa terminology.
Notwithstanding the (minor) benefits of NSAlert, (and internally it's implemented in terms of NSPanel, I would assume), the design of NSAlert makes it harder to set up interactivity, because it doesn't have an explicit controller - it inherits NSObject, not NSWindowController or even NSPanel. In other words, it's designed for a different job to the OP's.
My view is, if you need any input fields in a dialog, the go-to class is NSPanel, not NSAlert.
>
> 2. There are no new frontiers in Cyrillic pornography. ;)
LOL, indeed.
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden