r1752 - trunk/src/target/OM-2007/applications/openmoko-rssreader/src

zecke at sita.openmoko.org zecke at sita.openmoko.org
Sat Apr 14 01:41:24 CEST 2007


Author: zecke
Date: 2007-04-14 01:41:23 +0200 (Sat, 14 Apr 2007)
New Revision: 1752

Modified:
   trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c
Log:
openmoko-rssreader: Forward key events from the treeview to the Search bar
    Typing charachters will automatically enable the searchbar.


Modified: trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c	2007-04-13 23:39:27 UTC (rev 1751)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/callbacks.c	2007-04-13 23:41:23 UTC (rev 1752)
@@ -30,6 +30,8 @@
 #include "callbacks.h"
 #include "rfcdate.h"
 
+#include <libmokoui/moko-tool-box.h>
+
 #include <mrss.h>
 #include <string.h>
 
@@ -247,9 +249,22 @@
     }
 
     filter_feeds (data);
+    gtk_widget_grab_focus (GTK_WIDGET(data->treeView));
 }
 
-gboolean cb_treeview_keypress_event( GtkWidget *entry, GdkEventKey *key, struct RSSReaderData *data ) {
+/*
+ * route this to the search box
+ */
+gboolean cb_treeview_keypress_event( GtkWidget *tree_view, GdkEventKey *key, struct RSSReaderData *data ) {
+    moko_tool_box_make_search_visible (data->box, TRUE);
+    gtk_entry_set_text (GTK_ENTRY(moko_tool_box_get_entry(data->box)), "");
+
+    /*
+     * forward the key event
+     */
+    GtkEntry *entry = GTK_ENTRY(moko_tool_box_get_entry(data->box));
+    GTK_WIDGET_CLASS(GTK_ENTRY_GET_CLASS(entry))->key_press_event (GTK_WIDGET(entry), key);
+
     return TRUE;
 }
 





More information about the commitlog mailing list