diff options
author | Olivier Abad <oabad@noos.fr> | 2002-11-11 15:39:06 +0000 |
---|---|---|
committer | Olivier Abad <oabad@noos.fr> | 2002-11-11 15:39:06 +0000 |
commit | 29011060dee28a8ef2be7a833ee4bafb2137c3e1 (patch) | |
tree | e43f3076f0ab40791245e274e7f18470533bdd30 /gtk/goto_dlg.c | |
parent | c2c5e20927a17ab9d0ede271f947881ab6f4650b (diff) |
Use gtk1/gtk2 compatibility macros to reduce #ifdefs.
svn path=/trunk/; revision=6610
Diffstat (limited to 'gtk/goto_dlg.c')
-rw-r--r-- | gtk/goto_dlg.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/gtk/goto_dlg.c b/gtk/goto_dlg.c index 48ff9caddf..a07b00ab1e 100644 --- a/gtk/goto_dlg.c +++ b/gtk/goto_dlg.c @@ -1,7 +1,7 @@ /* goto_dlg.c * Routines for "go to frame" window * - * $Id: goto_dlg.c,v 1.18 2002/11/03 17:38:33 oabad Exp $ + * $Id: goto_dlg.c,v 1.19 2002/11/11 15:39:05 oabad Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -35,6 +35,7 @@ #include "goto_dlg.h" #include "simple_dialog.h" #include "dlg_utils.h" +#include "compat_macros.h" /* Capture callback data keys */ #define E_GOTO_FNUMBER_KEY "goto_fnumber_te" @@ -81,14 +82,10 @@ goto_frame_cb(GtkWidget *w _U_, gpointer d _U_) #if GTK_MAJOR_VERSION < 2 ok_bt = gtk_button_new_with_label ("OK"); - gtk_signal_connect(GTK_OBJECT(ok_bt), "clicked", - GTK_SIGNAL_FUNC(goto_frame_ok_cb), - GTK_OBJECT(goto_frame_w)); #else ok_bt = gtk_button_new_from_stock(GTK_STOCK_OK); - g_signal_connect(G_OBJECT(ok_bt), "clicked", - G_CALLBACK(goto_frame_ok_cb), G_OBJECT(goto_frame_w)); #endif + SIGNAL_CONNECT(ok_bt, "clicked", goto_frame_ok_cb, goto_frame_w); GTK_WIDGET_SET_FLAGS(ok_bt, GTK_CAN_DEFAULT); gtk_box_pack_start (GTK_BOX (bbox), ok_bt, TRUE, TRUE, 0); gtk_widget_grab_default(ok_bt); @@ -96,20 +93,16 @@ goto_frame_cb(GtkWidget *w _U_, gpointer d _U_) #if GTK_MAJOR_VERSION < 2 cancel_bt = gtk_button_new_with_label ("Cancel"); - gtk_signal_connect(GTK_OBJECT(cancel_bt), "clicked", - GTK_SIGNAL_FUNC(goto_frame_close_cb), - GTK_OBJECT(goto_frame_w)); #else cancel_bt = gtk_button_new_from_stock(GTK_STOCK_CANCEL); - g_signal_connect(G_OBJECT(cancel_bt), "clicked", - G_CALLBACK(goto_frame_close_cb), G_OBJECT(goto_frame_w)); #endif + SIGNAL_CONNECT(cancel_bt, "clicked", goto_frame_close_cb, goto_frame_w); GTK_WIDGET_SET_FLAGS(cancel_bt, GTK_CAN_DEFAULT); gtk_box_pack_start (GTK_BOX (bbox), cancel_bt, TRUE, TRUE, 0); gtk_widget_show(cancel_bt); /* Attach pointers to needed widgets to the capture prefs window/object */ - gtk_object_set_data(GTK_OBJECT(goto_frame_w), E_GOTO_FNUMBER_KEY, fnumber_te); + OBJECT_SET_DATA(goto_frame_w, E_GOTO_FNUMBER_KEY, fnumber_te); /* Catch the "activate" signal on the frame number text entry, so that if the user types Return there, we act as if the "OK" button @@ -136,7 +129,7 @@ goto_frame_ok_cb(GtkWidget *ok_bt _U_, gpointer parent_w) guint fnumber; char *p; - fnumber_te = (GtkWidget *) gtk_object_get_data(GTK_OBJECT(parent_w), E_GOTO_FNUMBER_KEY); + fnumber_te = (GtkWidget *)OBJECT_GET_DATA(parent_w, E_GOTO_FNUMBER_KEY); fnumber_text = gtk_entry_get_text(GTK_ENTRY(fnumber_te)); fnumber = strtoul(fnumber_text, &p, 10); |