Changeset 3583ffb in mainline for uspace/app


Ignore:
Timestamp:
2020-11-08T19:51:04Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f93e4e3
Parents:
8c772c4
Message:

Revert "Create UI controls based on UI object…"

This was a mistake. Controls need ui_resource object, which must be
(at least currently) specific to a window and cannot be obtained from
ui_t.

Location:
uspace/app
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/terminal/terminal.c

    r8c772c4 r3583ffb  
    835835
    836836        term->gc = ui_window_get_gc(term->window);
     837        term->ui_res = ui_window_get_res(term->window);
    837838
    838839        ui_window_set_cb(term->window, &terminal_window_cb, (void *) term);
  • uspace/app/terminal/terminal.h

    r8c772c4 r3583ffb  
    5757        ui_t *ui;
    5858        ui_window_t *window;
     59        ui_resource_t *ui_res;
    5960        gfx_context_t *gc;
    6061
  • uspace/app/uidemo/uidemo.c

    r8c772c4 r3583ffb  
    9999        ui_demo_t demo;
    100100        gfx_rect_t rect;
     101        ui_resource_t *ui_res;
    101102        errno_t rc;
    102103
     
    126127        demo.window = window;
    127128
     129        ui_res = ui_window_get_res(window);
     130
    128131        rc = ui_fixed_create(&demo.fixed);
    129132        if (rc != EOK) {
     
    132135        }
    133136
    134         rc = ui_label_create(ui, "Hello there!", &demo.label);
     137        rc = ui_label_create(ui_res, "Hello there!", &demo.label);
    135138        if (rc != EOK) {
    136139                printf("Error creating label.\n");
     
    151154        }
    152155
    153         rc = ui_pbutton_create(ui, "Confirm", &demo.pb1);
     156        rc = ui_pbutton_create(ui_res, "Confirm", &demo.pb1);
    154157        if (rc != EOK) {
    155158                printf("Error creating button.\n");
     
    173176        }
    174177
    175         rc = ui_pbutton_create(ui, "Cancel", &demo.pb2);
     178        rc = ui_pbutton_create(ui_res, "Cancel", &demo.pb2);
    176179        if (rc != EOK) {
    177180                printf("Error creating button.\n");
Note: See TracChangeset for help on using the changeset viewer.