more
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
Nishi 2026-03-27 15:31:51 +09:00
commit a16c1bcb5b
Signed by: nishi
GPG key ID: 27EF69B208EB9343

View file

@ -21,9 +21,14 @@ static void resize(MwWidget handle, void* user, void* call){
static void newrow(void){ static void newrow(void){
if(row >= 0){ if(row >= 0){
int i;
for(i = n; i < Columns; i++) MwCreateWidget(MwFrameClass, "frame", boxes[row], 0, 0, 0, 0);
} }
boxes[++row] = MwCreateWidget(MwBoxClass, "box", box, 0, 0, 0, 0); boxes[++row] = MwCreateWidget(MwBoxClass, "box", box, 0, 0, 0, 0);
n = 0;
} }
static void add(MwWidget w){ static void add(MwWidget w){
@ -34,7 +39,6 @@ static void add(MwWidget w){
n += r; n += r;
if(n == Columns){ if(n == Columns){
n = 0;
newrow(); newrow();
} }
} }
@ -49,6 +53,8 @@ static MwWidget frame(const char* name, MwWidget w){
} }
int main(){ int main(){
int i;
MwLibraryInit(); MwLibraryInit();
window = MwVaCreateWidget(MwWindowClass, "window", NULL, MwDEFAULT, MwDEFAULT, 800, 800, window = MwVaCreateWidget(MwWindowClass, "window", NULL, MwDEFAULT, MwDEFAULT, 800, 800,
@ -73,6 +79,12 @@ int main(){
add(frame("TODO", NULL)); add(frame("TODO", NULL));
for(i = 0; i < 12; i++) add(frame("TODO", NULL));
if(n == 0){
MwDestroyWidget(boxes[row]);
}
resize(window, NULL, NULL); resize(window, NULL, NULL);
MwLoop(window); MwLoop(window);