Re: Typing into a NSTextView and overriding it

2017-02-20 Thread Quincey Morris
On Feb 20, 2017, at 23:07 , Daryle Walker wrote: > > 1. How can one type in control characters into a text-view? I mean ASCII > range 0 through 31 and 127, not counting horizontal-tab and line-feed. You probably can’t, although it’s not entirely clear. Holding down the Control key and pressing

Typing into a NSTextView and overriding it

2017-02-20 Thread Daryle Walker
1. How can one type in control characters into a text-view? I mean ASCII range 0 through 31 and 127, not counting horizontal-tab and line-feed. 2. Is there a way to filter out the user from typing (or pasting, etc.) characters you don't want (like NUL)? 3. Is there a way to limit the length of a

Re: Change NSCursor globally

2017-02-20 Thread Uli Kusterer
On 15 Feb 2017, at 11:24, Colas B wrote: > thanks for your answer. > I want to do the former: when the user enables a mode in the application, the > cursor changes, exactly in the way you described (the shape changes). The > user should be able to use this custom cursor over a PDFView, a UIScrol

Re: NSGradient & NSTextField’s focus ring

2017-02-20 Thread Yilei He
Hi David Thank you! Your point is correct. Cheers Yilei He On 21 Feb 2017, 8:48 AM +1100, David Duncan , wrote: > > > On Feb 20, 2017, at 1:44 PM, Yilei He wrote: > > > > My whole view's code: > > import Cocoa > > > > class GradientBackgroundView: NSView { > > > > > > override func draw(_ dirt

Re: NSGradient & NSTextField’s focus ring

2017-02-20 Thread David Duncan
> On Feb 20, 2017, at 1:44 PM, Yilei He wrote: > > My whole view's code: > import Cocoa > > class GradientBackgroundView: NSView { > > > override func draw(_ dirtyRect: NSRect) { > let gradient = NSGradient(colors: [ > NSColor(calibratedWhite: 0.96, alpha: 1), > NSColor(calibratedWhite: 0.84,

Re: NSGradient & NSTextField’s focus ring

2017-02-20 Thread Yilei He
My whole view's code: import Cocoa class GradientBackgroundView: NSView { override func draw(_ dirtyRect: NSRect) { let gradient = NSGradient(colors: [ NSColor(calibratedWhite: 0.96, alpha: 1), NSColor(calibratedWhite: 0.84, alpha: 1) ]) gradient?.draw(in: dirtyRect, angle: 270) let path = NSBe

Re: NSGradient & NSTextField’s focus ring

2017-02-20 Thread David Duncan
> On Feb 20, 2017, at 2:41 AM, Yilei He wrote: > > Hi > > In my UI design, I have a custom NSView which only draws a NSGradient in > draw(in:) method. I also have a NSTextField next to this custom view. Every > time when text field is focused, the focus ring animates and leave a set of > mar

NSGradient & NSTextField’s focus ring

2017-02-20 Thread Yilei He
Hi In my UI design, I have a custom NSView which only draws a NSGradient in draw(in:) method. I also have a NSTextField next to this custom view. Every time when text field is focused, the focus ring animates and leave a set of mark(animation tracks) on the custom view. After I tested this for