comparison examples/dynamic/main.c @ 230:3e6da6f6a226

Call the button callback when the button is clicked
author wycc
date Wed, 17 Dec 2008 21:37:39 +0800
parents cc8dd16d8b6a
children d347a577a232
comparison
equal deleted inserted replaced
229:cc8dd16d8b6a 230:3e6da6f6a226
116 mb_visibility_new(VIS_HIDDEN, btn->click, word); 116 mb_visibility_new(VIS_HIDDEN, btn->click, word);
117 mb_visibility_new(VIS_VISIBLE, btn->active, word); 117 mb_visibility_new(VIS_VISIBLE, btn->active, word);
118 mb_progm_free_completed(progm); 118 mb_progm_free_completed(progm);
119 get_now(&now); 119 get_now(&now);
120 mb_progm_start(progm, X_MB_tman(en->rt), &now); 120 mb_progm_start(progm, X_MB_tman(en->rt), &now);
121 if (btn->press)
122 btn->press(btn->arg);
121 } 123 }
122 mb_button_t *mb_button_new(engine_t *en,mb_sprite_t *sp, char *name) 124 mb_button_t *mb_button_new(engine_t *en,mb_sprite_t *sp, char *name)
123 { 125 {
124 mb_button_t *btn = (mb_button_t *) malloc(sizeof(mb_button_t)); 126 mb_button_t *btn = (mb_button_t *) malloc(sizeof(mb_button_t));
125 char *buf = (char *) malloc(strlen(name)+5); 127 char *buf = (char *) malloc(strlen(name)+5);