Merge authors: Ted Gould (ted) Related merge proposals: https://code.launchpad.net/~ted/dbusmenu/client-get-submenu/+merge/26116 proposed by: Ted Gould (ted) ------------------------------------------------------------ revno: 103 [merge] committer: Ted Gould <t...@gould.cx> branch nick: trunk timestamp: Thu 2010-05-27 11:22:34 -0500 message: Adding a simple function to get the submenu on the menuitem. modified: libdbusmenu-gtk/client.c libdbusmenu-gtk/client.h
-- lp:dbusmenu https://code.launchpad.net/~dbusmenu-team/dbusmenu/trunk Your team ayatana-commits is subscribed to branch lp:dbusmenu. To unsubscribe from this branch go to https://code.launchpad.net/~dbusmenu-team/dbusmenu/trunk/+edit-subscription
=== modified file 'libdbusmenu-gtk/client.c' --- libdbusmenu-gtk/client.c 2010-04-15 05:54:44 +0000 +++ libdbusmenu-gtk/client.c 2010-05-26 22:18:29 +0000 @@ -423,6 +423,29 @@ return GTK_MENU_ITEM(data); } +/** + dbusmenu_gtkclient_menuitem_get_submenu: + @client: A #DbusmenuGtkClient with the item in it. + @item: #DbusmenuMenuitem to get associated #GtkMenu on. + + This grabs the submenu associated with the menuitem. + + Return value: The #GtkMenu if there is one. +*/ +GtkMenu * +dbusmenu_gtkclient_menuitem_get_submenu (DbusmenuGtkClient * client, DbusmenuMenuitem * item) +{ + g_return_val_if_fail(DBUSMENU_IS_GTKCLIENT(client), NULL); + g_return_val_if_fail(DBUSMENU_IS_MENUITEM(item), NULL); + + gpointer data = g_object_get_data(G_OBJECT(item), data_menu); + if (data == NULL) { + return NULL; + } + + return GTK_MENU(data); +} + /* The base type handler that builds a plain ol' GtkMenuItem to represent, well, the GtkMenuItem */ static gboolean === modified file 'libdbusmenu-gtk/client.h' --- libdbusmenu-gtk/client.h 2009-12-10 04:06:29 +0000 +++ libdbusmenu-gtk/client.h 2010-05-26 22:18:29 +0000 @@ -77,6 +77,7 @@ GType dbusmenu_gtkclient_get_type (void); DbusmenuGtkClient * dbusmenu_gtkclient_new (gchar * dbus_name, gchar * dbus_object); GtkMenuItem * dbusmenu_gtkclient_menuitem_get (DbusmenuGtkClient * client, DbusmenuMenuitem * item); +GtkMenu * dbusmenu_gtkclient_menuitem_get_submenu (DbusmenuGtkClient * client, DbusmenuMenuitem * item); void dbusmenu_gtkclient_newitem_base (DbusmenuGtkClient * client, DbusmenuMenuitem * item, GtkMenuItem * gmi, DbusmenuMenuitem * parent);
_______________________________________________ Mailing list: https://launchpad.net/~ayatana-commits Post to : ayatana-commits@lists.launchpad.net Unsubscribe : https://launchpad.net/~ayatana-commits More help : https://help.launchpad.net/ListHelp