diff options
Diffstat (limited to 'gtk/gtk_compat.c')
-rw-r--r-- | gtk/gtk_compat.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gtk/gtk_compat.c b/gtk/gtk_compat.c index 0beb7486f..f6ca5c3c4 100644 --- a/gtk/gtk_compat.c +++ b/gtk/gtk_compat.c @@ -22,6 +22,18 @@ #include "gtk/gtk_compat.h" +void nsgtk_widget_set_can_focus(GtkWidget *widget, gboolean can_focus) +{ + #if GTK_CHECK_VERSION(2,22,0) + gtk_widget_set_can_focus(widget, can_focus); + #else + if (can_focus == TRUE) + GTK_WIDGET_SET_FLAGS(widget, GTK_CAN_FOCUS); + else + GTK_WIDGET_UNSET_FLAGS(widget, GTK_CAN_FOCUS); + #endif +} + gboolean nsgtk_widget_has_focus(GtkWidget *widget) { #if GTK_CHECK_VERSION(2,20,0) |