[dia] [gtk-deprecated] use GtkComboBoxText instead of convenience functions
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] [gtk-deprecated] use GtkComboBoxText instead of convenience functions
- Date: Sun, 27 Mar 2011 12:10:14 +0000 (UTC)
commit c338ddc3817f67d0597b0b3bebedc83cb54694d9
Author: Hans Breuer <hans breuer org>
Date: Sun Mar 27 12:17:17 2011 +0200
[gtk-deprecated] use GtkComboBoxText instead of convenience functions
There is a new type with gtk-2-24 which has the same behavior as the
base type, but needs new dedicated API.
app/filedlg.c | 24 ++++++++++++++++++++++++
app/preferences.c | 8 ++++++++
lib/prop_inttypes.c | 8 ++++++++
3 files changed, 40 insertions(+), 0 deletions(-)
---
diff --git a/app/filedlg.c b/app/filedlg.c
index b3ae712..4c1a448 100644
--- a/app/filedlg.c
+++ b/app/filedlg.c
@@ -187,8 +187,16 @@ create_open_menu(void)
GList *tmp;
+#if GTK_CHECK_VERSION(2,24,0)
+ menu = gtk_combo_box_text_new ();
+#else
menu = gtk_combo_box_new_text ();
+#endif
+#if GTK_CHECK_VERSION(2,24,0)
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(menu), _("By extension"));
+#else
gtk_combo_box_append_text(GTK_COMBO_BOX(menu), _("By extension"));
+#endif
for (tmp = filter_get_import_filters(); tmp != NULL; tmp = tmp->next) {
DiaImportFilter *ifilter = tmp->data;
@@ -197,7 +205,11 @@ create_open_menu(void)
if (!ifilter)
continue;
filter_label = filter_get_import_filter_label(ifilter);
+#if GTK_CHECK_VERSION(2,24,0)
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(menu), filter_label);
+#else
gtk_combo_box_append_text (GTK_COMBO_BOX(menu), filter_label);
+#endif
g_free(filter_label);
}
g_signal_connect(GTK_OBJECT(menu), "changed",
@@ -634,8 +646,16 @@ create_export_menu(void)
GtkWidget *menu;
GList *tmp;
+#if GTK_CHECK_VERSION(2,24,0)
+ menu = gtk_combo_box_text_new ();
+#else
menu = gtk_combo_box_new_text ();
+#endif
+#if GTK_CHECK_VERSION(2,24,0)
+ gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(menu), _("By extension"));
+#else
gtk_combo_box_append_text(GTK_COMBO_BOX(menu), _("By extension"));
+#endif
for (tmp = filter_get_export_filters(); tmp != NULL; tmp = tmp->next) {
DiaExportFilter *ef = tmp->data;
@@ -644,7 +664,11 @@ create_export_menu(void)
if (!ef)
continue;
filter_label = filter_get_export_filter_label(ef);
+#if GTK_CHECK_VERSION(2,24,0)
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT(menu), filter_label);
+#else
gtk_combo_box_append_text (GTK_COMBO_BOX(menu), filter_label);
+#endif
g_free(filter_label);
}
g_signal_connect(GTK_OBJECT(menu), "changed",
diff --git a/app/preferences.c b/app/preferences.c
index a56d6b5..f6af704 100644
--- a/app/preferences.c
+++ b/app/preferences.c
@@ -530,11 +530,19 @@ prefs_get_property_widget(DiaPrefData *data)
break;
case PREF_CHOICE: {
GList *names;
+#if GTK_CHECK_VERSION(2,24,0)
+ widget = gtk_combo_box_text_new ();
+#else
widget = gtk_combo_box_new_text ();
+#endif
for (names = (data->choice_list_function)(data);
names != NULL;
names = g_list_next(names)) {
+#if GTK_CHECK_VERSION(2,24,0)
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX (widget), (gchar *)names->data);
+#else
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), (gchar *)names->data);
+#endif
}
break;
}
diff --git a/lib/prop_inttypes.c b/lib/prop_inttypes.c
index f861495..1f8c7a6 100644
--- a/lib/prop_inttypes.c
+++ b/lib/prop_inttypes.c
@@ -491,9 +491,17 @@ enumprop_get_widget(EnumProperty *prop, PropDialog *dialog)
PropEnumData *enumdata = prop->common.descr->extra_data;
guint i;
+#if GTK_CHECK_VERSION(2,24,0)
+ ret = gtk_combo_box_text_new ();
+#else
ret = gtk_combo_box_new_text ();
+#endif
for (i = 0; enumdata[i].name != NULL; i++)
+#if GTK_CHECK_VERSION(2,24,0)
+ gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (ret), _(enumdata[i].name));
+#else
gtk_combo_box_append_text (GTK_COMBO_BOX (ret), _(enumdata[i].name));
+#endif
prophandler_connect(&prop->common, G_OBJECT (ret), "changed");
} else {
ret = gtk_entry_new(); /* should use spin button/option menu */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]