ui/cocoa/BoxContainer.m

Sun, 23 Nov 2025 10:49:24 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 23 Nov 2025 10:49:24 +0100
changeset 931
6ca1ef6c8107
parent 846
ffa983c223c1
permissions
-rw-r--r--

add ui_window_menubar_set_visible (Motif)



#import "BoxContainer.h"

@implementation BoxContainer

- (BoxContainer*)init:(NSUserInterfaceLayoutOrientation)orientation spacing:(int)spacing {
    self = [super init];
    _orientation = orientation;
    self.columnspacing = spacing;
    self.rowspacing = spacing;
    
    return self;
}

- (void) addView:(NSView*)view  layout:(UiLayout*)layout {
    if(_orientation == NSUserInterfaceLayoutOrientationVertical) {
        layout->hexpand = TRUE;
        layout->hfill = TRUE;
    } else {
        layout->vexpand = TRUE;
        layout->vfill = TRUE;
    }
    [super addView:view layout:layout];
    if(_orientation == NSUserInterfaceLayoutOrientationVertical) {
        self.container->newline = TRUE;
    }
}

@end

mercurial