Changeset 62fbb7e in mainline for uspace/app/vdemo/vdemo.c


Ignore:
Timestamp:
2014-01-16T20:43:22Z (10 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6a3d0c7
Parents:
ba02baa
Message:

refactor window placement logic and introduce logical window placement flags

  • The original setup of window position during creation (window_open()) was quite useless, because the window had no surface yet.
  • Now the window position can be optinally set using window_resize() and various logical placement flags are available.
  • A separate window_move() routine could be introduced eventually if needed, but for the initial setup of the window the combination of window position and size works fine.
File:
1 edited

Legend:

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

    rba02baa r62fbb7e  
    110110{
    111111        if (argc >= 2) {
    112                 window_t *main_window = window_open(argv[1], true, true, "vdemo", 0, 0);
     112                window_t *main_window = window_open(argv[1], true, true, "vdemo");
    113113                if (!main_window) {
    114114                        printf("Cannot open main window.\n");
     
    150150                grid->add(grid, &btn_confirm->widget, 0, 1, 1, 1);
    151151                grid->add(grid, &btn_cancel->widget, 1, 1, 1, 1);
    152                 window_resize(main_window, 200, 76);
     152                window_resize(main_window, 0, 0, 200, 76,
     153                    WINDOW_PLACEMENT_CENTER);
    153154
    154155                window_exec(main_window);
Note: See TracChangeset for help on using the changeset viewer.