Welcome to MacForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

NSTextField - copy and paste simple text

 
   Macintosh computer (Home) -> Programmer Help RSS
Next:  Virtual PC with Windows 98 or XP ???  
Author Message
Sebastien TOPIN

External


Since: Aug 27, 2004
Posts: 2



(Msg. 1) Posted: Fri Aug 27, 2004 4:21 am
Post subject: NSTextField - copy and paste simple text
Archived from groups: comp>sys>mac>programmer>help (more info?)

Hi Folks,

I would like to have "Copy and Paste" functionality in a NSTextField object.
My text field oject is in a NSPanel. I simply want to be able to copy a
short text into my text field.

Is it already implemented somewhere? (I have seen that NSText has a "paste"
methode but not NSTextField) Or do I need to recreate the wheel?

Thanks in advance,
Seb

 >> Stay informed about: NSTextField - copy and paste simple text 
Back to top
Login to vote
Michael Ash1

External


Since: Jun 01, 2004
Posts: 525



(Msg. 2) Posted: Fri Aug 27, 2004 5:22 am
Post subject: Re: NSTextField - copy and paste simple text [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, 27 Aug 2004, Sebastien TOPIN wrote:

 > Hi Folks,
 >
 > I would like to have "Copy and Paste" functionality in a NSTextField object.
 > My text field oject is in a NSPanel. I simply want to be able to copy a
 > short text into my text field.
 >
 > Is it already implemented somewhere? (I have seen that NSText has a "paste"
 > methode but not NSTextField) Or do I need to recreate the wheel?

They've always just worked for me. Have you actually tried it?

Note that when you edit a text field, the object that actually handles the
editing is an NSTextView. For more info on that, look up the "field
editor".

 >> Stay informed about: NSTextField - copy and paste simple text 
Back to top
Login to vote
Sebastien TOPIN

External


Since: Aug 27, 2004
Posts: 2



(Msg. 3) Posted: Fri Aug 27, 2004 8:23 am
Post subject: Re: NSTextField - copy and paste simple text [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I must have an issue somewhere because I did a test with a new application
and the NStextField copy/paste works automatically.
I am going to check who gets the message first...

Thanks,
Seb

"Michael Ash" a écrit dans le message de
20040827045749.D1647 RemoveThis @agamemnon.twistedsys.net...
 > On Fri, 27 Aug 2004, Sebastien TOPIN wrote:
 >
  > > Hi Folks,
  > >
  > > I would like to have "Copy and Paste" functionality in a NSTextField
object.
  > > My text field oject is in a NSPanel. I simply want to be able to copy a
  > > short text into my text field.
  > >
  > > Is it already implemented somewhere? (I have seen that NSText has a
"paste"
  > > methode but not NSTextField) Or do I need to recreate the wheel?
 >
 > They've always just worked for me. Have you actually tried it?
 >
 > Note that when you edit a text field, the object that actually handles the
 > editing is an NSTextView. For more info on that, look up the "field
 > editor".
 >> Stay informed about: NSTextField - copy and paste simple text 
Back to top
Login to vote
Chris Hanson

External


Since: Apr 30, 2004
Posts: 61



(Msg. 4) Posted: Sat Aug 28, 2004 8:22 pm
Post subject: Re: NSTextField - copy and paste simple text [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2004-08-27 04:37:06 -0700, "Sebastien TOPIN" said:
 > I must have an issue somewhere because I did a test with a new application
 > and the NStextField copy/paste works automatically.
 > I am going to check who gets the message first...

If you have a standard Edit menu in your MainMenu.nib, it will have the
standard items wired up to First Responder. This means their action
will be invoked down the responder chain, which should be including the
field editor, getting you the behavior you're looking for free.

-- Chris

--
Chris Hanson
<a rel="nofollow" style='text-decoration: none;' href="http://www.livejournal.com/users/chanson/" target="_blank">http://www.livejournal.com/users/chanson/</a>
 >> Stay informed about: NSTextField - copy and paste simple text 
Back to top
Login to vote
Simon Slavin1

External


Since: May 16, 2004
Posts: 375



(Msg. 5) Posted: Sun Aug 29, 2004 2:03 pm
Post subject: Re: NSTextField - copy and paste simple text [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 27/08/2004, Sebastien TOPIN wrote in message
:

 > I must have an issue somewhere because I did a test with a new
 > application and the NStextField copy/paste works automatically.

It certainly should do.

 > I am going to check who gets the message first...

If you're using a standard (not subclassed) NSTextField,
in a standard NSWindow,
with standard NSMenuBar
in a standard NSApplication
in a standard NSWorkspace

then the only thing that can intercept it is a delegate to one
of the above things.

Simon.
--
Using pre-release version of newsreader.
Please tell me if it does weird things.
 >> Stay informed about: NSTextField - copy and paste simple text 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
pb with NSTextField cut copy paste - Hello, When executing my application, I cannot copy from or paste to a NSTextField. Nowhere in the Interface Builder Help or in this group I could find the solution. My text field is Editable, Enabled, etc... when I cmd-C or cmd-V on it, I'm prevented...

Bug trying to paste text in a dialog? (OS X) - Hi, I'm new to OS X and Apple/Mac programming. I have an application that displays a dialog (from a nib file made in Interface Builder) with some text fields and so on. When I try to paste some text into one of the text fields, the text always shows up...

Cocoa: simple HTML text to Unicode - I have an NSString. 99% of the time it contains just text. Sometimes one or more characters of the string will be encoded in HTML, like the following: Time for Questions &amp; Answers. What's the simplest method I can use to turn this into normal ...

Simple C question - I am writing a program in XCode and the input needs to be of the form integer:integer:integer. How do I tell scanf to use the ":" as a delimiter so that I can do the input in 1 line . I am trying to write a simple time function. Thanks

Simple C programming Q - If I use a function call that returns an integer value as the endpoint of a for loop, is the function evaluated each time through the loop, or does the compiler optimize this for me? For example for(i; i < strlen(str); i++) Since strlen evaluates ...
   Macintosh computer (Home) -> Programmer Help All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]