[PATCH] Added back support for versions of GTK pre 2.24

Lubomir I. Ivanov neolit123 at gmail.com
Wed Feb 27 14:54:32 PST 2013


From: "Lubomir I. Ivanov" <neolit123 at gmail.com>

Some functions in combo_box_with_model_and_entry() are only
available to GTK 2.24 and newer. This patch adds only one #if branch,
but probably adds support to a number of outdated distributions,
such as Debian 6.0.4 and Ubuntu 10.04.

Signed-off-by: Lubomir I. Ivanov <neolit123 at gmail.com>
---

With the recent changes in planner.c and if this is applied, it may be
actually possible to compile on some older distros.

Just compiled and tested Subsurface on Debian 6.0.4 with GLib 2.24.2-1
and GTK+ 2.20.1-2.

---
 gtk-gui.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gtk-gui.c b/gtk-gui.c
index a680474..32df263 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -439,8 +439,13 @@ GtkWidget *combo_box_with_model_and_entry(GtkListStore *model)
 	GtkWidget *widget;
 	GtkEntryCompletion *completion;
 
+#if GTK_CHECK_VERSION(2,24,0)
 	widget = gtk_combo_box_new_with_model_and_entry(GTK_TREE_MODEL(model));
 	gtk_combo_box_set_entry_text_column(GTK_COMBO_BOX(widget), 0);
+#else
+	widget = gtk_combo_box_entry_new_with_model(GTK_TREE_MODEL(model), 0);
+	gtk_combo_box_entry_set_text_column(GTK_COMBO_BOX_ENTRY(widget), 0);
+#endif
 
 	completion = gtk_entry_completion_new();
 	gtk_entry_completion_set_text_column(completion, 0);
-- 
1.7.11.msysgit.0



More information about the subsurface mailing list