[gtkhtml] Bug 632601 - Handle combo box text API going away
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkhtml] Bug 632601 - Handle combo box text API going away
- Date: Wed, 20 Oct 2010 14:25:54 +0000 (UTC)
commit 3bf9eb43743cc1526802e0ce52b295e31e5a3c82
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Oct 20 09:51:48 2010 -0400
Bug 632601 - Handle combo box text API going away
gtkhtml/gtk-compat.h | 5 +++++
gtkhtml/test.c | 7 +++++--
gtkhtml/testgtkhtml.c | 7 +++++--
3 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/gtkhtml/gtk-compat.h b/gtkhtml/gtk-compat.h
index 264d273..76ed345 100644
--- a/gtkhtml/gtk-compat.h
+++ b/gtkhtml/gtk-compat.h
@@ -5,6 +5,11 @@
/* Provide a GTK+ compatibility layer. */
+#if !GTK_CHECK_VERSION (2,91,0)
+#define gtk_combo_box_text_new gtk_combo_box_new_text
+#define gtk_combo_box_text_append_text gtk_combo_box_append_text
+#endif
+
#if GTK_CHECK_VERSION (2,90,5)
/* Recreate GdkRegion until we drop GTK2 compatibility. */
diff --git a/gtkhtml/test.c b/gtkhtml/test.c
index e449b32..66b36b5 100644
--- a/gtkhtml/test.c
+++ b/gtkhtml/test.c
@@ -38,6 +38,9 @@
#include "htmlengine.h"
+/* backward-compatibility cruft */
+#include "gtk-compat.h"
+
typedef struct _Example Example;
struct _Example {
@@ -338,10 +341,10 @@ main (gint argc, gchar **argv)
gtk_box_pack_start (GTK_BOX (vbox), swindow, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
- combo_box = gtk_combo_box_new_text ();
+ combo_box = gtk_combo_box_text_new ();
for (i = 0; i < examples->len; i++) {
Example *example = examples->pdata[i];
- gtk_combo_box_append_text (GTK_COMBO_BOX (combo_box), example->title);
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX (combo_box), example->title);
}
gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0);
g_signal_connect (combo_box, "changed", G_CALLBACK (example_changed_cb), NULL);
diff --git a/gtkhtml/testgtkhtml.c b/gtkhtml/testgtkhtml.c
index 282b9d2..b791e78 100644
--- a/gtkhtml/testgtkhtml.c
+++ b/gtkhtml/testgtkhtml.c
@@ -49,6 +49,9 @@
#include "gtkhtmldebug.h"
+/* backward-compatibility cruft */
+#include "gtk-compat.h"
+
#ifndef O_BINARY
#define O_BINARY 0
#endif
@@ -445,10 +448,10 @@ create_toolbars ()
0, 0);
find_examples ();
- test_combo_box = gtk_combo_box_new_text ();
+ test_combo_box = gtk_combo_box_text_new ();
for (i = 0; i < examples->len; i++) {
Example *example = examples->pdata[i];
- gtk_combo_box_append_text (GTK_COMBO_BOX (test_combo_box), example->title);
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX (test_combo_box), example->title);
}
gtk_combo_box_set_active (GTK_COMBO_BOX (test_combo_box), 0);
g_signal_connect (test_combo_box, "changed", G_CALLBACK (example_changed_cb), NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]