From c9c414c03b1e9ee87382cc93db6dcad1f8d081d6 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 18 Dec 2002 23:54:01 +0000 Subject: Just use "packet_list_set_selected_row()" to select a given row in the packet list (doing so makes the row visible as well). svn path=/trunk/; revision=6801 --- gtk/tcp_graph.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'gtk') diff --git a/gtk/tcp_graph.c b/gtk/tcp_graph.c index 6af7d280ac..5b14217ff6 100644 --- a/gtk/tcp_graph.c +++ b/gtk/tcp_graph.c @@ -3,7 +3,7 @@ * By Pavel Mores * Win32 port: rwh@unifiedtech.com * - * $Id: tcp_graph.c,v 1.25 2002/12/18 23:08:20 guy Exp $ + * $Id: tcp_graph.c,v 1.26 2002/12/18 23:54:01 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -39,10 +39,12 @@ #include "ipproto.h" #include "globals.h" /* cfile */ -#include /* frame_data */ +#include /* frame_data */ #include "gtkglobals.h" /* packet_list */ #include "simple_dialog.h" #include "ui_util.h" +#include "color.h" +#include "../ui_util.h" #include "tcp_graph.h" #include "compat_macros.h" @@ -450,7 +452,6 @@ static void graph_segment_list_free (struct graph * ); static void graph_select_segment (struct graph * , int , int ); static int line_detect_collision (struct element * , int , int ); static int arc_detect_collision (struct element * , int , int ); -static void update_packet_list (int ); static void axis_pixmaps_create (struct axis * ); static void axis_pixmaps_switch (struct axis * ); static void axis_display (struct axis * ); @@ -2515,13 +2516,13 @@ static void graph_select_segment (struct graph *g, int x, int y) case ELMT_LINE: if (line_detect_collision (e, x, y)) { int row = e->parent->num - 1; - update_packet_list (row); + packet_list_set_selected_row (row); } break; case ELMT_ARC: if (arc_detect_collision (e, x, y)) { int row = e->parent->num - 1; - update_packet_list (row); + packet_list_set_selected_row (row); } break; default: @@ -2574,16 +2575,6 @@ static int arc_detect_collision (struct element *e, int x, int y) return FALSE; } -static void update_packet_list (int row) -{ - select_packet (&cfile, row); - if (gtk_clist_row_is_visible(GTK_CLIST(packet_list), row) != - GTK_VISIBILITY_FULL) - gtk_clist_moveto(GTK_CLIST(packet_list), row, -1, 0.5, 0.5); - GTK_CLIST(packet_list)->focus_row = row; - gtk_clist_select_row(GTK_CLIST(packet_list), row, -1); -} - static void cross_xor (struct graph *g, int x, int y) { if (x > g->wp.x && x < g->wp.x+g->wp.width && -- cgit v1.2.3