aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk/genericmenuitem.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2009-12-15 17:09:16 -0600
committerTed Gould <ted@gould.cx>2009-12-15 17:09:16 -0600
commitf54a417fde8f6937ecafd269db51a135af2e7a3e (patch)
tree1e7fbad28033e6473709a28a2f610773fa3ef4de /libdbusmenu-gtk/genericmenuitem.c
parent5e7b2cec7f0ffd4147d81470ca162fd14ed92836 (diff)
downloadlibdbusmenu-f54a417fde8f6937ecafd269db51a135af2e7a3e.tar.gz
libdbusmenu-f54a417fde8f6937ecafd269db51a135af2e7a3e.tar.bz2
libdbusmenu-f54a417fde8f6937ecafd269db51a135af2e7a3e.zip
Functions for setting the check type and state of the check.
Diffstat (limited to 'libdbusmenu-gtk/genericmenuitem.c')
-rw-r--r--libdbusmenu-gtk/genericmenuitem.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/libdbusmenu-gtk/genericmenuitem.c b/libdbusmenu-gtk/genericmenuitem.c
index b40a3f5..6eee2f7 100644
--- a/libdbusmenu-gtk/genericmenuitem.c
+++ b/libdbusmenu-gtk/genericmenuitem.c
@@ -94,3 +94,48 @@ draw_indicator (GtkCheckMenuItem *check_menu_item, GdkRectangle *area)
}
return;
}
+
+/**
+ genericmenuitem_set_check_type:
+ @item: #Genericmenuitem to set the type on
+ @check_type: Which type of check should be displayed
+
+ This function changes the type of the checkmark that
+ appears in the left hand gutter for the menuitem.
+*/
+void
+genericmenuitem_set_check_type (Genericmenuitem * item, GenericmenuitemCheckType check_type)
+{
+ if (item->priv->check_type == check_type) {
+ return;
+ }
+
+ item->priv->check_type = check_type;
+
+ gtk_widget_queue_draw(GTK_WIDGET(item));
+
+ return;
+}
+
+/**
+ genericmenuitem_set_state:
+ @item: #Genericmenuitem to set the type on
+ @check_type: What is the state of the check
+
+ Sets the state of the check in the menu item. It does
+ not require, but isn't really useful if the type of
+ check that the menuitem is set to #GENERICMENUITEM_CHECK_TYPE_NONE.
+*/
+void
+genericmenuitem_set_state (Genericmenuitem * item, GenericmenuitemState state)
+{
+ if (item->priv->state == state) {
+ return;
+ }
+
+ item->priv->state = state;
+
+ gtk_widget_queue_draw(GTK_WIDGET(item));
+
+ return;
+}