Enlightenment CVS committal Author : codewarrior Project : e17 Module : proto
Dir : e17/proto/etk/src/tools/etk_prefs Modified Files: etk_prefs.c Log Message: - [Etk_Prefs] We dont need to destroy the widgets in the preview pane and create them again for every theme change. Just apply the theme to the parent widget and watch it propagate to the children. werd. =================================================================== RCS file: /cvs/e/e17/proto/etk/src/tools/etk_prefs/etk_prefs.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- etk_prefs.c 31 Aug 2006 17:55:51 -0000 1.2 +++ etk_prefs.c 1 Sep 2006 13:44:20 -0000 1.3 @@ -196,7 +196,7 @@ static void _etk_prefs_theme_row_selected_cb(Etk_Object *object, Etk_Tree_Row *row, void *data) { - static Etk_Widget *child = NULL; + Etk_Widget *child = NULL; Etk_Tree *tree; char *icol_string; Etk_Widget *preview; @@ -205,11 +205,6 @@ preview = data; etk_tree_row_fields_get(row, etk_tree_nth_col_get(tree, 0), &icol_string, NULL, NULL, NULL); - if(child) - { - etk_container_remove(ETK_CONTAINER(preview), child); - etk_object_destroy(ETK_OBJECT(child)); - } child = _etk_prefs_theme_preview_get(icol_string); etk_container_add(ETK_CONTAINER(preview), child); etk_widget_show_all(child); @@ -218,7 +213,7 @@ static Etk_Widget *_etk_prefs_theme_preview_get(const char *theme) { char file[PATH_MAX]; - Etk_Widget *box; + static Etk_Widget *box = NULL; Etk_Widget *widget; Etk_Widget *vbox; Etk_Widget *frame; @@ -240,7 +235,13 @@ free(_etk_prefs_widget_theme); _etk_prefs_widget_theme = strdup(theme); - box = etk_vbox_new(ETK_FALSE, 0); + if (box) + { + etk_widget_theme_file_set(box, file); + return box; + } + + box = etk_vbox_new(ETK_FALSE, 0); etk_widget_theme_file_set(box, file); frame = etk_frame_new("Buttons"); ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs