On Sat, Dec 07, 2013 at 05:54:23PM +0000, Tristian Celestin wrote:
> I have a GtkListStore that contains 4 columns of unsigned integers
> (G_TYPE_UINT). I would like to display the second column of integers
> in a GtkComboBoxText widget, and I would like the integers to be
> displayed in Base 12. 

I would stop here and use normal GtkComboBox with a cell data function
(gtk_cell_layout_set_cell_data_func()) such as

static void
render_base12(GtkTreeViewColumn *column,
              GtkCellRenderer *renderer,
              GtkTreeModel *model,
              GtkTreeIter *iter,
              gpointer data)
{
    guint value;
    gtk_tree_model_get(model, iter, 1, &value, -1);
    /* format the value here in base 12 */
    g_object_set(renderer, "text", formatted_value, NULL);
}

It may be possible to do this with GtkComboBoxText too.  I don't know.
If I want something non-default I just use the real thing instead of
studying what is and what isn't allowed with GtkComboBoxText.

Regards,

Yeti

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to