Populating A Combo Box With Integers In Hex
- From: Tristian Celestin <tristian celestin outlook com>
- To: "gtk-app-devel-list gnome org" <gtk-app-devel-list gnome org>
- Subject: Populating A Combo Box With Integers In Hex
- Date: Sat, 7 Dec 2013 17:54:23 +0000
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.
Based on the GTK 3.10 documentation, the following will populate the combo box for columns of G_TYPE_STRING:
gtk_combo_box_set_model(GTK_COMBO_BOX(self->priv->comboboxtext1),
GTK_TREE_MODEL(device_store));
gtk_combo_box_set_id_column(GTK_COMBO_BOX(self->priv->comboboxtext1), 1);
Is my only solution to add another column to the list store containing strings of hex-converted integers?
Ideally, I'd be able to tell the combo box how to format a string it displays for each unsigned integer in
the model.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]