annotate inkscape/firefox/template/textmenu/main.c @ 429:9d5506968efb

Change the interface of rdman_shape_stext_new(). It had better to put text as 2nd argument after rdman. Since, text content is more meaningful than x, y position for a text object.
author Thinker K.F. Li <thinker@branda.to>
date Wed, 29 Jul 2009 14:58:34 +0800
parents 7d244a85dd68
children 9b8dda201ccb
rev   line source
371
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
1 #include <stdio.h>
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
2 #include <mb.h>
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
3 #include <string.h>
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
4 //#include "menu.h"
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
5 #include "mbapp.h"
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
6 #include "animated_menu.h"
376
7d244a85dd68 Change the screen layout to make it more like an usual IDE.
wycc
parents: 371
diff changeset
7 #include "%n.h"
371
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
8
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
9
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
10 char *menus[] = {
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
11 "This is item 1",
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
12 "This is item 2",
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
13 "This is item 3",
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
14 "This is item 4",
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
15 "This is item 5",
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
16 "This is item 6",
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
17 "This is item 7",
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
18 "This is item 8"
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
19 };
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
20
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
21
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
22 MBApp *myApp;
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
23
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
24 _MyApp_InitContent(int argc, char *argv[])
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
25 {
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
26 MyAppData *data = MBAPP_DATA(myApp,MyAppData);
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
27 subject_t *key = MBAPP_keySubject(myApp);
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
28 char name[255];
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
29 coord_t *l;
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
30 int i;
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
31 mb_sprite_t *sprite=myApp->rootsprite;
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
32
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
33 data->m = mb_animated_menu_new(myApp,myApp->rootsprite,"item",menus);
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
34 mb_animated_menu_set_callback(data->m, myselect_callback);
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
35 MyApp_InitContent(myApp,argc,argv);
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
36 }
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
37
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
38 int main(int argc, char * const argv[]) {
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
39 subject_t *subject;
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
40 mb_obj_t *button;
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
41 MyAppData data;
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
42
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
43 myApp = MBApp_Init("list");
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
44 MBApp_setData(myApp,&data);
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
45 _MyApp_InitContent(argc,argv);
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
46
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
47 MBApp_loop(myApp);
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
48
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
49 return 0;
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
50 }
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
51
3d21115297ba Add textmenu template
wycc
parents:
diff changeset
52 /* vim: set ts=4 */