application/main.c

branch
newapi
changeset 414
ef60d527c066
parent 411
3e91b7aff6a1
child 416
89ad8467c39f
equal deleted inserted replaced
413:b8e41d42f400 414:ef60d527c066
488 488
489 void action_button(UiEvent *event, void *data) { 489 void action_button(UiEvent *event, void *data) {
490 printf("action_button\n"); 490 printf("action_button\n");
491 } 491 }
492 492
493 typedef struct WData {
494 UiString *path;
495 } WData;
496
493 void application_startup(UiEvent *event, void *data) { 497 void application_startup(UiEvent *event, void *data) {
494 UiObject *obj = ui_window("Test", NULL); 498 UiObject *obj = ui_window("Test", NULL);
495 499
500 WData *wdata = ui_malloc(obj->ctx, sizeof(WData));
501 wdata->path = ui_string_new(obj->ctx, NULL);
502 obj->window = wdata;
503
504 /*
496 ui_grid(obj, .margin = 10) { 505 ui_grid(obj, .margin = 10) {
497 ui_button(obj, .label = "Test Button", .onclick = action_button); 506 ui_button(obj, .label = "Test Button", .onclick = action_button);
498 ui_newline(obj); 507 ui_newline(obj);
499 508
500 ui_togglebutton(obj, .label = "Togglebutton"); 509 ui_togglebutton(obj, .label = "Togglebutton");
526 ui_button(obj, .label = "F312343543"); 535 ui_button(obj, .label = "F312343543");
527 } 536 }
528 537
529 538
530 } 539 }
531 540 */
532 541
542
543
544 //ui_textfield(obj, .varname = "textfield");
545 //ui_textfield(obj, .varname = "textfield2");
546 ui_path_textfield(obj, .value = wdata->path, .hfill = TRUE, .hexpand = TRUE);
547
548 ui_set(wdata->path, "/test/path/string");
533 549
534 550
535 ui_show(obj); 551 ui_show(obj);
536 } 552 }
537 553

mercurial