Changes in / [2f136e4:7feb86e6] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/vlaunch/vlaunch.c
r2f136e4 r7feb86e6 92 92 int main(int argc, char *argv[]) 93 93 { 94 if (argc < 2) { 94 if (argc >= 2) { 95 winreg = argv[1]; 96 window_t *main_window = window_open(argv[1], true, true, "vlaunch"); 97 if (!main_window) { 98 printf("Cannot open main window.\n"); 99 return 1; 100 } 101 102 pixel_t grd_bg = PIXEL(255, 240, 240, 240); 103 pixel_t btn_bg = PIXEL(255, 0, 0, 0); 104 pixel_t btn_fg = PIXEL(255, 240, 240, 240); 105 pixel_t lbl_bg = PIXEL(255, 240, 240, 240); 106 pixel_t lbl_fg = PIXEL(255, 0, 0, 0); 107 108 label_t *lbl_caption = create_label(NULL, "Launch application:", 16, lbl_bg, lbl_fg); 109 button_t *btn_vterm = create_button(NULL, "vterm", 16, btn_bg, btn_fg); 110 button_t *btn_vdemo = create_button(NULL, "vdemo", 16, btn_bg, btn_fg); 111 button_t *btn_vlaunch = create_button(NULL, "vlaunch", 16, btn_bg, btn_fg); 112 grid_t *grid = create_grid(window_root(main_window), 4, 1, grd_bg); 113 if (!lbl_caption || !btn_vterm || !btn_vdemo || !btn_vlaunch || !grid) { 114 window_close(main_window); 115 printf("Cannot create widgets.\n"); 116 return 1; 117 } 118 119 sig_connect( 120 &btn_vterm->clicked, 121 NULL, 122 on_vterm); 123 sig_connect( 124 &btn_vdemo->clicked, 125 NULL, 126 on_vdemo); 127 sig_connect( 128 &btn_vlaunch->clicked, 129 NULL, 130 on_vlaunch); 131 132 grid->add(grid, &lbl_caption->widget, 0, 0, 1, 1); 133 grid->add(grid, &btn_vterm->widget, 1, 0, 1, 1); 134 grid->add(grid, &btn_vdemo->widget, 2, 0, 1, 1); 135 grid->add(grid, &btn_vlaunch->widget, 3, 0, 1, 1); 136 window_resize(main_window, 180, 130); 137 138 window_exec(main_window); 139 task_retval(0); 140 async_manager(); 141 return 1; 142 } else { 95 143 printf("Compositor server not specified.\n"); 96 144 return 1; 97 145 } 98 99 winreg = argv[1];100 window_t *main_window = window_open(argv[1], true, true, "vlaunch");101 if (!main_window) {102 printf("Cannot open main window.\n");103 return 1;104 }105 106 pixel_t grd_bg = PIXEL(255, 240, 240, 240);107 pixel_t btn_bg = PIXEL(255, 0, 0, 0);108 pixel_t btn_fg = PIXEL(255, 240, 240, 240);109 pixel_t lbl_bg = PIXEL(255, 240, 240, 240);110 pixel_t lbl_fg = PIXEL(255, 0, 0, 0);111 112 label_t *lbl_caption = create_label(NULL, "Launch application:", 16,113 lbl_bg, lbl_fg);114 button_t *btn_vterm = create_button(NULL, "vterm", 16, btn_bg,115 btn_fg);116 button_t *btn_vdemo = create_button(NULL, "vdemo", 16, btn_bg,117 btn_fg);118 button_t *btn_vlaunch = create_button(NULL, "vlaunch", 16, btn_bg,119 btn_fg);120 grid_t *grid = create_grid(window_root(main_window), 4, 1, grd_bg);121 122 if ((!lbl_caption) || (!btn_vterm) || (!btn_vdemo) ||123 (!btn_vlaunch) || (!grid)) {124 window_close(main_window);125 printf("Cannot create widgets.\n");126 return 1;127 }128 129 sig_connect(&btn_vterm->clicked, NULL, on_vterm);130 sig_connect(&btn_vdemo->clicked, NULL, on_vdemo);131 sig_connect(&btn_vlaunch->clicked, NULL, on_vlaunch);132 133 grid->add(grid, &lbl_caption->widget, 0, 0, 1, 1);134 grid->add(grid, &btn_vterm->widget, 1, 0, 1, 1);135 grid->add(grid, &btn_vdemo->widget, 2, 0, 1, 1);136 grid->add(grid, &btn_vlaunch->widget, 3, 0, 1, 1);137 138 window_resize(main_window, 180, 130);139 window_exec(main_window);140 task_retval(0);141 async_manager();142 143 return 0;144 146 } 145 147
Note:
See TracChangeset
for help on using the changeset viewer.