diff options
author | Federico Mena Quintero <federico@ximian.com> | 2001-01-26 08:08:54 +0800 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2001-01-26 08:08:54 +0800 |
commit | 9be603bebd3e4ecc52cd0e6b838ca6bd9b65d70c (patch) | |
tree | b510e137813b856c57e5f038dba23f773e942239 /widgets/table/e-table-scrolled.c | |
parent | 28f2aafc0a9e6909cb20f54af651165c49f6d67e (diff) | |
download | gsoc2013-evolution-9be603bebd3e4ecc52cd0e6b838ca6bd9b65d70c.tar gsoc2013-evolution-9be603bebd3e4ecc52cd0e6b838ca6bd9b65d70c.tar.gz gsoc2013-evolution-9be603bebd3e4ecc52cd0e6b838ca6bd9b65d70c.tar.bz2 gsoc2013-evolution-9be603bebd3e4ecc52cd0e6b838ca6bd9b65d70c.tar.lz gsoc2013-evolution-9be603bebd3e4ecc52cd0e6b838ca6bd9b65d70c.tar.xz gsoc2013-evolution-9be603bebd3e4ecc52cd0e6b838ca6bd9b65d70c.tar.zst gsoc2013-evolution-9be603bebd3e4ecc52cd0e6b838ca6bd9b65d70c.zip |
Set the GTK_CAN_FOCUS flag on the widget, since an ETable ought to be
2001-01-25 Federico Mena Quintero <federico@ximian.com>
* e-table.c (e_table_init): Set the GTK_CAN_FOCUS flag on the
widget, since an ETable ought to be focusable.
(e_table_class_init): Override ::grab_focus() and ::focus().
(et_grab_focus): Since people may do gtk_widget_grab_focus() on
the ETable, we have to proxy the request to the actual focusable
canvas.
(e_table_setup_header): Unset GTK_CAN_FOCUS for the header canvas.
(et_focus): Reject focus if our child canvas already had it.
* e-table-scrolled.c (e_table_scrolled_init): Set the
GTK_FOCUS_FLAG on the widget. This is just so that people can
easily do gtk_widget_grab_focus (my_e_table_scrolled) on their own
applications.
(e_table_scrolled_class_init): Override ::grab_focus() and
::focus().
(ets_grab_focus): Proxy the grab_focus to our child ETable.
(ets_focus): Proxy the request to the child ETable.
svn path=/trunk/; revision=7830
Diffstat (limited to 'widgets/table/e-table-scrolled.c')
-rw-r--r-- | widgets/table/e-table-scrolled.c | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/widgets/table/e-table-scrolled.c b/widgets/table/e-table-scrolled.c index c4006a4c58..221ebdf6cb 100644 --- a/widgets/table/e-table-scrolled.c +++ b/widgets/table/e-table-scrolled.c @@ -41,6 +41,8 @@ e_table_scrolled_init (GtkObject *object) ets = E_TABLE_SCROLLED (object); scroll_frame = E_SCROLL_FRAME (object); + GTK_WIDGET_SET_FLAGS (ets, GTK_CAN_FOCUS); + ets->table = gtk_type_new(e_table_get_type()); e_scroll_frame_set_policy (scroll_frame, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); @@ -162,14 +164,48 @@ ets_get_arg (GtkObject *o, GtkArg *arg, guint arg_id) break; } } - + +/* Grab_focus handler for the scrolled ETable */ +static void +ets_grab_focus (GtkWidget *widget) +{ + ETableScrolled *ets; + + ets = E_TABLE_SCROLLED (widget); + + gtk_widget_grab_focus (GTK_WIDGET (ets->table)); +} + +/* Focus handler for the scrolled ETable */ +static gint +ets_focus (GtkContainer *container, GtkDirectionType direction) +{ + ETableScrolled *ets; + + ets = E_TABLE_SCROLLED (container); + + return gtk_container_focus (GTK_CONTAINER (ets->table), direction); +} + static void -e_table_scrolled_class_init (GtkObjectClass *object_class) +e_table_scrolled_class_init (ETableScrolledClass *class) { + GtkObjectClass *object_class; + GtkWidgetClass *widget_class; + GtkContainerClass *container_class; + + object_class = (GtkObjectClass *) class; + widget_class = (GtkWidgetClass *) class; + container_class = (GtkContainerClass *) class; + parent_class = gtk_type_class (PARENT_TYPE); object_class->get_arg = ets_get_arg; - + + widget_class->grab_focus = ets_grab_focus; + + container_class->focus = ets_focus; + gtk_object_add_arg_type ("ETableScrolled::table", GTK_TYPE_OBJECT, GTK_ARG_READABLE, ARG_TABLE); } |