X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmodules%2Fgui%2Fcontrolflow%2Fcfv.c;h=ad1e5fb77a89ebbc8f3f6294c4d99b92ace26898;hb=d86395c3cc6f958bcb2aca5063e83e2fe4194f6a;hp=a96336ff6a48ac5805bf0c5cb7843e965a5406d3;hpb=203eb6f75ad579321e4fc8dc308eb0b2d66d86d9;p=lttv.git diff --git a/ltt/branches/poly/lttv/modules/gui/controlflow/cfv.c b/ltt/branches/poly/lttv/modules/gui/controlflow/cfv.c index a96336ff..ad1e5fb7 100644 --- a/ltt/branches/poly/lttv/modules/gui/controlflow/cfv.c +++ b/ltt/branches/poly/lttv/modules/gui/controlflow/cfv.c @@ -47,6 +47,38 @@ header_size_allocate(GtkWidget *widget, return 0; } +gboolean cfv_scroll_event(GtkWidget *widget, GdkEventScroll *event, + gpointer data) +{ + ControlFlowData *control_flow_data = (ControlFlowData*)data; + unsigned int cell_height = + get_cell_height( + GTK_TREE_VIEW(control_flow_data->process_list->process_list_widget)); + gdouble new; + + switch(event->direction) { + case GDK_SCROLL_UP: + { + new = gtk_adjustment_get_value(control_flow_data->v_adjust) + - cell_height; + } + break; + case GDK_SCROLL_DOWN: + { + new = gtk_adjustment_get_value(control_flow_data->v_adjust) + + cell_height; + } + break; + default: + return FALSE; + } + if(new >= control_flow_data->v_adjust->lower && + new <= control_flow_data->v_adjust->upper + - control_flow_data->v_adjust->page_size) + gtk_adjustment_set_value(control_flow_data->v_adjust, new); + return TRUE; +} + /***************************************************************************** * Control Flow Viewer class implementation * @@ -60,12 +92,14 @@ header_size_allocate(GtkWidget *widget, * @return The widget created. */ ControlFlowData * -guicontrolflow(void) +guicontrolflow(Tab *tab) { GtkWidget *process_list_widget, *drawing_widget, *drawing_area; ControlFlowData* control_flow_data = g_new(ControlFlowData,1) ; + control_flow_data->tab = tab; + control_flow_data->v_adjust = GTK_ADJUSTMENT(gtk_adjustment_new( 0.0, /* Value */ 0.0, /* Lower */ @@ -96,6 +130,15 @@ guicontrolflow(void) GTK_ADJUSTMENT( control_flow_data->v_adjust)); + g_signal_connect (G_OBJECT(process_list_widget), + "scroll-event", + G_CALLBACK (cfv_scroll_event), + (gpointer)control_flow_data); + g_signal_connect (G_OBJECT(drawing_area), + "scroll-event", + G_CALLBACK (cfv_scroll_event), + (gpointer)control_flow_data); + g_signal_connect (G_OBJECT(control_flow_data->process_list->button), "size-allocate", G_CALLBACK(header_size_allocate),