ui/motif/stock.c

changeset 30
34513f76d5a8
parent 22
bcf880b29bc3
child 34
0ec8a5f17782
equal deleted inserted replaced
29:c96169444d88 30:34513f76d5a8
28 28
29 #include <stdio.h> 29 #include <stdio.h>
30 #include <stdlib.h> 30 #include <stdlib.h>
31 31
32 #include "stock.h" 32 #include "stock.h"
33 #include "../ui/properties.h"
33 #include "../../ucx/map.h" 34 #include "../../ucx/map.h"
34 35
35 static UcxMap *stock_items; 36 static UcxMap *stock_items;
36 37
37 void ui_stock_init() { 38 void ui_stock_init() {
61 62
62 ucx_map_cstr_put(stock_items, id, i); 63 ucx_map_cstr_put(stock_items, id, i);
63 } 64 }
64 65
65 UiStockItem* ui_get_stock_item(char *id) { 66 UiStockItem* ui_get_stock_item(char *id) {
66 return ucx_map_cstr_get(stock_items, id); 67 UiStockItem *item = ucx_map_cstr_get(stock_items, id);
68 if(item) {
69 char *label = uistr_n(id);
70 if(label) {
71 item->label = label;
72 }
73 }
74 return item;
67 } 75 }

mercurial