aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-08-22 15:11:33 -0500
committerTed Gould <ted@gould.cx>2011-08-22 15:11:33 -0500
commit85b3b5d2a138697f7252f0f00666bd06fa7f628b (patch)
tree6376d4af7261129fd823dbacbe0116d75dbb86c4 /libdbusmenu-gtk
parentf545dc8264a5b1986673c583c59f87a97b866833 (diff)
downloadlibdbusmenu-85b3b5d2a138697f7252f0f00666bd06fa7f628b.tar.gz
libdbusmenu-85b3b5d2a138697f7252f0f00666bd06fa7f628b.tar.bz2
libdbusmenu-85b3b5d2a138697f7252f0f00666bd06fa7f628b.zip
Implement the setter and getter for disposition
Diffstat (limited to 'libdbusmenu-gtk')
-rw-r--r--libdbusmenu-gtk/genericmenuitem.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/libdbusmenu-gtk/genericmenuitem.c b/libdbusmenu-gtk/genericmenuitem.c
index f939332..43def6d 100644
--- a/libdbusmenu-gtk/genericmenuitem.c
+++ b/libdbusmenu-gtk/genericmenuitem.c
@@ -468,3 +468,41 @@ genericmenuitem_get_image (Genericmenuitem * menu_item)
return imagew;
}
+
+/**
+ * genericmenuitem_set_disposition:
+ * @item: A #Genericmenuitem
+ * @disposition: The disposition of the item
+ *
+ * Sets the disposition of the menuitem.
+ */
+void
+genericmenuitem_set_disposition (Genericmenuitem * item, GenericmenuitemDisposition disposition)
+{
+ g_return_if_fail(IS_GENERICMENUITEM(item));
+
+ if (item->priv->disposition == disposition)
+ return;
+
+ item->priv->disposition = disposition;
+
+ set_label(GTK_MENU_ITEM(item), get_label(GTK_MENU_ITEM(item)));
+
+ return;
+}
+
+/**
+ * genericmenuitem_get_disposition:
+ * @item: A #Genericmenuitem
+ *
+ * Gets the disposition of the menuitem.
+ *
+ * Return value: The disposition of the menuitem.
+ */
+GenericmenuitemDisposition
+genericmenuitem_get_disposition (Genericmenuitem * item)
+{
+ g_return_val_if_fail(IS_GENERICMENUITEM(item), GENERICMENUITEM_DISPOSITION_NORMAL);
+
+ return item->priv->disposition;
+}