[gtk/default-handling: 14/25] Add gtk_widget_activate_default
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/default-handling: 14/25] Add gtk_widget_activate_default
- Date: Sun, 28 Apr 2019 23:31:11 +0000 (UTC)
commit f4880f5df5a438c37caa7a7676d384c609d386ff
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Apr 28 22:31:55 2019 +0000
Add gtk_widget_activate_default
This is a convenience wrapper for
activating the "default.activate" action.
docs/reference/gtk/gtk4-sections.txt | 1 +
gtk/gtkwidget.c | 12 ++++++++++++
gtk/gtkwidget.h | 3 +++
3 files changed, 16 insertions(+)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 5350068fe5..312ac831f7 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -4546,6 +4546,7 @@ gtk_widget_insert_action_group
gtk_widget_list_action_prefixes
gtk_widget_get_action_group
gtk_widget_activate_action
+gtk_widget_activate_default
gtk_widget_measure
gtk_widget_snapshot_child
gtk_widget_get_next_sibling
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 4349be0276..0ffff50e36 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -12920,6 +12920,18 @@ gtk_widget_activate_action (GtkWidget *widget,
parameter);
}
+/**
+ * gtk_widget_activate_default:
+ * @widget: a #GtkWidget
+ *
+ * Activate the default.activate action from @widget.
+ */
+void
+gtk_widget_activate_default (GtkWidget *widget)
+{
+ gtk_widget_activate_action (widget, "default.activate", NULL);
+}
+
void
gtk_widget_cancel_event_sequence (GtkWidget *widget,
GtkGesture *gesture,
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 5fa35ef1ab..2734c4fd37 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -1016,6 +1016,9 @@ void gtk_widget_activate_action (GtkWidget *widget,
const char *name,
GVariant *parameter);
+GDK_AVAILABLE_IN_ALL
+void gtk_widget_activate_default (GtkWidget *widget);
+
GDK_AVAILABLE_IN_ALL
void gtk_widget_set_font_map (GtkWidget *widget,
PangoFontMap *font_map);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]