aboutsummaryrefslogtreecommitdiff
path: root/src/idocalendarmenuitem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/idocalendarmenuitem.c')
-rw-r--r--src/idocalendarmenuitem.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/idocalendarmenuitem.c b/src/idocalendarmenuitem.c
index 8208ba2..642eb66 100644
--- a/src/idocalendarmenuitem.c
+++ b/src/idocalendarmenuitem.c
@@ -76,6 +76,11 @@ ido_calendar_menu_item_class_init (IdoCalendarMenuItemClass *klass)
menu_item_class->hide_on_activate = TRUE;
g_type_class_add_private (gobject_class, sizeof (IdoCalendarMenuItemPrivate));
+
+ g_signal_new("month-changed", G_TYPE_FROM_CLASS(klass),
+ G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+ gtk_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
}
static void
@@ -234,6 +239,11 @@ calendar_realized_cb (GtkWidget *widget,
"key-press-event",
G_CALLBACK (ido_calendar_menu_item_key_press),
item);
+
+ g_signal_connect (priv->calendar,
+ "month-changed",
+ G_CALLBACK (calendar_month_changed_cb),
+ item);
ido_calendar_menu_item_send_focus_change (widget, TRUE);
}
@@ -250,6 +260,13 @@ calendar_move_focus_cb (GtkWidget *widget,
GTK_DIR_TAB_FORWARD);
}
+static void
+calendar_month_changed_cb (GtkWidget *widget,
+ gpointer user_data)
+{
+ g_signal_emit_by_name (item, "month-changed", NULL);
+}
+
/* Public API */
GtkWidget *
ido_calendar_menu_item_new (void)
@@ -268,23 +285,23 @@ ido_calendar_menu_item_get_calendar (IdoCalendarMenuItem *item)
gboolean
ido_calendar_menu_item_mark_day (IdoCalendarMenuItem *menuitem, guint day)
{
- return gtk_calendar_mark_day(menuitem->priv->calendar, day);
+ return gtk_calendar_mark_day(menuitem->priv->calendar, day);
}
gboolean
ido_calendar_menu_item_unmark_day (IdoCalendarMenuItem *menuitem, guint day)
{
- return gtk_calendar_unmark_day(menuitem->priv->calendar, day);
+ return gtk_calendar_unmark_day(menuitem->priv->calendar, day);
}
void
ido_calendar_menu_item_clear_marks (IdoCalendarMenuItem *menuitem)
{
- gtk_calendar_clear_marks(menuitem->priv->calendar);
+ gtk_calendar_clear_marks(menuitem->priv->calendar);
}
void
ido_calendar_menu_item_set_display_options (IdoCalendarMenuItem *menuitem, GtkCalendarDisplayOptions flags)
{
- gtk_calendar_set_display_options (menuitem->priv->calendar, flags);
+ gtk_calendar_set_display_options (menuitem->priv->calendar, flags);
}