Hi,
I try to write my own text field, for cross-platform dev. reasons I don't have
another choice, unfortunately...
So, in my view, I have this:
@interface MyOpenGLView : NSOpenGLView <NSTextInputClient>
...
@end
@implementation MyOpenGLView
- (void) mouseDown: (NSEvent*) iEvent
{
if( mActiveTextButton )
{
[[self inputContext] handleEvent: iEvent];
}
else
{
// this is the crossplatform stuff...
AddMouseEvent( self, iEvent, ::nWindowingSystem::kClass_MouseClick,
::nWindowingSystem::kClick_LeftDown );
}
}
the same goes for : mouseDragged:, mouseMoved:, mouseUp:, keyDown: and keyUp: .
I also implemented all the required methods from the NSTextInputClient protocol.
Now I can type accented characters, like é, by typing 'Option-e' then "e'.
But I can't select anything.
- (NSUInteger) characterIndexForPoint: (NSPoint) iPoint
- (NSRect) firstRectForCharacterRange: (NSRange) iRange actualRange:
(NSRangePointer) oActualRange
never get called, which I suppose are here for handling mouse events and thus
the selection ?
What am I doing wrong ?
Thanks.
--
http://www.tvpaint.com
Eric M.
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]