Open mischnic opened 6 years ago
There seem to be some bugs regarding uiGrid on macOS
Cocoa: GTK:
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include "ui.h" int onClosing(uiWindow *w, void *data) { uiQuit(); return 1; } int main(void) { uiInitOptions o; const char *err; uiWindow *w; memset(&o, 0, sizeof (uiInitOptions)); err = uiInit(&o); if (err != NULL) { fprintf(stderr, "error initializing ui: %s\n", err); uiFreeInitError(err); return 1; } w = uiNewWindow("Grid Test", 500, 400, 0); uiWindowSetMargined(w, 1); uiGrid *grid = uiNewGrid(); uiGridSetPadded(grid, 1); uiWindowSetChild(w, uiControl(grid)); uiEntry *name = uiNewEntry(); uiEntry *surname = uiNewEntry(); uiSlider *age = uiNewSlider(0, 100); uiMultilineEntry *data = uiNewMultilineEntry(); uiMultilineEntrySetText(data, "This is a text.This is a text.\nThis is a text.\nThis is a text.This is a text.\nThis is a text.\n"); uiGridAppend(grid, uiControl(uiNewLabel("name")), 0, 0, 2, 1, 0, uiAlignFill, 0, uiAlignStart); uiGridAppend(grid, uiControl(uiNewLabel("surname")), 0, 1, 2, 1, 0, uiAlignFill, 0, uiAlignStart); uiGridAppend(grid, uiControl(uiNewLabel("age")), 0, 2, 2, 1, 0, uiAlignFill, 0, uiAlignStart); uiGridAppend(grid, uiControl(name), 2, 0, 2, 1, 0, uiAlignFill, 0, uiAlignStart); uiGridAppend(grid, uiControl(surname), 2, 1, 2, 1, 0, uiAlignFill, 0, uiAlignStart); uiGridAppend(grid, uiControl(age), 2, 2, 2, 1, 0, uiAlignFill, 0, uiAlignStart); uiGridAppend(grid, uiControl(data), 4, 0, 1, 3, 1, uiAlignFill, 1, uiAlignFill); uiWindowOnClosing(w, onClosing, NULL); uiControlShow(uiControl(w)); uiMain(); return 0; }
https://github.com/kusti8/proton-native/issues/55 https://github.com/parro-it/libui-node/issues/63
Grid does work on macOS; it's just insanely buggy because either Auto Layout is hard or my attempt at making a grid with it is poor (probably the latter), so it only works under specific circumstances... This is an active problem.
Also, the parameters to uiGridAppend should be documented.
Has this been solved?
There seem to be some bugs regarding uiGrid on macOS
Cocoa: GTK:
https://github.com/kusti8/proton-native/issues/55 https://github.com/parro-it/libui-node/issues/63