X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Flttvwindow%2Flttvwindow%2Ftoolbar.c;h=feda92c57e830fa250d99c378acc22fce492eae1;hb=2d262115fc06b5ffb6038207a6d0c1d5f81763c2;hp=6497a08f4858e2335e3e4141d1cd4e08950d7fed;hpb=001d8606bfda457ee644e2ad88449d8c3053f7ab;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/toolbar.c b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/toolbar.c index 6497a08f..feda92c5 100644 --- a/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/toolbar.c +++ b/ltt/branches/poly/lttv/modules/gui/lttvwindow/lttvwindow/toolbar.c @@ -19,7 +19,6 @@ #include #include - inline LttvToolbars *lttv_toolbars_new() { return g_array_new(FALSE, FALSE, sizeof(LttvToolbarClosure)); } @@ -32,7 +31,7 @@ inline void lttv_toolbars_destroy(LttvToolbars *h) { g_array_free(h, TRUE); } -inline void lttv_toolbars_add(LttvToolbars *h, lttvwindow_viewer_constructor f, char* tooltip, char ** pixmap, GtkWidget *widget) +inline LttvToolbarClosure lttv_toolbars_add(LttvToolbars *h, lttvwindow_viewer_constructor f, char* tooltip, char ** pixmap, GtkWidget *widget) { LttvToolbarClosure c; @@ -44,20 +43,27 @@ inline void lttv_toolbars_add(LttvToolbars *h, lttvwindow_viewer_constructor f, c.pixmap = pixmap; c.widget = widget; g_array_append_val(h,c); + + return c; } -gboolean lttv_toolbars_remove(LttvToolbars *h, lttvwindow_viewer_constructor f) +GtkWidget *lttv_toolbars_remove(LttvToolbars *h, lttvwindow_viewer_constructor f) { LttvToolbarClosure * tmp; gint i; + GtkWidget *widget; + for(i=0;ilen;i++){ tmp = & g_array_index(h, LttvToolbarClosure, i); - if(tmp->con == f)break; + if(tmp->con == f) { + widget = tmp->widget; + break; + } } if(ilen){ g_array_remove_index(h, i); - return TRUE; - }else return FALSE; + return widget; + }else return NULL; } unsigned lttv_toolbars_number(LttvToolbars *h)