comparison inkscape/firefox/template/textmenu/main.c @ 371:3d21115297ba

Add textmenu template
author wycc
date Tue, 17 Mar 2009 08:31:04 +0800
parents
children 7d244a85dd68
comparison
equal deleted inserted replaced
370:fce37d9c296f 371:3d21115297ba
1 #include <stdio.h>
2 #include <mb.h>
3 #include <string.h>
4 //#include "menu.h"
5 #include "mbapp.h"
6 #include "animated_menu.h"
7 #include "app.h"
8
9
10 char *menus[] = {
11 "This is item 1",
12 "This is item 2",
13 "This is item 3",
14 "This is item 4",
15 "This is item 5",
16 "This is item 6",
17 "This is item 7",
18 "This is item 8"
19 };
20
21
22 MBApp *myApp;
23
24 _MyApp_InitContent(int argc, char *argv[])
25 {
26 MyAppData *data = MBAPP_DATA(myApp,MyAppData);
27 subject_t *key = MBAPP_keySubject(myApp);
28 char name[255];
29 coord_t *l;
30 int i;
31 mb_sprite_t *sprite=myApp->rootsprite;
32
33 data->m = mb_animated_menu_new(myApp,myApp->rootsprite,"item",menus);
34 mb_animated_menu_set_callback(data->m, myselect_callback);
35 MyApp_InitContent(myApp,argc,argv);
36 }
37
38 int main(int argc, char * const argv[]) {
39 subject_t *subject;
40 mb_obj_t *button;
41 MyAppData data;
42
43 myApp = MBApp_Init("list");
44 MBApp_setData(myApp,&data);
45 _MyApp_InitContent(argc,argv);
46
47 MBApp_loop(myApp);
48
49 return 0;
50 }
51
52 /* vim: set ts=4 */