static void connection_essids_combo_init (GtkComboBoxEntry *combo) { GtkTreeModel *model; GtkCellRenderer *renderer; model = GTK_TREE_MODEL (gtk_list_store_new (3, GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_INT)); gtk_combo_box_set_model (GTK_COMBO_BOX (combo), model); g_object_unref (model); /* add "crypted" renderer */ renderer = gtk_cell_renderer_pixbuf_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, FALSE); gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combo), renderer, "pixbuf", 0); gtk_cell_layout_reorder (GTK_CELL_LAYOUT (combo), renderer, 0); /* add "quality" renderer */ renderer = gtk_cell_renderer_progress_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), renderer, FALSE); gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (combo), renderer, "value", 2); /* reuse text cell renderer for the essid */ gtk_combo_box_entry_set_text_column (combo, 1); g_signal_connect (gtk_bin_get_child (GTK_BIN (combo)), "changed", G_CALLBACK (on_dialog_changed), tool); }
static VALUE rg_reorder(VALUE self, VALUE cell, VALUE position) { gtk_cell_layout_reorder(_SELF(self), RVAL2RENDERER(cell), NUM2INT(position)); return self; }
static void cg_combo_flags_cell_layout_reorder (GtkCellLayout *layout, GtkCellRenderer *cell, gint position) { CgComboFlags *combo; CgComboFlagsPrivate *priv; CgComboFlagsCellInfo *info; GSList *link; combo = CG_COMBO_FLAGS (layout); priv = CG_COMBO_FLAGS_PRIVATE (combo); info = cg_combo_flags_get_cell_info (combo, cell); g_return_if_fail (info != NULL); link = g_slist_find (priv->cells, info); g_return_if_fail (link != NULL); priv->cells = g_slist_remove_link (priv->cells, link); priv->cells = g_slist_insert (priv->cells, info, position); if (priv->column != NULL) gtk_cell_layout_reorder (GTK_CELL_LAYOUT (priv->column), cell, position); gtk_widget_queue_draw (GTK_WIDGET (combo)); }
static void gtk_cell_layout_default_reorder (GtkCellLayout *cell_layout, GtkCellRenderer *cell, gint position) { GtkCellLayoutIface *iface; GtkCellArea *area; iface = GTK_CELL_LAYOUT_GET_IFACE (cell_layout); if (iface->get_area) { area = iface->get_area (cell_layout); if (area) gtk_cell_layout_reorder (GTK_CELL_LAYOUT (area), cell, position); else warn_no_cell_area ("GtkCellLayoutIface->reorder()"); } }