Re: Selected text in NSTextField
Re: Selected text in NSTextField
- Subject: Re: Selected text in NSTextField
- From: Dave Fernandes <email@hidden>
- Date: Thu, 02 Feb 2012 18:51:08 -0500
I'm still a little unclear on when to use an NSWindow and when to use an NSPanel. I thought you used an NSPanel if you did *not* want it to become key. But for input, you do want it to become key, don't you? I'm sure I've missed some basic Cocoa 101 here, but I found the docs "clear as mud" on this.
Dave
On 2012-02-02, at 6:02 PM, Graham Cox wrote:
>
> 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
_______________________________________________
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