Hmm, "text" may be a NSAttributedString.
I would like to return nil at validAttributesForMarkedText.
Can I express nil in the Factor code? How should I write it?

--
KUSUMOTO Norio



> 2019/04/10 10:29、KUSUMOTO Norio <kusum...@na.rim.or.jp>のメール:
> 
> I will post the contents written to github.
> 
> 
> I think the replacement from NSTextInput to NSTextInputClient can't solve 
> this problem 
> unless its methods are implemented appropriately.
> In an opposite way, even with NSTextInput, I anticipate the appropriate 
> implementation
> of methods can solve it.
> 
> I'm writing a experimental code for it. But I'm in trouble.
> In setMarkedText:selectedRange: , I can't convert text from a NSString to a 
> factor string 
> by CF>string. I got the error "Unix signal #6 (SIGABRT)".
> The word works fine in insertText: .
> 
>    ! Text input
>    METHOD: void insertText: id text
>    [
>        self window :> window
>        window [
>            text CF>string window user-input
>        ] when
>    ] ;
> 
>    METHOD: char hasMarkedText [ 0 ] ;
> 
>    METHOD: NSRange markedRange [ 0 0 <NSRange> ] ;
> 
>    METHOD: NSRange selectedRange [ 0 0 <NSRange> ] ;
> 
> !    METHOD: void setMarkedText: id text selectedRange: NSRange range [ ] ;
> 
>    METHOD: void setMarkedText: id text selectedRange: Nsrange range 
> [ 
>        self window :> window
>        window [
> ! ok -->          "abc"
> ! ok -->          "xyz" <CFString> CF>string 
> ! "alien "        text class-of "%s " sprintf
>            text CF>string   ! Error  Unix signal #6 (SIGABRT) 
>            window world-focus user-input* drop
>        ] when
> ] ;
> 
> 
> --
> KUSUMOTO Norio
> 



_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to