aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-window.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-09-18 10:32:04 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-09-18 10:32:04 +0800
commit8d21ab98d99ca43ee7873adba8172b699d8a007f (patch)
treed6a85918167907daf7c4dcf87b8b7feee89f12af /shell/e-shell-window.c
parentbb7cb1d677117a938ae18d9cae7acc7a56678b6f (diff)
downloadgsoc2013-evolution-8d21ab98d99ca43ee7873adba8172b699d8a007f.tar
gsoc2013-evolution-8d21ab98d99ca43ee7873adba8172b699d8a007f.tar.gz
gsoc2013-evolution-8d21ab98d99ca43ee7873adba8172b699d8a007f.tar.bz2
gsoc2013-evolution-8d21ab98d99ca43ee7873adba8172b699d8a007f.tar.lz
gsoc2013-evolution-8d21ab98d99ca43ee7873adba8172b699d8a007f.tar.xz
gsoc2013-evolution-8d21ab98d99ca43ee7873adba8172b699d8a007f.tar.zst
gsoc2013-evolution-8d21ab98d99ca43ee7873adba8172b699d8a007f.zip
Progress update:
- Get context menus working in the contact preview pane. - Kill EABPopup. - Yet more code refactoring. - Add a handy utility function: e_shell_window_show_popup_menu() Takes a widget path in the shell window's UI definition. svn path=/branches/kill-bonobo/; revision=36366
Diffstat (limited to 'shell/e-shell-window.c')
-rw-r--r--shell/e-shell-window.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c
index 96895908d8..7cb7defa33 100644
--- a/shell/e-shell-window.c
+++ b/shell/e-shell-window.c
@@ -648,6 +648,38 @@ e_shell_window_set_safe_mode (EShellWindow *shell_window,
}
/**
+ * e_shell_window_show_popup_menu:
+ * @shell_window: an #EShellWindow
+ * @widget_path: path in the UI definition
+ * @event: a #GdkEventButton
+ *
+ * Displays a context-sensitive (or "popup") menu that is described in
+ * the UI definition loaded into @shell_window<!-- -->'s user interface
+ * manager. The menu will be shown at the current mouse cursor position.
+ **/
+void
+e_shell_window_show_popup_menu (EShellWindow *shell_window,
+ const gchar *widget_path,
+ GdkEventButton *event)
+{
+ GtkWidget *menu;
+
+ g_return_if_fail (E_IS_SHELL_WINDOW (shell_window));
+
+ menu = e_shell_window_get_managed_widget (shell_window, widget_path);
+ g_return_if_fail (GTK_IS_MENU (menu));
+
+ if (event != NULL)
+ gtk_menu_popup (
+ GTK_MENU (menu), NULL, NULL, NULL, NULL,
+ event->button, event->time);
+ else
+ gtk_menu_popup (
+ GTK_MENU (menu), NULL, NULL, NULL, NULL,
+ 0, gtk_get_current_event_time ());
+}
+
+/**
* e_shell_window_register_new_item_actions:
* @shell_window: an #EShellWindow
* @module_name: name of an #EShellModule