diff -r 794a5c91c479 -r c96169444d88 ui/cocoa/text.m --- a/ui/cocoa/text.m Sun Apr 06 13:21:37 2014 +0200 +++ b/ui/cocoa/text.m Thu Apr 10 11:37:41 2014 +0200 @@ -81,6 +81,8 @@ [textview setAllowsUndo:TRUE]; [textview setAutoresizingMask:NSViewWidthSizable|NSViewHeightSizable]; + [textview setFont:[NSFont fontWithName:@"Menlo" size:12]]; + [scrollview setDocumentView:textview]; ct->add(ct, scrollview); @@ -93,6 +95,7 @@ value->insert = ui_textarea_insert; value->position = ui_textarea_position; value->selection = ui_textarea_selection; + value->length = ui_textarea_length; value->value = NULL; value->obj = textview; @@ -173,6 +176,10 @@ *end = range.location + range.length; } +int ui_textarea_length(UiText *text) { + return [[(NSTextView*)text->obj textStorage] length]; +} + void ui_text_undo(UiText *text) { [(NSUndoManager*)text->undomgr undo]; }