forked from AuroraMiddleware/gtk
Use gtk_combo_box_set_child throughout
This commit is contained in:
parent
5d26af06e4
commit
ec394e805b
@ -421,8 +421,7 @@ do_combobox (GtkWidget *do_widget)
|
||||
entry = g_object_new (TYPE_MASK_ENTRY, NULL);
|
||||
MASK_ENTRY (entry)->mask = "^([0-9]*|One|Two|2\302\275|Three)$";
|
||||
|
||||
gtk_container_remove (GTK_CONTAINER (combo), gtk_bin_get_child (GTK_BIN (combo)));
|
||||
gtk_container_add (GTK_CONTAINER (combo), entry);
|
||||
gtk_combo_box_set_child (GTK_COMBO_BOX (combo), entry);
|
||||
|
||||
/* A combobox with string IDs */
|
||||
frame = gtk_frame_new ("String IDs");
|
||||
|
@ -307,13 +307,13 @@ create_combo_box_entry (void)
|
||||
|
||||
model = (GtkTreeModel *)gtk_list_store_new (1, G_TYPE_STRING);
|
||||
widget = g_object_new (GTK_TYPE_COMBO_BOX,
|
||||
"has-entry", TRUE,
|
||||
"model", model,
|
||||
"entry-text-column", 0,
|
||||
NULL);
|
||||
"has-entry", TRUE,
|
||||
"model", model,
|
||||
"entry-text-column", 0,
|
||||
NULL);
|
||||
g_object_unref (model);
|
||||
|
||||
child = gtk_bin_get_child (GTK_BIN (widget));
|
||||
child = gtk_combo_box_get_child (GTK_COMBO_BOX (widget));
|
||||
gtk_editable_set_text (GTK_EDITABLE (child), "Combo Box Entry");
|
||||
gtk_widget_set_halign (widget, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (widget, GTK_ALIGN_CENTER);
|
||||
|
@ -80,7 +80,7 @@ gtk_combo_box_accessible_initialize (AtkObject *obj,
|
||||
accessible->priv->popup_set = TRUE;
|
||||
}
|
||||
if (gtk_combo_box_get_has_entry (combo_box))
|
||||
atk_object_set_parent (gtk_widget_get_accessible (gtk_bin_get_child (GTK_BIN (combo_box))), obj);
|
||||
atk_object_set_parent (gtk_widget_get_accessible (gtk_combo_box_get_child (GTK_COMBO_BOX (combo_box))), obj);
|
||||
|
||||
obj->role = ATK_ROLE_COMBO_BOX;
|
||||
}
|
||||
@ -181,7 +181,7 @@ gtk_combo_box_accessible_ref_child (AtkObject *obj,
|
||||
}
|
||||
else if (i == 1 && gtk_combo_box_get_has_entry (GTK_COMBO_BOX (widget)))
|
||||
{
|
||||
child = gtk_widget_get_accessible (gtk_bin_get_child (GTK_BIN (widget)));
|
||||
child = gtk_widget_get_accessible (gtk_combo_box_get_child (GTK_COMBO_BOX (widget)));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -373,7 +373,7 @@ gtk_cell_renderer_combo_editing_done (GtkCellEditable *combo,
|
||||
|
||||
if (gtk_combo_box_get_has_entry (GTK_COMBO_BOX (combo)))
|
||||
{
|
||||
entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo)));
|
||||
entry = GTK_ENTRY (gtk_combo_box_get_child (GTK_COMBO_BOX (combo)));
|
||||
new_text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry)));
|
||||
}
|
||||
else
|
||||
@ -469,7 +469,7 @@ gtk_cell_renderer_combo_start_editing (GtkCellRenderer *cell,
|
||||
|
||||
g_object_get (cell, "text", &text, NULL);
|
||||
if (text)
|
||||
gtk_editable_set_text (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (combo))), text);
|
||||
gtk_editable_set_text (GTK_EDITABLE (gtk_combo_box_get_child (GTK_COMBO_BOX (combo))), text);
|
||||
g_free (text);
|
||||
}
|
||||
else
|
||||
|
@ -593,7 +593,7 @@ gtk_combo_box_text_get_active_text (GtkComboBoxText *combo_box)
|
||||
{
|
||||
GtkWidget *entry;
|
||||
|
||||
entry = gtk_bin_get_child (GTK_BIN (combo_box));
|
||||
entry = gtk_combo_box_get_child (GTK_COMBO_BOX (combo_box));
|
||||
text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry)));
|
||||
}
|
||||
else if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo_box), &iter))
|
||||
|
@ -393,7 +393,7 @@ combo_box_get (GtkWidget *combo, gboolean *custom)
|
||||
{
|
||||
if (gtk_combo_box_get_has_entry (GTK_COMBO_BOX (combo)))
|
||||
{
|
||||
value = g_strdup (gtk_editable_get_text (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (combo)))));
|
||||
value = g_strdup (gtk_editable_get_text (GTK_EDITABLE (gtk_combo_box_get_child (GTK_COMBO_BOX (combo)))));
|
||||
*custom = TRUE;
|
||||
}
|
||||
|
||||
@ -672,7 +672,7 @@ combo_changed_cb (GtkWidget *combo,
|
||||
{
|
||||
GtkEntry *entry;
|
||||
|
||||
entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo)));
|
||||
entry = GTK_ENTRY (gtk_combo_box_get_child (GTK_COMBO_BOX (combo)));
|
||||
|
||||
gtk_editable_set_text (GTK_EDITABLE (entry), filtered_val);
|
||||
}
|
||||
@ -808,7 +808,7 @@ construct_widgets (GtkPrinterOptionWidget *widget)
|
||||
{
|
||||
GtkEntry *entry;
|
||||
|
||||
entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->combo)));
|
||||
entry = GTK_ENTRY (gtk_combo_box_get_child (GTK_COMBO_BOX (priv->combo)));
|
||||
|
||||
gtk_entry_set_visibility (entry, FALSE);
|
||||
}
|
||||
@ -981,7 +981,7 @@ update_widgets (GtkPrinterOptionWidget *widget)
|
||||
{
|
||||
GtkEntry *entry;
|
||||
|
||||
entry = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (priv->combo)));
|
||||
entry = GTK_ENTRY (gtk_combo_box_get_child (GTK_COMBO_BOX (priv->combo)));
|
||||
if (gtk_printer_option_has_choice (source, source->value))
|
||||
combo_box_set (priv->combo, source->value);
|
||||
else
|
||||
|
@ -1112,7 +1112,7 @@ main (int argc, char **argv)
|
||||
displayed_row_changed (GTK_COMBO_BOX (combobox), GTK_CELL_VIEW (tmp));
|
||||
g_signal_connect (combobox, "changed", G_CALLBACK (displayed_row_changed), tmp);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (combobox), tmp);
|
||||
gtk_combo_box_set_child (GTK_COMBO_BOX (combobox), tmp);
|
||||
|
||||
/* GtkComboBox tree */
|
||||
tmp = gtk_frame_new ("GtkComboBox (tree)");
|
||||
|
Loading…
Reference in New Issue
Block a user