Changes in uspace/app/vlaunch/vlaunch.c [87c0a45:395ca2e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/vlaunch/vlaunch.c
r87c0a45 r395ca2e 33 33 */ 34 34 35 #include < bool.h>35 #include <stdbool.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> 48 49 49 #define NAME "vlaunch" 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 50 61 51 62 static char *winreg = NULL; … … 97 108 } 98 109 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 99 116 winreg = argv[1]; 100 window_t *main_window = window_open(argv[1], true, true, "vlaunch" );117 window_t *main_window = window_open(argv[1], true, true, "vlaunch", 0, 0); 101 118 if (!main_window) { 102 119 printf("Cannot open main window.\n"); … … 110 127 pixel_t lbl_fg = PIXEL(255, 0, 0, 0); 111 128 129 canvas_t *logo_canvas = create_canvas(NULL, LOGO_WIDTH, LOGO_HEIGHT, 130 logo); 112 131 label_t *lbl_caption = create_label(NULL, "Launch application:", 16, 113 132 lbl_bg, lbl_fg); … … 118 137 button_t *btn_vlaunch = create_button(NULL, "vlaunch", 16, btn_bg, 119 138 btn_fg); 120 grid_t *grid = create_grid(window_root(main_window), 4, 1, grd_bg);139 grid_t *grid = create_grid(window_root(main_window), 1, 5, grd_bg); 121 140 122 if ((!l bl_caption) || (!btn_vterm) || (!btn_vdemo) ||123 (!btn_v launch) || (!grid)) {141 if ((!logo_canvas) || (!lbl_caption) || (!btn_vterm) || 142 (!btn_vdemo) || (!btn_vlaunch) || (!grid)) { 124 143 window_close(main_window); 125 144 printf("Cannot create widgets.\n"); … … 131 150 sig_connect(&btn_vlaunch->clicked, NULL, on_vlaunch); 132 151 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); 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); 137 157 138 window_resize(main_window, 180, 130);158 window_resize(main_window, 210, 130 + LOGO_HEIGHT); 139 159 window_exec(main_window); 160 140 161 task_retval(0); 141 162 async_manager();
Note:
See TracChangeset
for help on using the changeset viewer.