From d9bef0d869737cf79758f85ecd4b19a6b9b31388 Mon Sep 17 00:00:00 2001 From: Bertrand Lorentz Date: Mon, 5 Dec 2011 19:09:35 +0100 Subject: [PATCH] gtk: Fix creation of ComboBox and ComboBoxText subclasses with entry When creating a subclass of ComboBox with an entry, the has-entry property was not initialized, leading to a crash when trying to access the entry. For subclasses of ComboBoxText, two other properties were not initialized, leading to Gtk-CRITICAL error messages. --- gtk/ComboBox.custom | 2 +- gtk/ComboBoxText.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gtk/ComboBox.custom b/gtk/ComboBox.custom index cf5040453..cf5ccbce0 100644 --- a/gtk/ComboBox.custom +++ b/gtk/ComboBox.custom @@ -33,7 +33,7 @@ protected ComboBox (bool with_entry) : base (IntPtr.Zero) { if (GetType () != typeof (ComboBox)) { - CreateNativeObject (new string [0], new GLib.Value[0]); + CreateNativeObject (new string[] { "has-entry" }, new GLib.Value[] { new GLib.Value (with_entry) }); return; } diff --git a/gtk/ComboBoxText.cs b/gtk/ComboBoxText.cs index e4a6e68eb..1134931db 100644 --- a/gtk/ComboBoxText.cs +++ b/gtk/ComboBoxText.cs @@ -27,7 +27,8 @@ namespace Gtk { protected ComboBoxText (bool has_entry) : base (IntPtr.Zero) { if (GetType () != typeof (ComboBoxText)) { - CreateNativeObject (new string[] { "has-entry" }, new GLib.Value[] { new GLib.Value (has_entry) }); + CreateNativeObject (new string[] { "has-entry", "entry-text-column", "id-column" }, + new GLib.Value[] { new GLib.Value (has_entry), new GLib.Value (0), new GLib.Value (1) }); return; }