• 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
Re: NSTextInput problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextInput problems


  • Subject: Re: NSTextInput problems
  • From: Eyal Redler <email@hidden>
  • Date: Tue, 28 May 2002 02:43:24 +0200

Hi Aki,

First of all, thanks. I was Googling the net for days about this! Found a lot of Japanese pages. But I can't read them...

Now, the selected range argument in the -setMarkedText:selectedRange: method is the selection inside the marked text. Since the content of the marked range is basically owned by the input manager, the cursor movement including the selection is the input manager's responsibility. The index in the argument is, thus, relative to the beginning of the marked range, not from the document beginning. I assume you've been testing your code with dead keys for Roman accented characters. In that case, the length of the marked range is almost always 1, and, the cursor position is always at the index 1. With more complex languages like Japanese, Chinese, or Korean, the marked text can be a whole sentence. In that case, the selected range can move inside the marked text.

What I'm missing here is how the marked text is initially set-up.
I tried this sequance
1. At first, the marked text is (NSFontFound,0)
2. I type a few characters. (insertText is called) the marked text is not changed (there is none)
Now:
3. I type option-e (US-keyboard) ; setMarkedText is being called with (1,0)
as selRange.
Even after knowing the selelction range is relative to the marked range, it doesn't make sense. My marked text is still (NSNotFound,0)?!

Could you specify what should be done with the these elements in insertText and setMarkedText?
The elements being:
1.Selection range
2. Text model
3. Marked Text range

Thanks,

Eyal
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSTextInput problems
      • From: Aki Inoue <email@hidden>
References: 
 >Re: NSTextInput problems (From: Aki Inoue <email@hidden>)

  • Prev by Date: Cocoa Java: setIndicatorImageInTableColumn?
  • Next by Date: Re: NSTextInput problems
  • Previous by thread: Re: NSTextInput problems
  • Next by thread: Re: NSTextInput problems
  • Index(es):
    • Date
    • Thread