• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to insert text on button click?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to insert text on button click?


  • Subject: How to insert text on button click?
  • From: Magnus Strand <email@hidden>
  • Date: Wed, 26 Jan 2005 15:40:52 +0100

Hi!

I have a window with buttons, an NSForm with text fields etc.

When the user clicks a button I would like to insert some characters
where the text caret is blinking.

How can I do this?

My button sends an action to MyDocument.

I have tried sending keyDown messages, but failed (perhaps I got wrong context or time in NSEvent).
I also tried getting the field editor and calling insertText, but the field editor seemed to be in wrong state.


I have a custom field editor for my NSForm.

--
Regards,

Magnus Strand
System Developer, MSc

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How to insert text on button click?
      • From: Jeremy French <email@hidden>
  • Prev by Date: Re: iPhoto plugins or extensions
  • Next by Date: Re: Problems with custom NSView subclass, IBPalette, and bindings support
  • Previous by thread: Re: [NSCFString count]: selector not recognized
  • Next by thread: Re: How to insert text on button click?
  • Index(es):
    • Date
    • Thread