Changes in uspace/app/vlaunch/vlaunch.c [395ca2e:87c0a45] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/vlaunch/vlaunch.c
r395ca2e r87c0a45 33 33 */ 34 34 35 #include < stdbool.h>35 #include <bool.h> 36 36 #include <errno.h> 37 37 #include <stdio.h> … … 46 46 #include <button.h> 47 47 #include <label.h> 48 #include <canvas.h>49 48 50 #include <surface.h> 51 #include <source.h> 52 #include <drawctx.h> 53 #include <codec/tga.h> 54 55 #include "images.h" 56 57 #define NAME "vlaunch" 58 59 #define LOGO_WIDTH 196 60 #define LOGO_HEIGHT 66 49 #define NAME "vlaunch" 61 50 62 51 static char *winreg = NULL; … … 108 97 } 109 98 110 surface_t *logo = decode_tga((void *) helenos_tga, helenos_tga_size, 0);111 if (!logo) {112 printf("Unable to decode logo.\n");113 return 1;114 }115 116 99 winreg = argv[1]; 117 window_t *main_window = window_open(argv[1], true, true, "vlaunch" , 0, 0);100 window_t *main_window = window_open(argv[1], true, true, "vlaunch"); 118 101 if (!main_window) { 119 102 printf("Cannot open main window.\n"); … … 127 110 pixel_t lbl_fg = PIXEL(255, 0, 0, 0); 128 111 129 canvas_t *logo_canvas = create_canvas(NULL, LOGO_WIDTH, LOGO_HEIGHT,130 logo);131 112 label_t *lbl_caption = create_label(NULL, "Launch application:", 16, 132 113 lbl_bg, lbl_fg); … … 137 118 button_t *btn_vlaunch = create_button(NULL, "vlaunch", 16, btn_bg, 138 119 btn_fg); 139 grid_t *grid = create_grid(window_root(main_window), 1, 5, grd_bg);120 grid_t *grid = create_grid(window_root(main_window), 4, 1, grd_bg); 140 121 141 if ((!l ogo_canvas) || (!lbl_caption) || (!btn_vterm) ||142 (!btn_v demo) || (!btn_vlaunch) || (!grid)) {122 if ((!lbl_caption) || (!btn_vterm) || (!btn_vdemo) || 123 (!btn_vlaunch) || (!grid)) { 143 124 window_close(main_window); 144 125 printf("Cannot create widgets.\n"); … … 150 131 sig_connect(&btn_vlaunch->clicked, NULL, on_vlaunch); 151 132 152 grid->add(grid, &logo_canvas->widget, 0, 0, 1, 1); 153 grid->add(grid, &lbl_caption->widget, 0, 1, 1, 1); 154 grid->add(grid, &btn_vterm->widget, 0, 2, 1, 1); 155 grid->add(grid, &btn_vdemo->widget, 0, 3, 1, 1); 156 grid->add(grid, &btn_vlaunch->widget, 0, 4, 1, 1); 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); 157 137 158 window_resize(main_window, 210, 130 + LOGO_HEIGHT);138 window_resize(main_window, 180, 130); 159 139 window_exec(main_window); 160 161 140 task_retval(0); 162 141 async_manager();
Note:
See TracChangeset
for help on using the changeset viewer.