diff options
author | Federico Mena Quintero <federico@ximian.com> | 2001-10-26 12:47:53 +0800 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2001-10-26 12:47:53 +0800 |
commit | 6784b6928ac929846fa1ac36131a1193bc9294fd (patch) | |
tree | 6eb476f7d388e84bcfee816f3cee8701671477e5 /widgets/table/e-tree.c | |
parent | ccdcf468c80b1dd870100c44c084cbd674a86c91 (diff) | |
download | gsoc2013-evolution-6784b6928ac929846fa1ac36131a1193bc9294fd.tar.gz gsoc2013-evolution-6784b6928ac929846fa1ac36131a1193bc9294fd.tar.zst gsoc2013-evolution-6784b6928ac929846fa1ac36131a1193bc9294fd.zip |
Fixes Ximian bug #6832.
2001-10-25 Federico Mena Quintero <federico@ximian.com>
Fixes Ximian bug #6832.
* e-table.c (e_table_setup_table): Use a callback instead of
gtk_widget_queue_draw() for focus events, as the latter does not
have the correct prototype for an event handler.
(group_start_drag): Emit START_DRAG, not KEY_PRESS!
(focus_first_etable_item): Focus the first row in the first
ETableItem if there is no focused item.
* e-tree.c (e_tree_setup_table): Same change as in
e_table_setup_table().
(table_canvas_focus_event_cb): Focus the first row in the tree
item if there is no focused item.
svn path=/trunk/; revision=14124
Diffstat (limited to 'widgets/table/e-tree.c')
-rw-r--r-- | widgets/table/e-tree.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index 9bb71f6c92..6bbf20f16c 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -698,6 +698,31 @@ et_canvas_button_press (GtkWidget *canvas, GdkEventButton *event, ETree *e_tree) return FALSE; } +/* Handler for focus events in the table_canvas; we have to repaint ourselves + * and give the focus to some ETableItem. + */ +static gint +table_canvas_focus_event_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data) +{ + GnomeCanvas *canvas; + ETree *tree; + + gtk_widget_queue_draw (widget); + + if (!event->in) + return TRUE; + + canvas = GNOME_CANVAS (widget); + tree = E_TREE (data); + + if (!canvas->focused_item) { + e_table_item_set_cursor (E_TABLE_ITEM (tree->priv->item), 0, 0); + gnome_canvas_item_grab_focus (tree->priv->item); + } + + return TRUE; +} + static void e_tree_setup_table (ETree *e_tree) { @@ -707,10 +732,10 @@ e_tree_setup_table (ETree *e_tree) GTK_SIGNAL_FUNC (tree_canvas_size_allocate), e_tree); gtk_signal_connect ( GTK_OBJECT (e_tree->priv->table_canvas), "focus_in_event", - GTK_SIGNAL_FUNC (gtk_widget_queue_draw), e_tree); + GTK_SIGNAL_FUNC (table_canvas_focus_event_cb), e_tree); gtk_signal_connect ( GTK_OBJECT (e_tree->priv->table_canvas), "focus_out_event", - GTK_SIGNAL_FUNC (gtk_widget_queue_draw), e_tree); + GTK_SIGNAL_FUNC (table_canvas_focus_event_cb), e_tree); gtk_signal_connect ( GTK_OBJECT (e_tree->priv->table_canvas), "drag_begin", |