Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/bin Modified Files: main.c Log Message: - API Breakage - Break the tree2 api to fully hook into the new mvc calls - use the mvc_view_set to set the column view onto the tree that view will receive the column number and is responsible for creating the correct widget - various other changes see the test app... =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/bin/main.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -3 -r1.60 -r1.61 --- main.c 23 Mar 2007 22:06:30 -0000 1.60 +++ main.c 25 Mar 2007 04:25:58 -0000 1.61 @@ -62,6 +62,7 @@ static void ewl_test_cb_test_selected(Ewl_Widget *w, void *ev, void *data); static Ewl_Widget *cb_unit_test_header_fetch(void *data, int column); +static void *cb_unit_test_header_data_fetch(void *data, int column); static void *cb_unit_test_fetch(void *data, unsigned int row, unsigned int column); static int cb_unit_test_count(void *data); @@ -471,15 +472,15 @@ ewl_container_child_append(EWL_CONTAINER(note), tree); ewl_notebook_page_tab_text_set(EWL_NOTEBOOK(note), tree, "Tests"); ewl_tree2_headers_visible_set(EWL_TREE2(tree), FALSE); + ewl_tree2_column_count_set(EWL_TREE2(tree), 1); ewl_mvc_selection_mode_set(EWL_MVC(tree), EWL_SELECTION_MODE_SINGLE); ewl_mvc_model_set(EWL_MVC(tree), model); + ewl_mvc_view_set(EWL_MVC(tree), ewl_label_view_get()); ewl_mvc_data_set(EWL_MVC(tree), categories); ewl_callback_append(tree, EWL_CALLBACK_VALUE_CHANGED, ewl_test_cb_test_selected, NULL); ewl_widget_show(tree); - view = ewl_label_view_get(); - ewl_tree2_column_append(EWL_TREE2(tree), view, FALSE); /* add the tests to the category rows */ ecore_list_goto_first(tests); @@ -521,21 +522,20 @@ model = ewl_model_new(); ewl_model_data_fetch_set(model, cb_unit_test_fetch); + ewl_model_data_header_fetch_set(model, cb_unit_test_header_data_fetch); ewl_model_data_count_set(model, cb_unit_test_count); + view = ewl_view_clone(ewl_label_view_get()); + ewl_view_header_fetch_set(view, cb_unit_test_header_fetch); + o2 = ewl_tree2_new(); + ewl_tree2_column_count_set(EWL_TREE2(o2), 3); ewl_container_child_append(EWL_CONTAINER(o), o2); ewl_mvc_model_set(EWL_MVC(o2), model); + ewl_mvc_view_set(EWL_MVC(o2), view); ewl_widget_name_set(o2, "unit_test_tree"); ewl_widget_show(o2); - view = ewl_view_clone(ewl_label_view_get()); - ewl_view_header_fetch_set(view, cb_unit_test_header_fetch); - - ewl_tree2_column_append(EWL_TREE2(o2), view, FALSE); - ewl_tree2_column_append(EWL_TREE2(o2), view, FALSE); - ewl_tree2_column_append(EWL_TREE2(o2), view, FALSE); - o2 = ewl_hbox_new(); ewl_container_child_append(EWL_CONTAINER(o), o2); ewl_object_fill_policy_set(EWL_OBJECT(o2), EWL_FLAG_FILL_HFILL); @@ -1101,22 +1101,26 @@ free(sel); } +static void * +cb_unit_test_header_data_fetch(void *data, int column) +{ + if (column == 0) + return "Test"; + + if (column == 1) + return "Status"; + + return "Failure Reason"; +} + static Ewl_Widget * -cb_unit_test_header_fetch(void *data, int column) +cb_unit_test_header_fetch(void *data, int column __UNUSED__) { Ewl_Widget *label; label = ewl_label_new(); + ewl_label_text_set(EWL_LABEL(label), data); ewl_widget_show(label); - - if (column == 0) - ewl_label_text_set(EWL_LABEL(label), "Test"); - - else if (column == 1) - ewl_label_text_set(EWL_LABEL(label), "Status"); - - else - ewl_label_text_set(EWL_LABEL(label), "Failure Reason"); return label; } ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs