summaryrefslogtreecommitdiff
path: root/gtk/bootp_stat.c
diff options
context:
space:
mode:
authorUlf Lamping <ulf.lamping@web.de>2004-05-23 23:24:07 +0000
committerUlf Lamping <ulf.lamping@web.de>2004-05-23 23:24:07 +0000
commitcc6836803788de14432c597fcda0ad3154b421e4 (patch)
treecd34c8b0e8333865247f8af8e7405c950d565350 /gtk/bootp_stat.c
parent9332549e99c7bee165fa47b3332e683d39cbcdad (diff)
downloadwireshark-cc6836803788de14432c597fcda0ad3154b421e4.tar.gz
use new functions in window API (ui_util.h),
use window_new instead of dlg_window_new for the statistics windows (as these are no dialog windows) do some code cleanup svn path=/trunk/; revision=10979
Diffstat (limited to 'gtk/bootp_stat.c')
-rw-r--r--gtk/bootp_stat.c33
1 files changed, 10 insertions, 23 deletions
diff --git a/gtk/bootp_stat.c b/gtk/bootp_stat.c
index 453baf7a02..cf313cc562 100644
--- a/gtk/bootp_stat.c
+++ b/gtk/bootp_stat.c
@@ -1,7 +1,7 @@
/* bootp_stat.c
* boop_stat 2003 Jean-Michel FAYARD
*
- * $Id: bootp_stat.c,v 1.26 2004/04/12 08:53:01 ulfl Exp $
+ * $Id: bootp_stat.c,v 1.27 2004/05/23 23:24:05 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -188,18 +188,6 @@ win_destroy_cb(GtkWindow *win _U_, gpointer data)
}
-static void
-dhspstat_gtk_dlg_close_cb(
- GtkButton *button _U_,
- gpointer user_data _U_)
-{
- dhcpstat_t *sp = user_data;
-
- gtk_grab_remove(GTK_WIDGET(sp->win));
- gtk_widget_destroy(GTK_WIDGET(sp->win));
-}
-
-
/* When called, this function will create a new instance of gtk2-dhcpstat.
*/
static void
@@ -231,9 +219,8 @@ dhcpstat_init(char *optarg)
}
/* top level window */
- sp->win = dlg_window_new(title);
+ sp->win = window_new(GTK_WINDOW_TOPLEVEL, title);
g_free(title);
- SIGNAL_CONNECT( sp->win, "destroy", win_destroy_cb, sp);
vbox = gtk_vbox_new(FALSE, 3);
gtk_container_add(GTK_CONTAINER(sp->win), vbox);
@@ -272,16 +259,16 @@ dhcpstat_init(char *optarg)
gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
bt_close = OBJECT_GET_DATA(bbox, GTK_STOCK_CLOSE);
- SIGNAL_CONNECT(bt_close, "clicked", dhspstat_gtk_dlg_close_cb, sp);
- gtk_widget_grab_default(bt_close);
+ window_set_cancel_button(sp->win, bt_close, window_cancel_button_cb);
+
+ SIGNAL_CONNECT(sp->win, "delete_event", window_delete_event_cb, NULL);
+ SIGNAL_CONNECT(sp->win, "destroy", win_destroy_cb, sp);
+
+ gtk_widget_show_all(sp->win);
- /* Catch the "key_press_event" signal in the window, so that we can
- catch the ESC key being pressed and act as if the "Close" button had
- been selected. */
- dlg_set_cancel(sp->win, bt_close);
+ window_present(sp->win);
- gtk_widget_show_all( sp->win );
- retap_packets(&cfile);
+ retap_packets(&cfile);
}
static tap_dfilter_dlg dhcp_stat_dlg = {