aboutsummaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
Diffstat (limited to 'filter')
-rw-r--r--filter/ChangeLog6
-rw-r--r--filter/filter-rule.c11
2 files changed, 14 insertions, 3 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index 2182fbeebe..58d7486ba1 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,3 +1,9 @@
+2001-08-03 Jeffrey Stedfast <fejj@ximian.com>
+
+ * filter-rule.c (get_widget): Do an evil kludgy hack so that the
+ Rule Name entry widget gets focused when the filter editor is
+ shown.
+
2001-08-02 Jeffrey Stedfast <fejj@ximian.com>
* filter-rule.c: Wrap some debug printf's with d().
diff --git a/filter/filter-rule.c b/filter/filter-rule.c
index cbab69ff16..038db489c5 100644
--- a/filter/filter-rule.c
+++ b/filter/filter-rule.c
@@ -602,6 +602,12 @@ filter_rule_get_widget (FilterRule *fr, struct _RuleContext *f)
return ((FilterRuleClass *) ((GtkObject *) fr)->klass)->get_widget(fr, f);
}
+static void
+grab_focus (GtkWidget *entry, gpointer data)
+{
+ gtk_widget_grab_focus (entry);
+}
+
static GtkWidget *
get_widget (FilterRule *fr, struct _RuleContext *f)
{
@@ -636,9 +642,8 @@ get_widget (FilterRule *fr, struct _RuleContext *f)
e_utf8_gtk_entry_set_text (GTK_ENTRY (name), fr->name);
}
- gtk_widget_grab_focus (GTK_WIDGET (name));
- /* Why does GTK say we can't grab the default?? */
- /*gtk_widget_grab_default (GTK_WIDGET (name));*/
+ /* evil kludgy hack because gtk sucks */
+ gtk_signal_connect (GTK_OBJECT (name), "realize", grab_focus, name);
hbox = gtk_hbox_new (FALSE, 3);
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);