[Gtk-sharp-list] ComboBox & gtk_entry_set_text: assertion `text != NULL' failed

Adam Tauno Williams awilliam at whitemice.org
Mon Feb 6 12:18:36 EST 2006

I've created a window in Glade, and use it in a C# app.  There are
several combo boxes,  one works fine and the others report a
"gtk_entry_set_text: assertion `text != NULL' failed" whenever you try
to select an item (the selection list displays just fine, but nothing is
selected).  The code to initialize the combo boxes (first one works,
second one doesn't) is:

cyclelist = new Gtk.ListStore(typeof(string), typeof(string));
cycletype.Model = cyclelist;
cyclelist.AppendValues("None", "once");
cyclelist.AppendValues("Annually", "yearly");
cyclelist.AppendValues("Monthly", "monthly");
cyclelist.AppendValues("Weekly", "weekly");
cyclelist.AppendValues("Week Day", "weekday");
cyclelist.AppendValues("Every Second Week", "2_weekly");
cyclelist.AppendValues("Every Fourth Week", "4_weekly");
text1 = new CellRendererText();
cycletype.PackStart(text1, false);
cycletype.AddAttribute(text1, "text", 0);
typelist = new Gtk.ListStore(typeof(string), typeof(string));
eventtype.Model = typelist;
typelist.AppendValues("Birthday", "birthday");
typelist.AppendValues("Phone Call", "phone call");
typelist.AppendValues("Due Date", "duedate");
typelist.AppendValues("Vacation", "vacation");
typelist.AppendValues("At Home", "at home");
typelist.AppendValues("Ill", "ill");
typelist.AppendValues("Meeting", "meeting");
typelist.AppendValues("Off-Site", "outward");
typelist.AppendValues("Trade Show", "tradeshow");
text2 = new CellRendererText();
eventtype.PackStart(text2, false);
eventtype.AddAttribute(text2, "text", 0);

I'm stumped, because this code really looks similar to me.  Why does the
first one work as expected and the second one not?

mono 1.1.13-0
monodevelop 0.9-0

More information about the Gtk-sharp-list mailing list