ui/cocoa/text.m

changeset 540
d8b86f66721c
parent 539
96f466ceaf23
equal deleted inserted replaced
539:96f466ceaf23 540:d8b86f66721c
31 #import "Container.h" 31 #import "Container.h"
32 #import <objc/runtime.h> 32 #import <objc/runtime.h>
33 33
34 UIWIDGET ui_textarea_create(UiObject *obj, UiTextAreaArgs args) { 34 UIWIDGET ui_textarea_create(UiObject *obj, UiTextAreaArgs args) {
35 NSTextView *textview = [[NSTextView alloc] init]; 35 NSTextView *textview = [[NSTextView alloc] init];
36 textview.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; 36 textview.autoresizingMask = NSViewWidthSizable;
37 textview.minSize = NSMakeSize(0, 0);
38 textview.maxSize = NSMakeSize(FLT_MAX, FLT_MAX);
37 39
38 NSScrollView *scrollview = [[NSScrollView alloc] init]; 40 NSScrollView *scrollview = [[NSScrollView alloc] init];
39 scrollview.translatesAutoresizingMaskIntoConstraints = NO;
40 scrollview.hasVerticalScroller = YES; 41 scrollview.hasVerticalScroller = YES;
41 scrollview.documentView = textview; 42 scrollview.documentView = textview;
42 43
43 UiLayout layout = UI_INIT_LAYOUT(args); 44 UiLayout layout = UI_INIT_LAYOUT(args);
44 ui_container_add(obj, scrollview, &layout, TRUE); 45 ui_container_add(obj, scrollview, &layout, TRUE);

mercurial