2 days ago
fix textview creation (Cocoa)
make/xcode/toolkit/toolkit/main.m | file | annotate | diff | comparison | revisions | |
ui/cocoa/text.m | file | annotate | diff | comparison | revisions |
--- a/make/xcode/toolkit/toolkit/main.m Sun Mar 30 16:38:27 2025 +0200 +++ b/make/xcode/toolkit/toolkit/main.m Sun Mar 30 16:52:33 2025 +0200 @@ -38,7 +38,7 @@ UiObject *obj = ui_window("My Window", NULL); - ui_grid(obj, .columnspacing = 0, .rowspacing = 0) { + ui_grid(obj, .columnspacing = 10, .rowspacing = 10) { ui_textarea(obj, .fill = UI_ON); }
--- a/ui/cocoa/text.m Sun Mar 30 16:38:27 2025 +0200 +++ b/ui/cocoa/text.m Sun Mar 30 16:52:33 2025 +0200 @@ -32,8 +32,12 @@ #import <objc/runtime.h> UIWIDGET ui_textarea_create(UiObject *obj, UiTextAreaArgs args) { + NSTextView *textview = [[NSTextView alloc] init]; + textview.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; + NSScrollView *scrollview = [[NSScrollView alloc] init]; - NSTextView *textview = [[NSTextView alloc] init]; + scrollview.translatesAutoresizingMaskIntoConstraints = NO; + scrollview.hasVerticalScroller = YES; scrollview.documentView = textview; UiLayout layout = UI_INIT_LAYOUT(args);