Re: Selected text in NSTextField

2012-02-02 Thread Laurent Daudelin
. Can you send me a link to some guide or tutorial? Thanks! From: Jens Alfke [mailto:j...@mooseyard.com] Sent: Wednesday, February 01, 2012 20:32 To: Dany Golubitsky Cc: Conrad Shultz; Cocoa Development Subject: Re: Selected text in NSTextField On Feb 1, 2012, at 5:19 AM, Dany

Re: Selected text in NSTextField

2012-02-02 Thread Graham Cox
On 31/01/2012, at 7:14 PM, Dany Golubitsky wrote: I am interested in opening NSAlert window that includes editable text field. Well, that's pretty daft :) NSAlert isn't designed for that purpose, so why try to make it fit somewhere it doesn't? Just use NSPanel, you'll find it a lot more

Re: Selected text in NSTextField

2012-02-02 Thread Quincey Morris
On Feb 2, 2012, at 14:23 , Graham Cox wrote: On 31/01/2012, at 7:14 PM, Dany Golubitsky wrote: I am interested in opening NSAlert window that includes editable text field. Well, that's pretty daft :) NSAlert isn't designed for that purpose, so why try to make it fit somewhere it

Re: Selected text in NSTextField

2012-02-02 Thread Graham Cox
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:

Re: Selected text in NSTextField

2012-02-02 Thread Dave Fernandes
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

Re: Selected text in NSTextField

2012-02-02 Thread Graham Cox
NSPanel inherits NSWindow. If you look at the methods that NSPanel adds to NSWindow, it's really a very small set. It allows: a) the window to be a floating window b) it allows the window to not become key unless necessary, which is very useful to prevent a floater from stealing focus away

Re: Selected text in NSTextField

2012-02-02 Thread Dave Fernandes
I see. I've been having trouble forcing an NSTextField to get focus in document-modal sheets, and I wondered whether NSPanel/NSWindow should make a difference. (Experimentally it does not.) I found on Snow Leopard that the following always worked: [sheetController window]; // load the NIB

Re: Selected text in NSTextField

2012-02-02 Thread Jens Alfke
On Feb 2, 2012, at 4:10 PM, Graham Cox wrote: NSPanel inherits NSWindow. If you look at the methods that NSPanel adds to NSWindow, it's really a very small set. Another difference is that NSPanels don’t become ‘main’. The primary effect of this is that the frontmost document (i.e.

Re: Selected text in NSTextField

2012-02-02 Thread Graham Cox
On 03/02/2012, at 11:39 AM, Dave Fernandes wrote: Am I trying the right things here? It should just work if you set the 'initialFirstResponder' outlet to be your text field. No other code needed, except possibly NOT calling -setBecomesKeyOnlyIfNeeded:YES. The docs suggest this is only

Re: Selected text in NSTextField

2012-02-02 Thread Dave Fernandes
On 2012-02-02, at 8:11 PM, Graham Cox wrote: On 03/02/2012, at 11:39 AM, Dave Fernandes wrote: Am I trying the right things here? It should just work if you set the 'initialFirstResponder' outlet to be your text field. No other code needed, except possibly NOT calling

RE: Selected text in NSTextField

2012-02-01 Thread Dany Golubitsky
I am sorry, none of this works :( -Original Message- From: Conrad Shultz [mailto:con...@synthetiqsolutions.com] Sent: Tuesday, January 31, 2012 20:03 To: Dany Golubitsky Cc: Cocoa Development Subject: Re: Selected text in NSTextField On 01/31/2012 12:14 AM, Dany Golubitsky wrote

Re: Selected text in NSTextField

2012-02-01 Thread Jens Alfke
On Feb 1, 2012, at 5:19 AM, Dany Golubitsky wrote: I am sorry, none of this works :( I think you’re trying to make NSAlert do things it wasn’t meant to do. Try creating your own alert panel in a nib and running it yourself (it’s pretty easy.) —Jens

RE: Selected text in NSTextField

2012-02-01 Thread Dany Golubitsky
To: Dany Golubitsky Cc: Conrad Shultz; Cocoa Development Subject: Re: Selected text in NSTextField On Feb 1, 2012, at 5:19 AM, Dany Golubitsky wrote: I am sorry, none of this works :( I think you're trying to make NSAlert do things it wasn't meant to do. Try creating your own alert panel in a nib

Selected text in NSTextField

2012-01-31 Thread Dany Golubitsky
Hello Everyone! I am interested in opening NSAlert window that includes editable text field. I would like that the text field will be immediately in focus and all characters will be selected. Meaning that the user can immediately start to type another name if he interested. In other words it

Re: Selected text in NSTextField

2012-01-31 Thread Conrad Shultz
On 01/31/2012 12:14 AM, Dany Golubitsky wrote: Hello Everyone! I am interested in opening NSAlert window that includes editable text field. I would like that the text field will be immediately in focus and all characters will be selected. Meaning that the user can immediately start to type