Hi,
To change a file.glade to a file.ui, I think "glade 3" (http://ftp.gnome.org/pub/GNOME/binaries ... lade3/3.6/ ) is a good way because they are both known...
So basically open a glade file and save it as ui file with gtkbuilder as option. It works fine but not in case of combobox:
La propriété « Éléments » de la classe d'objet « Boîte combinée » n'est prise en charge que dans le format libglade (or the property elements in combobox is accepted only in libglade format)
How to save combobox with elements? I saw sometime renderer in other example but I have never seen where text is!! It is possible to have some help here?!
Thanks
EDIT : http://www.youtube.com/watch?v=Z5_F-rW2cL8
about libglade migration and combobox
Re: about libglade migration and combobox
Hello matthieuG,
For the combo box, in your file .ui, you can make a GtkListStore who contains your elements, like this:
Create your combo box and change the property "model" for using your GtkListStore, like this:
If you want change your elements dynamically, you can use these methods in your file .cpp:
I hope this helps.
Baptiste
For the combo box, in your file .ui, you can make a GtkListStore who contains your elements, like this:
Code: Select all
<object class="GtkListStore" id="model2">
<columns>
<!-- column-name gchararray -->
<column type="gchararray"/>
</columns>
<data>
<row>
<col id="0" translatable="yes">128</col>
</row>
<row>
<col id="0" translatable="yes">256</col>
</row>
<row>
<col id="0" translatable="yes">512</col>
</row>
<row>
<col id="0" translatable="yes">1024</col>
</row>
<row>
<col id="0" translatable="yes">2048</col>
</row>
<row>
<col id="0" translatable="yes">4096</col>
</row>
</data>
</object>
Code: Select all
<object class="GtkComboBox" id="combobox_sampling_frequency">
<property name="visible">True</property>
<property name="model">model2</property>
<child>
<object class="GtkCellRendererText" id="renderer2"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
Code: Select all
::GtkComboBox* l_pComboBox=GTK_COMBO_BOX(gtk_builder_get_object(m_pBuilderConfigureInterface, "combobox_sampling_frequency"));
::GtkListStore* l_pListStoreComboBox= GTK_LIST_STORE(gtk_combo_box_get_model(l_pComboBox));
GtkTreeIter iter;
gtk_list_store_append(l_pListStoreComboBox,&iter);
gtk_list_store_set (l_pListStoreComboBox, &iter,0,"new element",-1);
Baptiste
Re: about libglade migration and combobox
Thanks for this answer. However it doesn't work :
[model2] La propriété « Colonnes » de la classe d'objet « Stockage de liste » a été introduite dans gtk+ 2.12
[model2] La propriété « Données » de la classe d'objet « Stockage de liste » a été introduite dans gtk+ 2.12
(or property "column" of listStore is used after gtk+ 2.12. Idem for "data")
I have exactly the same error message with the direct glade interface as in the video.
Any clues?!
EDIT: I put version preferences to 2.12 to correct this point; 2.16 seems to be too much :rool:
[model2] La propriété « Colonnes » de la classe d'objet « Stockage de liste » a été introduite dans gtk+ 2.12
[model2] La propriété « Données » de la classe d'objet « Stockage de liste » a été introduite dans gtk+ 2.12
(or property "column" of listStore is used after gtk+ 2.12. Idem for "data")
I have exactly the same error message with the direct glade interface as in the video.
Any clues?!
EDIT: I put version preferences to 2.12 to correct this point; 2.16 seems to be too much :rool:
Re: about libglade migration and combobox
Dear Matthieu,
what problem are you facing with 2.16 ?
Yann
what problem are you facing with 2.16 ?
Yann