Constructing GtkComboBoxEntry with GtkBuilder

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello everyone.
I noticed that constructing GtkComboBoxEntry from GtkBuilder's UI filefails miserably. At construction time, my sample application reportstwo errors:
(combo.exe:3388): Gtk-CRITICAL **: gtk_tree_model_get_n_columns:assertion `GTK_IS_TREE_MODEL (tree_model)' failed
(combo.exe:3388): Gtk-CRITICAL **:gtk_combo_box_entry_set_text_column: assertion `text_column <gtk_tree_model_get_n_columns (gtk_combo_box_get_model (GTK_COMBO_BOX(entry_box)))' failed
And when I try to select something, pop-up is blank (the size isright, but there is no text) and selection a row produces followingerror:
(combo.exe:3388): Gtk-CRITICAL **: gtk_entry_set_text: assertion 'text!= NULL' failed

I tested this on Windows XP and linux with gtk-2.16.1 installed, UIfile has been produced by glade3-3.6.4. Should I report a bug aboutthis or am I missing something here? If this is a bug, under whichcomponent do I report it - gtk, GtkBuilder, Glade?
Thanks in advance.
---------- combo.c ----------#include <gtk/gtk.h>
#define GET_WIDGET( builder, name ) \	GTK_WIDGET( gtk_builder_get_object( builder, name ) )
intmain( int    argc,	  char **argv ){	GtkBuilder *builder;	GtkWidget  *window;	GError     *error = NULL;
	gtk_init( &argc, &argv );
	builder = gtk_builder_new();	if( ! gtk_builder_add_from_file( builder, "combo.builder", &error ) )	{		g_print( "Error: %s\n", error->message );		g_error_free( error );		return( 1 );	}
	window = GET_WIDGET( builder, "window1" );
	gtk_builder_connect_signals( builder, NULL );	g_object_unref( G_OBJECT( builder ) );
	gtk_widget_show_all( window );
	gtk_main();
	return( 0 );}---------- combo.c ----------
---------- combo.builder ----------<?xml version="1.0"?><interface>  <requires lib="gtk+" version="2.16"/>  <!-- interface-naming-policy project-wide -->  <object class="GtkListStore" id="liststore1">    <columns>      <!-- column-name string -->      <column type="gchararray"/>    </columns>    <data>      <row>        <col id="0" translatable="yes">Line 1</col>      </row>      <row>        <col id="0" translatable="yes">Line 2</col>      </row>    </data>  </object>  <object class="GtkWindow" id="window1">    <property name="border_width">6</property>    <signal name="destroy" handler="gtk_main_quit"/>    <child>      <object class="GtkComboBoxEntry" id="comboboxentry1">        <property name="visible">True</property>        <property name="model">liststore1</property>        <property name="text_column">0</property>      </object>    </child>  </object></interface>---------- combo.builder ----------

-- Tadej Borovšaktadeboro.blogspot.comtadeboro@xxxxxxxxxxxxxxxxxxxxxxx@gmail.com_______________________________________________gtk-list mailing listgtk-list@xxxxxxxxxxxxx://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux