aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gncal-full-day.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@nuclecu.unam.mx>1998-04-14 08:59:30 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-14 08:59:30 +0800
commit23ef00df35512cfe6285ba45c0b20f635faee111 (patch)
tree32c0b448b6fa62b1b6dd461e0718bc6b9f3efca7 /calendar/gncal-full-day.c
parentc9311c844f224c678eea75f178850985f7581a3e (diff)
downloadgsoc2013-evolution-23ef00df35512cfe6285ba45c0b20f635faee111.tar
gsoc2013-evolution-23ef00df35512cfe6285ba45c0b20f635faee111.tar.gz
gsoc2013-evolution-23ef00df35512cfe6285ba45c0b20f635faee111.tar.bz2
gsoc2013-evolution-23ef00df35512cfe6285ba45c0b20f635faee111.tar.lz
gsoc2013-evolution-23ef00df35512cfe6285ba45c0b20f635faee111.tar.xz
gsoc2013-evolution-23ef00df35512cfe6285ba45c0b20f635faee111.tar.zst
gsoc2013-evolution-23ef00df35512cfe6285ba45c0b20f635faee111.zip
New function to let the outside world decide which child to focus.
1998-04-13 Federico Mena Quintero <federico@nuclecu.unam.mx> * gncal-full-day.h: * gncal-full-day.c (gncal_full_day_focus_child): New function to let the outside world decide which child to focus. (gncal_full_day_focus_child): Bleah. We have to synthesize a click because GtkText will not set the cursor when you focus it. * gnome-cal.c (day_view_range_activated): Focus the new child in the full day widget. svn path=/trunk/; revision=131
Diffstat (limited to 'calendar/gncal-full-day.c')
-rw-r--r--calendar/gncal-full-day.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/calendar/gncal-full-day.c b/calendar/gncal-full-day.c
index dc61018ecd..f32c8c482c 100644
--- a/calendar/gncal-full-day.c
+++ b/calendar/gncal-full-day.c
@@ -1662,6 +1662,42 @@ gncal_full_day_selection_range (GncalFullDay *fullday, time_t *lower, time_t *up
return TRUE;
}
+void
+gncal_full_day_focus_child (GncalFullDay *fullday, iCalObject *object)
+{
+ GList *children;
+ Child *child;
+ GdkEvent event;
+
+ g_return_if_fail (fullday != NULL);
+ g_return_if_fail (object != NULL);
+
+ for (children = fullday->children; children; children = children->next) {
+ child = children->data;
+
+ if (child->ico == object) {
+ gtk_widget_grab_focus (child->widget);
+
+ /* We synthesize a click because GtkText will not set the cursor and
+ * the user will not be able to type-- this has to be fixed in
+ * GtkText. */
+
+ memset (&event, 0, sizeof (event));
+
+ event.type = GDK_BUTTON_PRESS;
+ event.button.window = child->widget->window;
+ event.button.time = GDK_CURRENT_TIME;
+ event.button.x = 0;
+ event.button.y = 0;
+ event.button.button = 1;
+
+ gtk_widget_event (child->widget, &event);
+
+ break;
+ }
+ }
+}
+
static void
range_activated (GncalFullDay *fullday)
{