summaryrefslogtreecommitdiff
path: root/gtk/gtkmenushell.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2010-12-23 20:11:38 -0500
committerMatthias Clasen <mclasen@redhat.com>2010-12-23 20:11:38 -0500
commit7650482e468ee6f01cc5f7f3b161406fabc56bae (patch)
treee7a41e7744e5bf7e25e7a30e137b74a504650173 /gtk/gtkmenushell.c
parent2ed81aa57c54dc72936e9284cedffa4a5057fa9c (diff)
downloadgtk+-7650482e468ee6f01cc5f7f3b161406fabc56bae.tar.gz
Add sufficient API to make gail work
The accessible implementations should really be folded into gtk proper. Until that happens, we need some more guts exposed...
Diffstat (limited to 'gtk/gtkmenushell.c')
-rw-r--r--gtk/gtkmenushell.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index 20e12dc385..d72670aea3 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -1869,3 +1869,42 @@ gtk_menu_shell_set_take_focus (GtkMenuShell *menu_shell,
g_object_notify (G_OBJECT (menu_shell), "take-focus");
}
}
+
+/**
+ * gtk_menu_shell_get_selected_item:
+ * @menu_shell: a #GtkMenuShell
+ *
+ * Gets the currently selected item.
+ *
+ * Returns: the currently selected item
+ *
+ * Since: 3.0
+ */
+GtkWidget *
+gtk_menu_shell_get_selected_item (GtkMenuShell *menu_shell)
+{
+ g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell));
+
+ return menu_shell->priv->active_menu_item;
+}
+
+/**
+ * gtk_menu_shell_get_parent_shell:
+ * @menu_shell: a #GtkMenuShell
+ *
+ * Gets the parent menu shell.
+ *
+ * The parent menu shell of a submenu is the #GtkMenu or #GtkMenuBar
+ * from which it was opened up.
+ *
+ * Returns: the parent #GtkMenuShell
+ *
+ * Since: 3.0
+ */
+GtkWidget *
+gtk_menu_shell_get_parent_shell (GtkMenuShell *menu_shell)
+{
+ g_return_if_fail (GTK_IS_MENU_SHELL (menu_shell));
+
+ return menu_shell->priv->parent_menu_shell;
+}