gcompat: provide backwards compatible functions for older gtk versions
[fio.git] / ghelpers.c
index 967040885a81d3b546c4bec623755c758ff8e10e..d9380a2a0c2a4323c144a5e4c5089c4f0347254f 100644 (file)
@@ -2,6 +2,7 @@
 #include <string.h>
 #include <gtk/gtk.h>
 
 #include <string.h>
 #include <gtk/gtk.h>
 
+#include "gcompat.h"
 #include "ghelpers.h"
 
 GtkWidget *new_combo_entry_in_frame(GtkWidget *box, const char *label)
 #include "ghelpers.h"
 
 GtkWidget *new_combo_entry_in_frame(GtkWidget *box, const char *label)
@@ -9,7 +10,7 @@ GtkWidget *new_combo_entry_in_frame(GtkWidget *box, const char *label)
        GtkWidget *entry, *frame;
 
        frame = gtk_frame_new(label);
        GtkWidget *entry, *frame;
 
        frame = gtk_frame_new(label);
-       entry = gtk_combo_box_new_text();
+       entry = gtk_combo_box_text_new();
        gtk_box_pack_start(GTK_BOX(box), frame, TRUE, TRUE, 3);
        gtk_container_add(GTK_CONTAINER(frame), entry);
 
        gtk_box_pack_start(GTK_BOX(box), frame, TRUE, TRUE, 3);
        gtk_container_add(GTK_CONTAINER(frame), entry);
 
@@ -22,7 +23,7 @@ GtkWidget *new_info_entry_in_frame(GtkWidget *box, const char *label)
 
        frame = gtk_frame_new(label);
        entry = gtk_entry_new();
 
        frame = gtk_frame_new(label);
        entry = gtk_entry_new();
-       gtk_entry_set_editable(GTK_ENTRY(entry), 0);
+       gtk_editable_set_editable(GTK_EDITABLE(entry), 0);
        gtk_box_pack_start(GTK_BOX(box), frame, TRUE, TRUE, 3);
        gtk_container_add(GTK_CONTAINER(frame), entry);
 
        gtk_box_pack_start(GTK_BOX(box), frame, TRUE, TRUE, 3);
        gtk_container_add(GTK_CONTAINER(frame), entry);
 
@@ -97,7 +98,7 @@ GtkTreeViewColumn *tree_view_column(GtkWidget *tree_view, int index, const char
        gtk_tree_view_column_pack_start(col, renderer, TRUE);
        gtk_tree_view_column_set_expand(col, TRUE);
        gtk_tree_view_column_add_attribute(col, renderer, "text", index);
        gtk_tree_view_column_pack_start(col, renderer, TRUE);
        gtk_tree_view_column_set_expand(col, TRUE);
        gtk_tree_view_column_add_attribute(col, renderer, "text", index);
-       gtk_object_set(GTK_OBJECT(renderer), "alignment", align, NULL);
+       g_object_set(G_OBJECT(renderer), "alignment", align, NULL);
        switch (align) {
        case PANGO_ALIGN_LEFT:
                xalign = 0.0;
        switch (align) {
        case PANGO_ALIGN_LEFT:
                xalign = 0.0;