Commit fa908fcd authored by Morten Welinder's avatar Morten Welinder

GUI: Introduce gnm_xml_get_widget helper.

parent 67b055a7
2010-10-18 Morten Welinder <terra@gnome.org>
* src/gui-util.c (gnumeric_glade_group_value): Make this work for
gtk builder guis too.
(gnm_xml_get_widget): New function wrapping
go_gtk_builder_get_widget and glade_xml_get_widget.
* src/sheet-object-image.c (gnm_soi_draw_cairo): Fix printing
crash. [#632439]
......
......@@ -65,7 +65,7 @@ dialog_tool_preset_to_range (GenericToolState *state)
gnm_dao_load_range (GNM_DAO (state->gdao), sel);
gnm_dao_focus_output_range (GNM_DAO (state->gdao));
w = glade_xml_get_widget (state->gui, "notebook1");
w = gnm_xml_get_widget (state->gui, "notebook1");
g_return_if_fail (w && GTK_IS_NOTEBOOK (w));
gtk_notebook_set_current_page (GTK_NOTEBOOK(w), 0);
}
......@@ -84,7 +84,7 @@ dialog_tool_init_outputs (GenericToolState *state, GCallback sensitivity_cb)
{
GtkWidget *dao_box;
dao_box = glade_xml_get_widget (state->gui, "dao");
dao_box = gnm_xml_get_widget (state->gui, "dao");
if (dao_box == NULL) {
state->gdao = NULL;
......
......@@ -126,7 +126,7 @@ advanced_filter_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
dao = parse_output ((GenericToolState *) state, NULL);
w = glade_xml_get_widget (state->gui, "unique-button");
w = gnm_xml_get_widget (state->gui, "unique-button");
unique = (1 == gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w)));
if (dao->type == InPlaceOutput)
......
......@@ -93,7 +93,7 @@ chi_squared_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
data->alpha = gtk_spin_button_get_value
(GTK_SPIN_BUTTON (state->alpha_entry));
w = glade_xml_get_widget (state->base.gui, "test-of-independence");
w = gnm_xml_get_widget (state->base.gui, "test-of-independence");
data->independence = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
data->n_c = (data->input->v_range.cell.b.col - data->input->v_range.cell.a.col + 1);
......@@ -229,7 +229,7 @@ dialog_chi_square_tool (WBCGtk *wbcg, Sheet *sheet, gboolean independence)
else
type ="test-of-homogeneity";
gtk_toggle_button_set_active
(GTK_TOGGLE_BUTTON (glade_xml_get_widget (state->base.gui,
(GTK_TOGGLE_BUTTON (gnm_xml_get_widget (state->base.gui,
type)),
TRUE);
......
......@@ -160,12 +160,12 @@ frequency_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
data->base.input = gnm_expr_entry_parse_as_list (
GNM_EXPR_ENTRY (state->base.input_entry), state->base.sheet);
data->base.group_by = gnumeric_glade_group_value (state->base.gui, grouped_by_group);
data->base.group_by = gnm_gui_group_value (state->base.gui, grouped_by_group);
data->predetermined = gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON (state->predetermined_button));
if (data->predetermined) {
w = glade_xml_get_widget (state->base.gui, "labels_2_button");
w = gnm_xml_get_widget (state->base.gui, "labels_2_button");
data->bin = gnm_expr_entry_parse_as_value
(GNM_EXPR_ENTRY (state->base.input_entry_2),
state->base.sheet);
......@@ -174,13 +174,13 @@ frequency_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
data->bin = NULL;
}
data->chart = gnumeric_glade_group_value (state->base.gui, chart_group);
data->chart = gnm_gui_group_value (state->base.gui, chart_group);
w = glade_xml_get_widget (state->base.gui, "labels_button");
w = gnm_xml_get_widget (state->base.gui, "labels_button");
data->base.labels = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
w = glade_xml_get_widget (state->base.gui, "percentage-button");
w = gnm_xml_get_widget (state->base.gui, "percentage-button");
data->percentage = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
w = glade_xml_get_widget (state->base.gui, "exact-button");
w = gnm_xml_get_widget (state->base.gui, "exact-button");
data->exact = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
if (!cmd_analysis_tool (WORKBOOK_CONTROL (state->base.wbcg), state->base.sheet,
......
......@@ -283,7 +283,7 @@ kaplan_meier_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
}
data->median = gtk_toggle_button_get_active (
GTK_TOGGLE_BUTTON (glade_xml_get_widget
GTK_TOGGLE_BUTTON (gnm_xml_get_widget
(state->base.gui,
"median-button")));
data->chart = gtk_toggle_button_get_active (
......@@ -495,10 +495,10 @@ dialog_kaplan_meier_tool_setup_treeview (KaplanMeierToolState *state)
{
guint i;
GtkCellRenderer *renderer;
GtkWidget *scrolled = glade_xml_get_widget (state->base.gui, "groups-scrolled");
GtkWidget *scrolled = gnm_xml_get_widget (state->base.gui, "groups-scrolled");
GtkTreeSelection *selection;
state->groups_treeview = GTK_TREE_VIEW (glade_xml_get_widget
state->groups_treeview = GTK_TREE_VIEW (gnm_xml_get_widget
(state->base.gui,
"groups-tree"));
state->groups_list = gtk_list_store_new (GROUP_COLUMNS,
......@@ -626,40 +626,40 @@ dialog_kaplan_meier_tool (WBCGtk *wbcg, Sheet *sheet)
state->censorship_button = GTK_WIDGET (glade_xml_get_widget
state->censorship_button = GTK_WIDGET (gnm_xml_get_widget
(state->base.gui,
"censor-button"));
state->censor_spin_from = GTK_WIDGET (glade_xml_get_widget
state->censor_spin_from = GTK_WIDGET (gnm_xml_get_widget
(state->base.gui,
"censored-spinbutton1"));
gtk_spin_button_set_range (GTK_SPIN_BUTTON (state->censor_spin_from), 0.,G_MAXSHORT);
state->censor_spin_to = GTK_WIDGET (glade_xml_get_widget
state->censor_spin_to = GTK_WIDGET (gnm_xml_get_widget
(state->base.gui,
"censored-spinbutton2"));
gtk_spin_button_set_range (GTK_SPIN_BUTTON (state->censor_spin_to), 0.,G_MAXSHORT);
state->graph_button = GTK_WIDGET (glade_xml_get_widget
state->graph_button = GTK_WIDGET (gnm_xml_get_widget
(state->base.gui,
"graph-button"));
state->tick_button = GTK_WIDGET (glade_xml_get_widget
state->tick_button = GTK_WIDGET (gnm_xml_get_widget
(state->base.gui,
"tick-button"));
state->add_group_button = GTK_WIDGET (glade_xml_get_widget
state->add_group_button = GTK_WIDGET (gnm_xml_get_widget
(state->base.gui,
"add-button"));
state->remove_group_button = GTK_WIDGET (glade_xml_get_widget
state->remove_group_button = GTK_WIDGET (gnm_xml_get_widget
(state->base.gui,
"remove-button"));
state->std_error_button = GTK_WIDGET (glade_xml_get_widget
state->std_error_button = GTK_WIDGET (gnm_xml_get_widget
(state->base.gui,
"std-error-button"));
state->logrank_button = GTK_WIDGET (glade_xml_get_widget
state->logrank_button = GTK_WIDGET (gnm_xml_get_widget
(state->base.gui,
"logrank-button"));
state->groups_check = GTK_WIDGET (glade_xml_get_widget
state->groups_check = GTK_WIDGET (gnm_xml_get_widget
(state->base.gui,
"groups-check"));
state->groups_table = GTK_WIDGET (glade_xml_get_widget
state->groups_table = GTK_WIDGET (gnm_xml_get_widget
(state->base.gui,
"groups-table"));
state->groups_input = gnm_expr_entry_new (state->base.wbcg, TRUE);
......@@ -719,7 +719,7 @@ dialog_kaplan_meier_tool (WBCGtk *wbcg, Sheet *sheet)
gnumeric_editable_enters (GTK_WINDOW (state->base.dialog),
GTK_WIDGET (state->groups_input));
widget = glade_xml_get_widget (state->base.gui, "groups-label");
widget = gnm_xml_get_widget (state->base.gui, "groups-label");
gtk_label_set_mnemonic_widget (GTK_LABEL (widget),
GTK_WIDGET (state->groups_input));
go_atk_setup_label (widget, GTK_WIDGET (state->groups_input));
......
......@@ -150,16 +150,16 @@ normality_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
data->base.input = gnm_expr_entry_parse_as_list (
GNM_EXPR_ENTRY (state->base.input_entry), state->base.sheet);
data->base.group_by = gnumeric_glade_group_value (state->base.gui, grouped_by_group);
data->base.group_by = gnm_gui_group_value (state->base.gui, grouped_by_group);
w = glade_xml_get_widget (state->base.gui, "labels_button");
w = gnm_xml_get_widget (state->base.gui, "labels_button");
data->base.labels = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
data->alpha = gtk_spin_button_get_value
(GTK_SPIN_BUTTON (state->alpha_entry));
data->type = gnumeric_glade_group_value (state->base.gui, test_group);
data->type = gnm_gui_group_value (state->base.gui, test_group);
w = glade_xml_get_widget (state->base.gui, "normalprobabilityplot");
w = gnm_xml_get_widget (state->base.gui, "normalprobabilityplot");
data->graph = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
if (!cmd_analysis_tool (WORKBOOK_CONTROL (state->base.wbcg), state->base.sheet,
......
......@@ -119,9 +119,9 @@ principal_components_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
data->input = gnm_expr_entry_parse_as_list (
GNM_EXPR_ENTRY (state->input_entry), state->sheet);
data->group_by = gnumeric_glade_group_value (state->gui, grouped_by_group);
data->group_by = gnm_gui_group_value (state->gui, grouped_by_group);
w = glade_xml_get_widget (state->gui, "labels_button");
w = gnm_xml_get_widget (state->gui, "labels_button");
data->labels = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
if (cmd_analysis_tool (WORKBOOK_CONTROL (state->wbcg), state->sheet,
......
......@@ -206,7 +206,7 @@ sign_test_two_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
data->base.range_2 = gnm_expr_entry_parse_as_value
(GNM_EXPR_ENTRY (state->base.input_entry_2), state->base.sheet);
w = glade_xml_get_widget (state->base.gui, "labels_button");
w = gnm_xml_get_widget (state->base.gui, "labels_button");
data->base.labels = gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON (w));
......@@ -216,7 +216,7 @@ sign_test_two_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
data->base.alpha = gtk_spin_button_get_value
(GTK_SPIN_BUTTON (state->alpha_entry));
w = glade_xml_get_widget (state->base.gui, "signtest");
w = gnm_xml_get_widget (state->base.gui, "signtest");
engine = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w))
? analysis_tool_sign_test_two_engine
: analysis_tool_signed_rank_test_two_engine;
......@@ -278,7 +278,7 @@ dialog_sign_test_two_tool (WBCGtk *wbcg, Sheet *sheet, signtest_type type)
state);
int_to_entry (GTK_ENTRY (state->median_entry), 0);
w = glade_xml_get_widget (state->base.gui,
w = gnm_xml_get_widget (state->base.gui,
(type == SIGNTEST) ? "signtest"
: "signedranktest");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), TRUE);
......@@ -317,9 +317,9 @@ sign_test_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
data->base.input = gnm_expr_entry_parse_as_list (
GNM_EXPR_ENTRY (state->base.input_entry), state->base.sheet);
data->base.group_by = gnumeric_glade_group_value (state->base.gui, grouped_by_group);
data->base.group_by = gnm_gui_group_value (state->base.gui, grouped_by_group);
w = glade_xml_get_widget (state->base.gui, "labels_button");
w = gnm_xml_get_widget (state->base.gui, "labels_button");
data->base.labels = gtk_toggle_button_get_active
(GTK_TOGGLE_BUTTON (w));
......@@ -328,7 +328,7 @@ sign_test_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
data->alpha = gtk_spin_button_get_value
(GTK_SPIN_BUTTON (state->alpha_entry));
w = glade_xml_get_widget (state->base.gui, "signtest");
w = gnm_xml_get_widget (state->base.gui, "signtest");
engine = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w))
? analysis_tool_sign_test_engine
: analysis_tool_signed_rank_test_engine;
......@@ -423,7 +423,7 @@ dialog_sign_test_tool (WBCGtk *wbcg, Sheet *sheet, signtest_type type)
int_to_entry (GTK_ENTRY (state->median_entry), 0);
float_to_entry (GTK_ENTRY (state->alpha_entry), 0.05);
w = glade_xml_get_widget (state->base.gui,
w = gnm_xml_get_widget (state->base.gui,
(type == SIGNTEST) ? "signtest"
: "signedranktest");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), TRUE);
......
......@@ -84,7 +84,7 @@ wilcoxon_mann_whitney_tool_update_sensitivity_cb (G_GNUC_UNUSED GtkWidget *dummy
if (rr != NULL) {
group_by_t group_by
= gnumeric_glade_group_value
= gnm_gui_group_value
(state->gui, grouped_by_group);
range_init_rangeref (&r, rr);
len = (group_by == GROUPED_BY_ROW)
......@@ -139,9 +139,9 @@ wilcoxon_mann_whitney_tool_ok_clicked_cb (G_GNUC_UNUSED GtkWidget *button,
data->input = gnm_expr_entry_parse_as_list (
GNM_EXPR_ENTRY (state->input_entry), state->sheet);
data->group_by = gnumeric_glade_group_value (state->gui, grouped_by_group);
data->group_by = gnm_gui_group_value (state->gui, grouped_by_group);
w = glade_xml_get_widget (state->gui, "labels_button");
w = gnm_xml_get_widget (state->gui, "labels_button");
data->labels = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
if (cmd_analysis_tool (WORKBOOK_CONTROL (state->wbcg), state->sheet,
......@@ -199,7 +199,7 @@ dialog_wilcoxon_m_w_tool (WBCGtk *wbcg, Sheet *sheet)
return 0;
g_signal_connect_after
(G_OBJECT (glade_xml_get_widget
(G_OBJECT (gnm_xml_get_widget
(state->gui,
"grouped_by_row")), "toggled",
G_CALLBACK (wilcoxon_mann_whitney_tool_update_sensitivity_cb),
......
This diff is collapsed.
......@@ -71,7 +71,7 @@ map_op (AutoFilterState *state, GnmFilterOp *op,
char const *op_widget, char const *val_widget)
{
int i;
GtkWidget *w = glade_xml_get_widget (state->gui, val_widget);
GtkWidget *w = gnm_xml_get_widget (state->gui, val_widget);
char const *txt = gtk_entry_get_text (GTK_ENTRY (w));
GnmValue *v = NULL;
......@@ -79,7 +79,7 @@ map_op (AutoFilterState *state, GnmFilterOp *op,
if (txt == NULL || *txt == '\0')
return NULL;
w = glade_xml_get_widget (state->gui, op_widget);
w = gnm_xml_get_widget (state->gui, op_widget);
i = gtk_combo_box_get_active (GTK_COMBO_BOX (w));
switch (i) {
case 0: return NULL;
......@@ -134,7 +134,7 @@ cb_autofilter_ok (G_GNUC_UNUSED GtkWidget *button,
GnmFilterOp op1;
GnmValue *v1 = map_op (state, &op1, "op1", "value1");
if (op1 != GNM_FILTER_UNUSED) {
w = glade_xml_get_widget (state->gui, "and_button");
w = gnm_xml_get_widget (state->gui, "and_button");
cond = gnm_filter_condition_new_double (op0, v0,
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w)),
op1, v1);
......@@ -144,13 +144,13 @@ cb_autofilter_ok (G_GNUC_UNUSED GtkWidget *button,
} else {
int bottom, percentage, count;
w = glade_xml_get_widget (state->gui, "top_vs_bottom_option_menu");
w = gnm_xml_get_widget (state->gui, "top_vs_bottom_option_menu");
bottom = gtk_combo_box_get_active (GTK_COMBO_BOX (w));
w = glade_xml_get_widget (state->gui, "item_vs_percentage_option_menu");
w = gnm_xml_get_widget (state->gui, "item_vs_percentage_option_menu");
percentage = gtk_combo_box_get_active (GTK_COMBO_BOX (w));
w = glade_xml_get_widget (state->gui, "item_count");
w = gnm_xml_get_widget (state->gui, "item_count");
count = gtk_spin_button_get_value (GTK_SPIN_BUTTON (w));
if (bottom >= 0 && percentage >= 0)
cond = gnm_filter_condition_new_bucket (
......@@ -175,7 +175,7 @@ static void
cb_top10_type_changed (GtkComboBox *menu,
AutoFilterState *state)
{
GtkWidget *spin = glade_xml_get_widget (state->gui, "item_count");
GtkWidget *spin = gnm_xml_get_widget (state->gui, "item_count");
gtk_spin_button_set_range (GTK_SPIN_BUTTON (spin), 1.,
(gtk_combo_box_get_active (menu) > 0) ? 100. : 500.);
......@@ -185,7 +185,7 @@ static void
init_operator (AutoFilterState *state, GnmFilterOp op, GnmValue const *v,
char const *op_widget, char const *val_widget)
{
GtkWidget *w = glade_xml_get_widget (state->gui, op_widget);
GtkWidget *w = gnm_xml_get_widget (state->gui, op_widget);
char const *str = v ? value_peek_string (v) : NULL;
char *content = NULL;
int i;
......@@ -218,7 +218,7 @@ init_operator (AutoFilterState *state, GnmFilterOp op, GnmValue const *v,
}
gtk_combo_box_set_active (GTK_COMBO_BOX (w), i);
w = glade_xml_get_widget (state->gui, val_widget);
w = gnm_xml_get_widget (state->gui, val_widget);
gnumeric_editable_enters (GTK_WINDOW (state->dialog), w);
if (v != NULL)
gtk_entry_set_text (GTK_ENTRY (w), content ? content : str);
......@@ -278,20 +278,20 @@ dialog_auto_filter (WBCGtk *wbcg,
if (is_expr) {
gtk_label_set_text
(GTK_LABEL (glade_xml_get_widget (state->gui, "col-label1")), label);
(GTK_LABEL (gnm_xml_get_widget (state->gui, "col-label1")), label);
gtk_label_set_text
(GTK_LABEL (glade_xml_get_widget (state->gui, "col-label2")), label);
(GTK_LABEL (gnm_xml_get_widget (state->gui, "col-label2")), label);
} else {
gtk_label_set_text
(GTK_LABEL (glade_xml_get_widget (state->gui, "col-label")), label);
w = glade_xml_get_widget (state->gui, "item_vs_percentage_option_menu");
(GTK_LABEL (gnm_xml_get_widget (state->gui, "col-label")), label);
w = gnm_xml_get_widget (state->gui, "item_vs_percentage_option_menu");
g_signal_connect (G_OBJECT (w),
"changed",
G_CALLBACK (cb_top10_type_changed), state);
}
g_free (label);
state->dialog = glade_xml_get_widget (state->gui, "dialog");
state->dialog = gnm_xml_get_widget (state->gui, "dialog");
if (cond != NULL) {
GnmFilterOp const op = cond->op[0];
if (is_expr && 0 == (op & GNM_FILTER_OP_TYPE_MASK)) {
......@@ -300,46 +300,46 @@ dialog_auto_filter (WBCGtk *wbcg,
if (cond->op[1] != GNM_FILTER_UNUSED)
init_operator (state, cond->op[1],
cond->value[1], "op1", "value1");
w = glade_xml_get_widget (state->gui,
w = gnm_xml_get_widget (state->gui,
cond->is_and ? "and_button" : "or_button");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), TRUE);
} else if (!is_expr &&
GNM_FILTER_OP_TOP_N == (op & GNM_FILTER_OP_TYPE_MASK)) {
w = glade_xml_get_widget (state->gui, "top_vs_bottom_option_menu");
w = gnm_xml_get_widget (state->gui, "top_vs_bottom_option_menu");
gtk_combo_box_set_active (GTK_COMBO_BOX (w), (op & 1) ? 1 : 0);
w = glade_xml_get_widget (state->gui, "item_vs_percentage_option_menu");
w = gnm_xml_get_widget (state->gui, "item_vs_percentage_option_menu");
gtk_combo_box_set_active (GTK_COMBO_BOX (w), (op & 2) ? 1 : 0);
w = glade_xml_get_widget (state->gui, "item_count");
w = gnm_xml_get_widget (state->gui, "item_count");
gtk_spin_button_set_value (GTK_SPIN_BUTTON (w),
cond->count);
}
} else {
/* initialize the combo boxes (not done by libglade) */
if (is_expr) {
w = glade_xml_get_widget (state->gui, "op0");
w = gnm_xml_get_widget (state->gui, "op0");
gtk_combo_box_set_active (GTK_COMBO_BOX (w), 0);
w = glade_xml_get_widget (state->gui, "op1");
w = gnm_xml_get_widget (state->gui, "op1");
gtk_combo_box_set_active (GTK_COMBO_BOX (w), 0);
} else {
w = glade_xml_get_widget (state->gui, "top_vs_bottom_option_menu");
w = gnm_xml_get_widget (state->gui, "top_vs_bottom_option_menu");
gtk_combo_box_set_active (GTK_COMBO_BOX (w), 0);
w = glade_xml_get_widget (state->gui, "item_vs_percentage_option_menu");
w = gnm_xml_get_widget (state->gui, "item_vs_percentage_option_menu");
gtk_combo_box_set_active (GTK_COMBO_BOX (w), 0);
}
}
w = glade_xml_get_widget (state->gui, "ok_button");
w = gnm_xml_get_widget (state->gui, "ok_button");
g_signal_connect (G_OBJECT (w),
"clicked",
G_CALLBACK (cb_autofilter_ok), state);
w = glade_xml_get_widget (state->gui, "cancel_button");
w = gnm_xml_get_widget (state->gui, "cancel_button");
g_signal_connect (G_OBJECT (w),
"clicked",
G_CALLBACK (cb_autofilter_cancel), state);
/* a candidate for merging into attach guru */
gnumeric_init_help_button (
glade_xml_get_widget (state->gui, "help_button"),
gnm_xml_get_widget (state->gui, "help_button"),
is_expr ? GNUMERIC_HELP_LINK_AUTOFILTER_CUSTOM :
GNUMERIC_HELP_LINK_AUTOFILTER_TOP_TEN);
......
......@@ -500,7 +500,7 @@ cb_gridlines_item_toggled (G_GNUC_UNUSED GtkCheckMenuItem *item,
static GtkCheckMenuItem *
setup_check_item (GladeXML *gui, AutoFormatState *state, char const *name)
{
GtkCheckMenuItem *item = GTK_CHECK_MENU_ITEM (glade_xml_get_widget (gui, name));
GtkCheckMenuItem *item = GTK_CHECK_MENU_ITEM (gnm_xml_get_widget (gui, name));
g_signal_connect (G_OBJECT (item),
"toggled",
G_CALLBACK (cb_check_item_toggled), state);
......@@ -556,18 +556,18 @@ dialog_autoformat (WBCGtk *wbcg)
state->more_down = FALSE;
state->selected_template = NULL;
state->dialog = GTK_DIALOG (glade_xml_get_widget (gui, "dialog"));
state->category = GTK_COMBO_BOX (glade_xml_get_widget (gui, "format_category"));
state->scroll = GTK_VSCROLLBAR (glade_xml_get_widget (gui, "format_scroll"));
state->gridlines = GTK_CHECK_MENU_ITEM (glade_xml_get_widget (gui, "format_gridlines"));
state->dialog = GTK_DIALOG (gnm_xml_get_widget (gui, "dialog"));
state->category = GTK_COMBO_BOX (gnm_xml_get_widget (gui, "format_category"));
state->scroll = GTK_VSCROLLBAR (gnm_xml_get_widget (gui, "format_scroll"));
state->gridlines = GTK_CHECK_MENU_ITEM (gnm_xml_get_widget (gui, "format_gridlines"));
state->info_name = GTK_ENTRY (glade_xml_get_widget (gui, "format_info_name"));
state->info_author = GTK_ENTRY (glade_xml_get_widget (gui, "format_info_author"));
state->info_cat = GTK_ENTRY (glade_xml_get_widget (gui, "format_info_cat"));
state->info_descr = GTK_TEXT_VIEW (glade_xml_get_widget (gui, "format_info_descr"));
state->info_name = GTK_ENTRY (gnm_xml_get_widget (gui, "format_info_name"));
state->info_author = GTK_ENTRY (gnm_xml_get_widget (gui, "format_info_author"));
state->info_cat = GTK_ENTRY (gnm_xml_get_widget (gui, "format_info_cat"));
state->info_descr = GTK_TEXT_VIEW (gnm_xml_get_widget (gui, "format_info_descr"));
state->ok = GTK_BUTTON (glade_xml_get_widget (gui, "format_ok"));
state->cancel = GTK_BUTTON (glade_xml_get_widget (gui, "format_cancel"));
state->ok = GTK_BUTTON (gnm_xml_get_widget (gui, "format_ok"));
state->cancel = GTK_BUTTON (gnm_xml_get_widget (gui, "format_cancel"));
state->number = setup_check_item (gui, state, "format_number");
state->border = setup_check_item (gui, state, "format_border");
......@@ -584,7 +584,7 @@ dialog_autoformat (WBCGtk *wbcg)
char *name;
name = g_strdup_printf ("format_frame%d", i+1);
state->frame[i] = GTK_FRAME (glade_xml_get_widget (gui, name));
state->frame[i] = GTK_FRAME (gnm_xml_get_widget (gui, name));
g_free (name);
state->canvas[i] = GOC_CANVAS (g_object_new (GOC_TYPE_CANVAS, NULL));
......@@ -657,7 +657,7 @@ dialog_autoformat (WBCGtk *wbcg)
}
gnumeric_init_help_button (
glade_xml_get_widget (state->gui, "help_button"),
gnm_xml_get_widget (state->gui, "help_button"),
GNUMERIC_HELP_LINK_AUTOFORMAT);
gtk_dialog_set_default_response (state->dialog, GTK_RESPONSE_OK);
......
......@@ -149,12 +149,12 @@ dialog_autosave (WBCGtk *wbcg)
state->wb = wb_control_get_workbook (WORKBOOK_CONTROL (wbcg));
state->gui = gui;
state->dialog = glade_xml_get_widget (state->gui, "AutoSave");
state->minutes_entry = glade_xml_get_widget (state->gui, "minutes");
state->prompt_cb = glade_xml_get_widget (state->gui, "prompt_on_off");
state->autosave_on_off = glade_xml_get_widget (state->gui, "autosave_on_off");
state->ok_button = glade_xml_get_widget (state->gui, "button1");
state->cancel_button = glade_xml_get_widget (state->gui, "button2");
state->dialog = gnm_xml_get_widget (state->gui, "AutoSave");
state->minutes_entry = gnm_xml_get_widget (state->gui, "minutes");
state->prompt_cb = gnm_xml_get_widget (state->gui, "prompt_on_off");
state->autosave_on_off = gnm_xml_get_widget (state->gui, "autosave_on_off");
state->ok_button = gnm_xml_get_widget (state->gui, "button1");
state->cancel_button = gnm_xml_get_widget (state->gui, "button2");
if (!state->dialog || !state->minutes_entry || !state->prompt_cb ||
!state->autosave_on_off) {
......@@ -186,7 +186,7 @@ dialog_autosave (WBCGtk *wbcg)
g_object_set_data_full (G_OBJECT (state->dialog),
"state", state, (GDestroyNotify) cb_dialog_autosave_destroy);
gnumeric_init_help_button (
glade_xml_get_widget (state->gui, "button3"),
gnm_xml_get_widget (state->gui, "button3"),
GNUMERIC_HELP_LINK_AUTOSAVE);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (state->autosave_on_off),
......
......@@ -70,7 +70,7 @@ cb_cell_comment_ok_clicked (G_GNUC_UNUSED GtkWidget *button,
char const *author;
author = gtk_entry_get_text
(GTK_ENTRY (glade_xml_get_widget
(GTK_ENTRY (gnm_xml_get_widget
(state->gui, "new-author-entry")));
g_object_get (G_OBJECT (state->gtv), "text", &text,
"attributes", &attr, NULL);
......@@ -119,10 +119,10 @@ dialog_cell_comment (WBCGtk *wbcg, Sheet *sheet, GnmCellPos const *pos)
state->pos = pos;
state->gui = gui;
state->dialog = glade_xml_get_widget (state->gui, "comment_dialog");
state->dialog = gnm_xml_get_widget (state->gui, "comment_dialog");
g_return_if_fail (state->dialog != NULL);
box = glade_xml_get_widget (state->gui, "dialog-vbox");
box = gnm_xml_get_widget (state->gui, "dialog-vbox");
g_return_if_fail (box != NULL);
state->gtv = gnm_text_view_new ();
gtk_widget_show_all (GTK_WIDGET (state->gtv));
......@@ -138,8 +138,8 @@ dialog_cell_comment (WBCGtk *wbcg, Sheet *sheet, GnmCellPos const *pos)
cellref_as_string (&out, &ref, FALSE);
cell_name = g_string_free (out.accum, FALSE);
old_author = glade_xml_get_widget (state->gui, "old-author-entry");
new_author = glade_xml_get_widget (state->gui, "new-author-entry");
old_author = gnm_xml_get_widget (state->gui, "old-author-entry");
new_author = gnm_xml_get_widget (state->gui, "new-author-entry");
real_user = g_get_real_name ();
if ((real_user != NULL) && g_utf8_validate (real_user, -1, NULL)) {
......@@ -168,30 +168,30 @@ dialog_cell_comment (WBCGtk *wbcg, Sheet *sheet, GnmCellPos const *pos)
title = g_strdup_printf (_("New Cell Comment (%s)"),
cell_name);
gtk_widget_hide (old_author);
gtk_widget_hide (glade_xml_get_widget (state->gui,
gtk_widget_hide (gnm_xml_get_widget (state->gui,
"old-author-label"));
}
gtk_window_set_title (GTK_WINDOW (state->dialog), title);
g_free (title);
state->ok_button = glade_xml_get_widget (state->gui, "ok_button");
state->ok_button = gnm_xml_get_widget (state->gui, "ok_button");
g_signal_connect (G_OBJECT (state->ok_button),
"clicked",
G_CALLBACK (cb_cell_comment_ok_clicked), state);
state->cancel_button = glade_xml_get_widget (state->gui, "cancel_button");
state->cancel_button = gnm_xml_get_widget (state->gui, "cancel_button");
g_signal_connect (G_OBJECT (state->cancel_button),
"clicked",
G_CALLBACK (cb_cell_comment_cancel_clicked), state);
check = glade_xml_get_widget (state->gui, "wrap-check");
check = gnm_xml_get_widget (state->gui, "wrap-check");
g_signal_connect (G_OBJECT (check),
"toggled",
G_CALLBACK (cb_wrap_toggled), state->gtv);
cb_wrap_toggled (GTK_TOGGLE_BUTTON (check), G_OBJECT (state->gtv));
gnumeric_init_help_button (
glade_xml_get_widget (state->gui, "help_button"),
gnm_xml_get_widget (state->gui, "help_button"),
GNUMERIC_HELP_LINK_CELL_COMMENT);
wbc_gtk_attach_guru (state->wbcg, state->dialog);
......
......@@ -316,7 +316,7 @@ setup_pattern_button (GdkScreen *screen,
int const select_index,
unsigned size)
{
GtkWidget *tmp = glade_xml_get_widget (gui, name);
GtkWidget *tmp = gnm_xml_get_widget (gui, name);
if (tmp != NULL) {
GtkButton *button = GTK_BUTTON (tmp);
if (flag) {
......@@ -412,11 +412,11 @@ setup_color_pickers (FormatState *state,
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_OUT);
gtk_container_add (GTK_CONTAINER (frame), combo);
w = glade_xml_get_widget (state->gui, container);
w = gnm_xml_get_widget (state->gui, container);
gtk_box_pack_start (GTK_BOX (w), frame, FALSE, FALSE, 0);
gtk_widget_show_all (frame);
w = glade_xml_get_widget (state->gui, label);
w = gnm_xml_get_widget (state->gui, label);
gtk_label_set_mnemonic_widget (GTK_LABEL (w), combo);
if (def_sc)
......@@ -435,7 +435,7 @@ setup_color_pickers (FormatState *state,
static GtkWidget *
init_button_image (GladeXML *gui, char const *name)
{
GtkWidget *tmp = glade_xml_get_widget (gui, name);
GtkWidget *tmp = gnm_xml_get_widget (gui, name);
if (tmp != NULL) {
GdkScreen *screen = gtk_widget_get_screen (tmp);
GdkPixbuf *pixbuf = gtk_icon_theme_load_icon (
......@@ -571,7 +571,7 @@ fmt_dialog_init_align_radio (char const *const name,
FormatState *state,
GCallback handler)
{
GtkWidget *tmp = glade_xml_get_widget (state->gui, name);
GtkWidget *tmp = gnm_xml_get_widget (state->gui, name);
if (tmp != NULL) {
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (tmp),
val == target);
......@@ -649,7 +649,7 @@ fmt_dialog_init_align_page (FormatState *state)
if (0 == (state->conflicts & (1 << MSTYLE_WRAP_TEXT)))
wrap = gnm_style_get_wrap_text (state->style);
w = glade_xml_get_widget (state->gui, "align_wrap");
w = gnm_xml_get_widget (state->gui, "align_wrap");
state->align.wrap = GTK_CHECK_BUTTON (w);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), wrap);
g_signal_connect (G_OBJECT (w),
......@@ -663,8 +663,8 @@ fmt_dialog_init_align_page (FormatState *state)
state->align.indent = gnm_style_get_indent (state->style);
state->align.indent_label =
glade_xml_get_widget (state->gui, "halign_indent_label");
w = glade_xml_get_widget (state->gui, "halign_indent");
gnm_xml_get_widget (state->gui, "halign_indent_label");
w = gnm_xml_get_widget (state->gui, "halign_indent");
state->align.indent_button = GTK_SPIN_BUTTON (w);
gtk_spin_button_set_value (state->align.indent_button, state->align.indent);
gtk_widget_set_sensitive (GTK_WIDGET (state->align.indent_button),
......@@ -690,7 +690,7 @@ fmt_dialog_init_align_page (FormatState *state)
} else
r = 0;
state->align.rotation = (GORotationSel *)
glade_xml_get_widget (state->gui, "rotation_selector");
gnm_xml_get_widget (state->gui, "rotation_selector");
go_rotation_sel_set_rotation (state->align.rotation, r);
g_signal_connect (G_OBJECT (state->align.rotation), "rotation-changed",
G_CALLBACK (cb_rotation_changed), state);
......@@ -811,10 +811,10 @@ fmt_dialog_init_font_page (FormatState *state)
{
GtkWidget *tmp = font_selector_new ();
FontSelector *font_widget = FONT_SELECTOR (tmp);
GtkWidget *container = glade_xml_get_widget (state->gui, "font_box");
GtkWidget *uline = glade_xml_get_widget (state->gui, "underline_combo");
GtkWidget *container = gnm_xml_get_widget (state->gui, "font_box");
GtkWidget *uline = gnm_xml_get_widget