diff options
author | Ted Gould <ted@gould.cx> | 2011-08-22 15:11:33 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-08-22 15:11:33 -0500 |
commit | 85b3b5d2a138697f7252f0f00666bd06fa7f628b (patch) | |
tree | 6376d4af7261129fd823dbacbe0116d75dbb86c4 /libdbusmenu-gtk | |
parent | f545dc8264a5b1986673c583c59f87a97b866833 (diff) | |
download | libdbusmenu-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.c | 38 |
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; +} |