[gtk/matthiasc/for-master: 2/2] shortcutcontroller: Document buildable support



commit 15eb3bbbf12d94d107483eb71acbf67352317c11
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Mar 30 20:09:29 2020 -0400

    shortcutcontroller: Document buildable support

 gtk/gtkshortcutcontroller.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
---
diff --git a/gtk/gtkshortcutcontroller.c b/gtk/gtkshortcutcontroller.c
index d18b6902f2..d7534001fe 100644
--- a/gtk/gtkshortcutcontroller.c
+++ b/gtk/gtkshortcutcontroller.c
@@ -36,6 +36,28 @@
  *
  * #GtkShortcutController implements #GListModel for querying the shortcuts that
  * have been added to it.
+ *
+ * # GtkShortcutController as a GtkBuildable
+ *
+ * GtkShortcutControllers can be creates in ui files to set up shortcuts
+ * in the same place as the widgets.
+ *
+ * An example of a UI definition fragment with GtkShortcutController:
+ * |[
+ *   <object class='GtkButton'>
+ *     <child>
+ *       <object class='GtkShortcutController'>
+ *         <property name='scope'>managed</property>
+ *         <child>
+ *           <object class='GtkShortcut'>
+ *             <property name='trigger'>&lt;Control&gt;k</property>
+ *             <property name='action'>activate</property>
+ *           </object>
+ *         </child>
+ *       </object>
+ *     </child>
+ *   </object>
+ * ]|
  **/
 
 #include "config.h"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]