Author: manolo
Date: 2011-03-28 14:52:56 -0700 (Mon, 28 Mar 2011)
New Revision: 8542
Log:
Mac OS: simplified the handling of text input:
use the FLTextView subclass of NSTextView only for Mac OS < 10.5 because it's
not
necessary for Mac OS >= 10.5
Modified:
branches/branch-1.3/src/Fl_cocoa.mm
Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2011-03-28 11:40:39 UTC (rev 8541)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2011-03-28 21:52:56 UTC (rev 8542)
@@ -1251,12 +1251,15 @@
}
- (id)windowWillReturnFieldEditor:(NSWindow *)sender toObject:(id)client
{
- NSRect rect={{0,0},{20,20}};
- static FLTextView *view = nil;
- if (!view) {
- view = [[FLTextView alloc] initWithFrame:rect];
+ if (fl_mac_os_version < 100500) {
+ NSRect rect={{0,0},{20,20}};
+ static FLTextView *view = nil;
+ if (!view) {
+ view = [[FLTextView alloc] initWithFrame:rect];
+ }
+ return view;
}
- return view;
+ return nil;
}
@end
@@ -1675,7 +1678,7 @@
cocoaMouseWheelHandler(theEvent);
}
- (void)keyDown:(NSEvent *)theEvent {
- FLTextView *edit = (FLTextView*)[[theEvent window] fieldEditor:YES
forObject:nil];
+ NSText *edit = [[theEvent window] fieldEditor:YES forObject:nil];
[edit interpretKeyEvents:[NSArray arrayWithObject:theEvent]];
}
- (void)keyUp:(NSEvent *)theEvent {
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit