changeset 329:740844ee48c4

Update position of light-bar after update menu item
author Thinker K.F. Li <thinker@branda.to>
date Fri, 06 Mar 2009 20:39:25 +0800
parents f61dbcd8c291
children b0571f10c1b8
files examples/menu/animated_menu.c examples/menu/filebrowser.c
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/examples/menu/animated_menu.c	Fri Mar 06 19:42:01 2009 +0800
+++ b/examples/menu/animated_menu.c	Fri Mar 06 20:39:25 2009 +0800
@@ -343,6 +343,7 @@
     m->cur = 0;
     m->titles = menus;
     mb_animated_menu_fillMenuContent(m);
+    mb_animated_menu_moveLightBar(m);
 }
 
 
--- a/examples/menu/filebrowser.c	Fri Mar 06 19:42:01 2009 +0800
+++ b/examples/menu/filebrowser.c	Fri Mar 06 20:39:25 2009 +0800
@@ -93,15 +93,16 @@
     struct fileinfo *f;
     int i;
 
-    if (data->curDir)
-	    free(data->curDir);
-    data->curDir = strdup(curdir);
     dir = opendir(curdir);
     if (dir == NULL) {
 	    printf("We can not open the direftory %s\n", curdir);
 	    return;
     }
 
+    if (data->curDir)
+	    free(data->curDir);
+    data->curDir = strdup(curdir);
+    
     if (data->files) {
 	    for(i=0;i<data->nFiles;i++) {
 		    fileinfo_free(data->files[i]);