blob: 5944df0ddc2fb7a86ee2f54d5779844bdd1a1bcf [file] [log] [blame]
Jens Axboef762cef2012-03-26 13:51:11 +02001#include <gtk/gtk.h>
2
3#include "gcompat.h"
4
5#if GTK_MAJOR_VERSION <= 2 && GTK_MINOR_VERSION < 24
6
7GtkWidget *gtk_combo_box_text_new(void)
8{
9 return gtk_combo_box_new();
10}
11
12void gtk_combo_box_text_append_text(GtkComboBoxText *combo_box,
13 const gchar *text)
14{
15 gtk_combo_box_append_text(GTK_COMBO_BOX(combo_box), text);
16}
17
18void gtk_combo_box_text_insert_text(GtkComboBoxText *combo_box, gint position,
19 const gchar *text)
20{
21 gtk_combo_box_insert_text(GTK_COMBO_BOX(combo_box), position, text);
22}
23
24void gtk_combo_box_text_prepend_text(GtkComboBoxText *combo_box,
25 const gchar *text)
26{
27 gtk_combo_box_prepend_text(GTK_COMBO_BOX(combo_box), text);
28}
29
30gchar *gtk_combo_box_text_get_active_text(GtkComboBoxText *combo_box)
31{
32 return gtk_combo_box_get_active_text(GTK_COMBO_BOX(combo_box));
33}
34
35#endif
Jens Axboecd0d2db2012-03-26 19:30:24 +020036
37#if GTK_MAJOR_VERSION < 3
38
39guint gtk_widget_get_allocated_width(GtkWidget *w)
40{
41 return w->allocation.width;
42}
43
44guint gtk_widget_get_allocated_height(GtkWidget *w)
45{
46 return w->allocation.height;
47}
48
49#endif
Jens Axboecf8d54c2012-03-26 20:31:32 +020050
51#if GTK_MAJOR_VERSION <= 2 && GTK_MINOR_VERSION < 18
52void gtk_widget_set_can_focus(GtkWidget *widget, gboolean can_focus)
53{
54 if (can_focus)
55 GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_FOCUS);
56 else
57 GTK_WIDGET_UNSET_FLAGS(widget, GTK_CAN_FOCUS);
58}
59#endif