[gtk+] Add doc to set markup and accelerator on a MenuItem.
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Add doc to set markup and accelerator on a MenuItem.
- Date: Mon, 20 May 2013 01:23:15 +0000 (UTC)
commit 0e08ff19ba148fcba5dc68040bac8209d6a10202
Author: Luc Pionchon <pionchon luc gmail com>
Date: Fri May 10 13:30:08 2013 +0300
Add doc to set markup and accelerator on a MenuItem.
https://bugzilla.gnome.org/show_bug.cgi?id=699289
gtk/gtkmenuitem.c | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index 13d0969..b33d79d 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -52,15 +52,28 @@
* @See_also: #GtkBin, #GtkMenuShell
*
* The #GtkMenuItem widget and the derived widgets are the only valid
- * childs for menus. Their function is to correctly handle highlighting,
+ * children for menus. Their function is to correctly handle highlighting,
* alignment, events and submenus.
*
- * As it derives from #GtkBin it can hold any valid child widget, altough
- * only a few are really useful.
+ * As a GtkMenuItem derives from #GtkBin it can hold any valid child widget,
+ * although only a few are really useful.
+ *
+ * By default, a GtkMenuItem sets a #GtkAccelLabel as its child.
+ * GtkMenuItem has direct functions to set the label and its mnemonic.
+ * For more advanced label settings, you can fetch the child widget from the GtkBin.
+ *
+ * <example>
+ * <title>Setting markup and accelerator on a MenuItem</title>
+ * <programlisting><![CDATA[
+ * GtkWidget *child = gtk_bin_get_child (GTK_BIN (menu_item));
+ * gtk_label_set_markup (GTK_LABEL (child), "<i>new label</i> with <b>markup</b>");
+ * gtk_accel_label_set_accel (GTK_ACCEL_LABEL (child), GDK_KEY_1, 0);
+ * ]]></programlisting>
+ * </example>
*
* <refsect2 id="GtkMenuItem-BUILDER-UI">
* <title>GtkMenuItem as GtkBuildable</title>
- * The GtkMenuItem implementation of the GtkBuildable interface
+ * The GtkMenuItem implementation of the #GtkBuildable interface
* supports adding a submenu by specifying "submenu" as the "type"
* attribute of a <child> element.
* <example>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]