Commit e52e3c24 authored by Hib Eris's avatar Hib Eris Committed by Carlos Garcia Campos

glib-demo: Do not use deprecated GtkComboBox API

Bug #45439.
parent 165ab4ec
......@@ -666,9 +666,15 @@ pgd_annots_add_annot (GtkWidget *button,
vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
#if GTK_CHECK_VERSION (2, 24, 0)
type_selector = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (type_selector), "POPPLER_ANNOT_UNKNOWN");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (type_selector), "POPPLER_ANNOT_TEXT");
#else
type_selector = gtk_combo_box_new_text ();
gtk_combo_box_append_text (GTK_COMBO_BOX (type_selector), "POPPLER_ANNOT_UNKNOWN");
gtk_combo_box_append_text (GTK_COMBO_BOX (type_selector), "POPPLER_ANNOT_TEXT");
#endif
gtk_combo_box_set_active (GTK_COMBO_BOX (type_selector), 1);
gtk_box_pack_start (GTK_BOX (vbox), type_selector, TRUE, TRUE, 0);
gtk_widget_show (type_selector);
......
......@@ -121,11 +121,18 @@ pgd_print_create_custom_widget (GtkPrintOperation *op,
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
#if GTK_CHECK_VERSION (2, 24, 0)
combo = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "Document");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "Document and markup");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "Document and stamps");
#else
combo = gtk_combo_box_new_text ();
demo->options_combo = combo;
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "Document");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "Document and markup");
gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "Document and stamps");
#endif
demo->options_combo = combo;
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), options);
gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, FALSE, 0);
gtk_widget_show (combo);
......
......@@ -372,11 +372,19 @@ pgd_render_properties_selector_create (PgdRenderDemo *demo)
gtk_box_pack_start (GTK_BOX (rotate_hbox), label, TRUE, TRUE, 0);
gtk_widget_show (label);
#if GTK_CHECK_VERSION (2, 24, 0)
rotate_selector = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (rotate_selector), "0");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (rotate_selector), "90");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (rotate_selector), "180");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (rotate_selector), "270");
#else
rotate_selector = gtk_combo_box_new_text ();
gtk_combo_box_append_text (GTK_COMBO_BOX (rotate_selector), "0");
gtk_combo_box_append_text (GTK_COMBO_BOX (rotate_selector), "90");
gtk_combo_box_append_text (GTK_COMBO_BOX (rotate_selector), "180");
gtk_combo_box_append_text (GTK_COMBO_BOX (rotate_selector), "270");
#endif
gtk_combo_box_set_active (GTK_COMBO_BOX (rotate_selector), 0);
g_signal_connect (G_OBJECT (rotate_selector), "changed",
G_CALLBACK (pgd_render_rotate_selector_changed),
......@@ -393,11 +401,19 @@ pgd_render_properties_selector_create (PgdRenderDemo *demo)
gtk_box_pack_start (GTK_BOX (mode_hbox), label, TRUE, TRUE, 0);
gtk_widget_show (label);
#if GTK_CHECK_VERSION (2, 24, 0)
mode_selector = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (mode_selector), "cairo");
#ifdef POPPLER_WITH_GDK
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (mode_selector), "pixbuf");
#endif
#else // ! GTK_CHECK_VERSION (2, 24, 0)
mode_selector = gtk_combo_box_new_text ();
gtk_combo_box_append_text (GTK_COMBO_BOX (mode_selector), "cairo");
#ifdef POPPLER_WITH_GDK
gtk_combo_box_append_text (GTK_COMBO_BOX (mode_selector), "pixbuf");
#endif
#endif // GTK_CHECK_VERSION (2, 24, 0)
gtk_combo_box_set_active (GTK_COMBO_BOX (mode_selector), 0);
g_signal_connect (G_OBJECT (mode_selector), "changed",
G_CALLBACK (pgd_render_mode_selector_changed),
......
......@@ -538,11 +538,19 @@ pgd_selections_properties_selector_create (PgdSelectionsDemo *demo)
gtk_box_pack_start (GTK_BOX (rotate_hbox), label, TRUE, TRUE, 0);
gtk_widget_show (label);
#if GTK_CHECK_VERSION (2, 24, 0)
rotate_selector = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (rotate_selector), "0");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (rotate_selector), "90");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (rotate_selector), "180");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (rotate_selector), "270");
#else
rotate_selector = gtk_combo_box_new_text ();
gtk_combo_box_append_text (GTK_COMBO_BOX (rotate_selector), "0");
gtk_combo_box_append_text (GTK_COMBO_BOX (rotate_selector), "90");
gtk_combo_box_append_text (GTK_COMBO_BOX (rotate_selector), "180");
gtk_combo_box_append_text (GTK_COMBO_BOX (rotate_selector), "270");
#endif
gtk_combo_box_set_active (GTK_COMBO_BOX (rotate_selector), 0);
#if 0
g_signal_connect (G_OBJECT (rotate_selector), "changed",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment