diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-08-04 05:52:41 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-08-04 05:52:41 +0800 |
commit | bc4d011ab1d50e218b717e0daf53ae1b00d14332 (patch) | |
tree | 6d904e8d8ba244d6ad40720a31c325ed25273088 | |
parent | 4baef8309f7b216401269448ff5389296dd335c0 (diff) | |
download | gsoc2013-evolution-bc4d011ab1d50e218b717e0daf53ae1b00d14332.tar.gz gsoc2013-evolution-bc4d011ab1d50e218b717e0daf53ae1b00d14332.tar.zst gsoc2013-evolution-bc4d011ab1d50e218b717e0daf53ae1b00d14332.zip |
Do an evil kludgy hack so that the Rule Name entry widget gets focused
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.
svn path=/trunk/; revision=11626
-rw-r--r-- | filter/ChangeLog | 6 | ||||
-rw-r--r-- | filter/filter-rule.c | 11 |
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); |