use gtk_window_set_default_size() instead of WIDGET_SET_SIZE() for the dialogs,

as WIDGET_SET_SIZE() will prevent the user from shrinking the dialog,
and gtk_window_set_default_size() will not

svn path=/trunk/; revision=11021
This commit is contained in:
Ulf Lamping 2004-05-27 19:59:50 +00:00
parent 6f8e9eeafe
commit 8d121bfb92
16 changed files with 40 additions and 46 deletions

View File

@ -1,7 +1,7 @@
/* capture_prefs.c
* Dialog box for capture preferences
*
* $Id: capture_prefs.c,v 1.33 2004/05/26 03:49:21 ulfl Exp $
* $Id: capture_prefs.c,v 1.34 2004/05/27 19:59:48 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -237,6 +237,7 @@ ifopts_edit_cb(GtkWidget *w, gpointer data _U_)
/* create a new dialog */
ifopts_edit_dlg = dlg_window_new("Ethereal: Preferences: Interface Options");
gtk_window_set_default_size(GTK_WINDOW(ifopts_edit_dlg), 570, 300);
main_vb = gtk_vbox_new(FALSE, 1);
gtk_container_border_width(GTK_CONTAINER(main_vb), 5);
@ -260,7 +261,6 @@ ifopts_edit_cb(GtkWidget *w, gpointer data _U_)
* This avoids having to remove OS (pcap) descriptions.
*/
cur_clist = gtk_clist_new_with_titles(IFOPTS_CLIST_COLS, cur_titles);
WIDGET_SET_SIZE(GTK_WIDGET(cur_clist), 570, 120);
gtk_clist_set_column_visibility(GTK_CLIST(cur_clist), 0, FALSE);
gtk_clist_set_column_width(GTK_CLIST(cur_clist), 1, 230);
gtk_clist_set_column_width(GTK_CLIST(cur_clist), 2, 260);
@ -287,7 +287,6 @@ ifopts_edit_cb(GtkWidget *w, gpointer data _U_)
/* create interface CList */
if_clist = gtk_clist_new_with_titles(1, if_title);
SIGNAL_CONNECT(if_clist, "select_row", ifopts_edit_ifsel_cb, if_clist);
WIDGET_SET_SIZE(GTK_WIDGET(if_clist), 100, 120);
gtk_clist_set_column_width(GTK_CLIST(if_clist), 0, 100);
gtk_clist_column_titles_passive(GTK_CLIST(if_clist));
gtk_clist_set_selection_mode(GTK_CLIST(if_clist), GTK_SELECTION_SINGLE);
@ -393,10 +392,6 @@ ifopts_edit_destroy_cb(GtkWidget *win, gpointer data _U_)
/* Tell it we no longer exist. */
OBJECT_SET_DATA(caller, IFOPTS_DIALOG_PTR_KEY, NULL);
}
/* Now nuke this window. */
gtk_grab_remove(GTK_WIDGET(win));
window_destroy(GTK_WIDGET(win));
}
/*

View File

@ -1,7 +1,7 @@
/* color_dlg.c
* Definitions for dialog boxes for color filters
*
* $Id: color_dlg.c,v 1.49 2004/05/26 03:49:22 ulfl Exp $
* $Id: color_dlg.c,v 1.50 2004/05/27 19:59:48 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -47,6 +47,7 @@
#include "filter_prefs.h"
#include "file_dlg.h"
#include "gtkglobals.h"
#include "prefs.h"
static GtkWidget* colorize_dialog_new(char *filter);
static void add_filter_to_list(gpointer filter_arg, gpointer list_arg);
@ -215,7 +216,7 @@ colorize_dialog_new (char *filter)
* All other widgets are always packed depending on the current window size. */
color_win = dlg_window_new ("Ethereal: Coloring Rules");
OBJECT_SET_DATA(color_win, "color_win", color_win);
gtk_window_set_default_size(GTK_WINDOW(color_win), 600, 350);
gtk_window_set_default_size(GTK_WINDOW(color_win), DEF_WIDTH, DEF_HEIGHT * 2/3);
dlg_vbox = gtk_vbox_new (FALSE, 0);
gtk_widget_ref (dlg_vbox);
OBJECT_SET_DATA_FULL(color_win, "dlg_vbox", dlg_vbox, gtk_widget_unref);

View File

@ -1,7 +1,7 @@
/* dcerpc_stat.c
* dcerpc_stat 2002 Ronnie Sahlberg
*
* $Id: dcerpc_stat.c,v 1.56 2004/05/23 23:24:05 ulfl Exp $
* $Id: dcerpc_stat.c,v 1.57 2004/05/27 19:59:48 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -560,6 +560,7 @@ gtk_dcerpcstat_cb(GtkWidget *w _U_, gpointer d _U_)
}
dlg=dlg_window_new("Ethereal: Compute DCE-RPC SRT statistics");
gtk_window_set_default_size(GTK_WINDOW(dlg), 400, -1);
dlg_box=gtk_vbox_new(FALSE, 10);
gtk_container_border_width(GTK_CONTAINER(dlg_box), 10);
@ -628,7 +629,6 @@ gtk_dcerpcstat_cb(GtkWidget *w _U_, gpointer d _U_)
/* Filter entry */
filter_entry=gtk_entry_new();
WIDGET_SET_SIZE(filter_entry, 300, -1);
SIGNAL_CONNECT(filter_entry, "changed", filter_te_syntax_check_cb, NULL);
gtk_box_pack_start(GTK_BOX(filter_box), filter_entry, TRUE, TRUE, 0);
filter=gtk_entry_get_text(GTK_ENTRY(main_display_filter_widget));

View File

@ -7,7 +7,7 @@
* Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com> and
* Guy Harris <guy@alum.mit.edu>
*
* $Id: dfilter_expr_dlg.c,v 1.56 2004/05/26 03:49:22 ulfl Exp $
* $Id: dfilter_expr_dlg.c,v 1.57 2004/05/27 19:59:48 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -1082,6 +1082,7 @@ dfilter_expr_dlg_new(GtkWidget *filter_te)
#endif
window = dlg_window_new("Ethereal: Filter Expression");
gtk_window_set_default_size(GTK_WINDOW(window), 500, 400);
gtk_container_set_border_width(GTK_CONTAINER(window), 5);
main_vb = gtk_vbox_new(FALSE, 5);
@ -1105,9 +1106,9 @@ dfilter_expr_dlg_new(GtkWidget *filter_te)
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(tree_scrolled_win),
GTK_SHADOW_IN);
#endif
gtk_box_pack_start(GTK_BOX(field_vb), tree_scrolled_win, TRUE, TRUE, 0);
WIDGET_SET_SIZE(tree_scrolled_win, 300, -1);
WIDGET_SET_SIZE(tree_scrolled_win, 300, 400);
gtk_box_pack_start(GTK_BOX(field_vb), tree_scrolled_win, FALSE, FALSE, 0);
#if GTK_MAJOR_VERSION < 2
field_tree = ctree_new(1, 0);

View File

@ -1,7 +1,7 @@
/* fc_stat.c
* fc_stat 2003 Ronnie Sahlberg
*
* $Id: fc_stat.c,v 1.32 2004/05/23 23:24:05 ulfl Exp $
* $Id: fc_stat.c,v 1.33 2004/05/27 19:59:49 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -245,6 +245,7 @@ gtk_fcstat_cb(GtkWidget *w _U_, gpointer d _U_)
}
dlg=dlg_window_new("Ethereal: Compute Fibre Channel Service Response Time statistics");
gtk_window_set_default_size(GTK_WINDOW(dlg), 400, -1);
dlg_box=gtk_vbox_new(FALSE, 10);
gtk_container_border_width(GTK_CONTAINER(dlg_box), 10);
@ -262,7 +263,6 @@ gtk_fcstat_cb(GtkWidget *w _U_, gpointer d _U_)
/* Filter entry */
filter_entry=gtk_entry_new();
WIDGET_SET_SIZE(filter_entry, 300, -1);
SIGNAL_CONNECT(filter_entry, "changed", filter_te_syntax_check_cb, NULL);
/* filter prefs dialog */

View File

@ -1,7 +1,7 @@
/* file_dlg.c
* Dialog boxes for handling files
*
* $Id: file_dlg.c,v 1.106 2004/05/26 03:49:22 ulfl Exp $
* $Id: file_dlg.c,v 1.107 2004/05/27 19:59:49 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -115,6 +115,8 @@ file_open_cmd(GtkWidget *w)
file_open_w = file_selection_new("Ethereal: Open Capture File",
FILE_SELECTION_OPEN);
/* window is already shown here, gtk_window_set_default_size() will not work */
WIDGET_SET_SIZE(file_open_w, DEF_WIDTH, DEF_HEIGHT);
#if GTK_MAJOR_VERSION < 2
/* Accelerator group for the accelerators (or, as they're called in

View File

@ -3,7 +3,7 @@
* (This used to be a notebook page under "Preferences", hence the
* "prefs" in the file name.)
*
* $Id: filter_prefs.c,v 1.64 2004/05/27 17:08:50 ulfl Exp $
* $Id: filter_prefs.c,v 1.65 2004/05/27 19:59:49 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -361,6 +361,7 @@ filter_dialog_new(GtkWidget *button, GtkWidget *parent_filter_te,
tooltips = gtk_tooltips_new ();
main_w = dlg_window_new(construct_args->title);
gtk_window_set_default_size(GTK_WINDOW(main_w), 400, 400);
OBJECT_SET_DATA(main_w, E_FILT_CONSTRUCT_ARGS_KEY, construct_args);
main_vb = gtk_vbox_new(FALSE, 0);
@ -423,7 +424,6 @@ filter_dialog_new(GtkWidget *button, GtkWidget *parent_filter_te,
GTK_SHADOW_IN);
#endif
WIDGET_SET_SIZE(filter_sc, 250, 150);
gtk_container_set_border_width (GTK_CONTAINER (filter_sc), 5);
gtk_container_add(GTK_CONTAINER(filter_fr), filter_sc);
gtk_widget_show(filter_sc);
@ -455,7 +455,6 @@ filter_dialog_new(GtkWidget *button, GtkWidget *parent_filter_te,
#else
gtk_container_add(GTK_CONTAINER(filter_sc), filter_l);
#endif
WIDGET_SET_SIZE(filter_sc, 400, 300);
gtk_widget_show(filter_l);
OBJECT_SET_DATA(filter_l, E_FILT_DBLFUNC_KEY, filter_dlg_dclick);

View File

@ -2,7 +2,7 @@
* h225 message counter for ethereal
* Copyright 2003 Lars Roland
*
* $Id: h225_counter.c,v 1.20 2004/05/23 23:24:05 ulfl Exp $
* $Id: h225_counter.c,v 1.21 2004/05/27 19:59:49 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -524,6 +524,7 @@ gtk_h225counter_init(char *optarg)
h225counter_reset(hs);
hs->win=window_new(GTK_WINDOW_TOPLEVEL, "Ethereal: H225 counters");
gtk_window_set_default_size(GTK_WINDOW(hs->win), 400, 200);
hs->vbox=gtk_vbox_new(FALSE, 3);
gtk_container_set_border_width(GTK_CONTAINER(hs->vbox), 12);
@ -532,7 +533,6 @@ gtk_h225counter_init(char *optarg)
/* init a scrolled window*/
hs->scrolled_window = scrolled_window_new(NULL, NULL);
WIDGET_SET_SIZE(hs->scrolled_window, 400, 200);
hs->table = create_stat_table(hs->scrolled_window, hs->vbox, 2, titles);

View File

@ -2,7 +2,7 @@
* h225 RAS Service Response Time statistics for ethereal
* Copyright 2003 Lars Roland
*
* $Id: h225_ras_srt.c,v 1.17 2004/05/23 23:24:05 ulfl Exp $
* $Id: h225_ras_srt.c,v 1.18 2004/05/27 19:59:49 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -304,6 +304,7 @@ gtk_h225rassrt_init(char *optarg)
h225rassrt_reset(hs);
hs->win=window_new(GTK_WINDOW_TOPLEVEL, "h225-ras-srt");
gtk_window_set_default_size(GTK_WINDOW(hs->win), 600, 300);
hs->vbox=gtk_vbox_new(FALSE, 3);
gtk_container_set_border_width(GTK_CONTAINER(hs->vbox), 12);
@ -312,7 +313,6 @@ gtk_h225rassrt_init(char *optarg)
/* init a scrolled window*/
hs->scrolled_window = scrolled_window_new(NULL, NULL);
WIDGET_SET_SIZE(hs->scrolled_window, 600, 160);
hs->table = create_stat_table(hs->scrolled_window, hs->vbox, 11, titles);

View File

@ -1,7 +1,7 @@
/* ldap_stat.c
* ldap_stat 2003 Ronnie Sahlberg
*
* $Id: ldap_stat.c,v 1.20 2004/05/23 23:24:06 ulfl Exp $
* $Id: ldap_stat.c,v 1.21 2004/05/27 19:59:49 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -280,6 +280,7 @@ gtk_ldapstat_cb(GtkWidget *w _U_, gpointer d _U_)
}
dlg=dlg_window_new("Ethereal: Compute LDAP Service Response Time statistics");
gtk_window_set_default_size(GTK_WINDOW(dlg), 300, -1);
dlg_box=gtk_vbox_new(FALSE, 10);
gtk_container_border_width(GTK_CONTAINER(dlg_box), 10);
@ -297,7 +298,6 @@ gtk_ldapstat_cb(GtkWidget *w _U_, gpointer d _U_)
/* Filter entry */
filter_entry=gtk_entry_new();
WIDGET_SET_SIZE(filter_entry, 300, -1);
SIGNAL_CONNECT(filter_entry, "changed", filter_te_syntax_check_cb, NULL);
/* filter prefs dialog */

View File

@ -2,7 +2,7 @@
* mgcp-statistics for ethereal
* Copyright 2003 Lars Roland
*
* $Id: mgcp_stat.c,v 1.35 2004/05/23 23:24:06 ulfl Exp $
* $Id: mgcp_stat.c,v 1.36 2004/05/27 19:59:49 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -279,6 +279,7 @@ gtk_mgcpstat_init(char *optarg)
mgcpstat_reset(ms);
ms->win=window_new(GTK_WINDOW_TOPLEVEL, "MGCP SRT");
gtk_window_set_default_size(GTK_WINDOW(ms->win), 550, 150);
ms->vbox=gtk_vbox_new(FALSE, 3);
@ -287,7 +288,6 @@ gtk_mgcpstat_init(char *optarg)
/* GTK1 using a scrollable clist*/
/* init a scrolled window*/
ms->scrolled_window = scrolled_window_new(NULL, NULL);
WIDGET_SET_SIZE(ms->scrolled_window, 550, 150);
ms->table = create_stat_table(ms->scrolled_window, ms->vbox, 7, titles);

View File

@ -1,6 +1,6 @@
/* proto_dlg.c
*
* $Id: proto_dlg.c,v 1.33 2004/05/26 03:49:24 ulfl Exp $
* $Id: proto_dlg.c,v 1.34 2004/05/27 19:59:49 ulfl Exp $
*
* Laurent Deniel <laurent.deniel@free.fr>
*
@ -113,12 +113,12 @@ proto_cb(GtkWidget *w _U_, gpointer data _U_)
}
proto_w = dlg_window_new("Ethereal: Enabled Protocols");
gtk_window_set_default_size(GTK_WINDOW(proto_w), DEF_WIDTH * 2/3, DEF_HEIGHT * 2/3);
gtk_window_set_default_size(GTK_WINDOW(proto_w), DEF_WIDTH * 2/3, DEF_HEIGHT);
/* Container for each row of widgets */
main_vb = gtk_vbox_new(FALSE, 0);
gtk_container_border_width(GTK_CONTAINER(main_vb), 1);
main_vb = gtk_vbox_new(FALSE, 6);
gtk_container_border_width(GTK_CONTAINER(main_vb), 6);
gtk_container_add(GTK_CONTAINER(proto_w), main_vb);
gtk_widget_show(main_vb);
@ -126,13 +126,11 @@ proto_cb(GtkWidget *w _U_, gpointer data _U_)
proto_frame = gtk_frame_new("Enabled Protocols");
gtk_box_pack_start(GTK_BOX(main_vb), proto_frame, TRUE, TRUE, 0);
gtk_container_border_width(GTK_CONTAINER(proto_frame), 5);
gtk_widget_show(proto_frame);
/* Protocol list */
proto_vb = gtk_vbox_new(FALSE, 0);
gtk_container_border_width(GTK_CONTAINER(proto_vb), 1);
gtk_container_add(GTK_CONTAINER(proto_frame), proto_vb);
gtk_container_border_width(GTK_CONTAINER(proto_vb), 5);
gtk_widget_show(proto_vb);
@ -190,7 +188,7 @@ proto_cb(GtkWidget *w _U_, gpointer data _U_)
label = gtk_label_new("Disabling a protocol prevents higher "
"layer protocols from being displayed");
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5);
gtk_widget_show(label);
gtk_box_pack_start(GTK_BOX(proto_vb), label, FALSE, FALSE, 5);
@ -376,8 +374,6 @@ proto_destroy_cb(GtkWidget *w _U_, gpointer data _U_)
{
GSList *entry;
if (proto_w)
window_destroy(proto_w);
proto_w = NULL;
/* remove protocol list */

View File

@ -1,7 +1,7 @@
/* rpc_stat.c
* rpc_stat 2002 Ronnie Sahlberg
*
* $Id: rpc_stat.c,v 1.46 2004/05/23 23:24:06 ulfl Exp $
* $Id: rpc_stat.c,v 1.47 2004/05/27 19:59:50 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -419,6 +419,7 @@ gtk_rpcstat_cb(GtkWidget *w _U_, gpointer d _U_)
}
dlg=dlg_window_new("Ethereal: Compute ONC-RPC SRT statistics");
gtk_window_set_default_size(GTK_WINDOW(dlg), 300, -1);
dlg_box=gtk_vbox_new(FALSE, 10);
gtk_container_border_width(GTK_CONTAINER(dlg_box), 10);
@ -484,7 +485,6 @@ gtk_rpcstat_cb(GtkWidget *w _U_, gpointer d _U_)
/* Filter entry */
filter_entry=gtk_entry_new();
WIDGET_SET_SIZE(filter_entry, 300, -1);
SIGNAL_CONNECT(filter_entry, "changed", filter_te_syntax_check_cb, NULL);
/* filter prefs dialog */

View File

@ -1,7 +1,7 @@
/* rtp_analysis.c
* RTP analysis addition for ethereal
*
* $Id: rtp_analysis.c,v 1.43 2004/05/26 03:49:24 ulfl Exp $
* $Id: rtp_analysis.c,v 1.44 2004/05/27 19:59:50 ulfl Exp $
*
* Copyright 2003, Alcatel Business Systems
* By Lars Ruoff <lars.ruoff@gmx.net>
@ -1905,6 +1905,7 @@ void create_rtp_dialog(user_data_t* user_data)
window = window_new(GTK_WINDOW_TOPLEVEL, "Ethereal: RTP Stream Analysis");
gtk_window_set_default_size(GTK_WINDOW(window), 560, 400);
/* Container for each row of widgets */
main_vb = gtk_vbox_new(FALSE, 2);
@ -1948,7 +1949,6 @@ void create_rtp_dialog(user_data_t* user_data)
/* scrolled window */
scrolled_window = scrolled_window_new(NULL, NULL);
WIDGET_SET_SIZE(scrolled_window, 560, 200);
/* packet clist */
clist_fwd = create_clist(user_data);
@ -1970,7 +1970,6 @@ void create_rtp_dialog(user_data_t* user_data)
gtk_box_pack_end(GTK_BOX(page_r), label_stats_rev, FALSE, FALSE, 0);
scrolled_window_r = scrolled_window_new(NULL, NULL);
WIDGET_SET_SIZE(scrolled_window_r, 560, 200);
clist_rev = create_clist(user_data);
gtk_widget_show(clist_rev);
@ -2039,6 +2038,7 @@ void create_rtp_dialog(user_data_t* user_data)
close_bt = BUTTON_NEW_FROM_STOCK(GTK_STOCK_CLOSE);
gtk_container_add(GTK_CONTAINER(box4), close_bt);
GTK_WIDGET_SET_FLAGS(close_bt, GTK_CAN_DEFAULT);
gtk_widget_show(close_bt);
window_set_cancel_button(window, close_bt, window_cancel_button_cb);

View File

@ -1,7 +1,7 @@
/* smb_stat.c
* smb_stat 2003 Ronnie Sahlberg
*
* $Id: smb_stat.c,v 1.43 2004/05/23 23:24:06 ulfl Exp $
* $Id: smb_stat.c,v 1.44 2004/05/27 19:59:50 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -283,6 +283,7 @@ gtk_smbstat_cb(GtkWidget *w _U_, gpointer d _U_)
}
dlg=dlg_window_new("Ethereal: Compute SMB SRT statistics");
gtk_window_set_default_size(GTK_WINDOW(dlg), 300, -1);
dlg_box=gtk_vbox_new(FALSE, 10);
gtk_container_border_width(GTK_CONTAINER(dlg_box), 10);
@ -300,7 +301,6 @@ gtk_smbstat_cb(GtkWidget *w _U_, gpointer d _U_)
/* Filter entry */
filter_entry=gtk_entry_new();
WIDGET_SET_SIZE(filter_entry, 300, -1);
SIGNAL_CONNECT(filter_entry, "changed", filter_te_syntax_check_cb, NULL);
/* filter prefs dialog */

View File

@ -2,7 +2,7 @@
* Routines for display filter dialog used by gui taps
* Copyright 2003 Lars Roland
*
* $Id: tap_dfilter_dlg.c,v 1.8 2004/05/23 23:24:06 ulfl Exp $
* $Id: tap_dfilter_dlg.c,v 1.9 2004/05/27 19:59:50 ulfl Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -158,6 +158,7 @@ gtk_tap_dfilter_dlg_cb(GtkWidget *w _U_, gpointer data)
title = g_strdup_printf("Ethereal: %s: %s", current_dlg->cont.win_title , cf_get_display_name(&cfile));
current_dlg->dlg=dlg_window_new(title);
gtk_window_set_default_size(GTK_WINDOW(current_dlg->dlg), 300, -1);
g_free(title);
dlg_box=gtk_vbox_new(FALSE, 10);
@ -176,7 +177,6 @@ gtk_tap_dfilter_dlg_cb(GtkWidget *w _U_, gpointer data)
/* Filter entry */
current_dlg->filter_entry=gtk_entry_new();
WIDGET_SET_SIZE(current_dlg->filter_entry, 300, 25);
SIGNAL_CONNECT(current_dlg->filter_entry, "changed", filter_te_syntax_check_cb, NULL);
/* filter prefs dialog */