diff options
author | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2010-11-05 13:05:20 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2010-11-05 22:19:50 +0900 |
commit | 1ad5fa3e7a8f41e95057bd8e9ff8c32a5c8b8459 (patch) | |
tree | 134a28f8c9b4c68057fbff94518a05ce69d0d47e /gtk/gtkcellrenderer.c | |
parent | ce815afecedf3bf383bff13d550d752cef865df8 (diff) | |
download | gtk+-1ad5fa3e7a8f41e95057bd8e9ff8c32a5c8b8459.tar.gz |
Committing half-way done focus work.
Diffstat (limited to 'gtk/gtkcellrenderer.c')
-rw-r--r-- | gtk/gtkcellrenderer.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gtk/gtkcellrenderer.c b/gtk/gtkcellrenderer.c index 3656599483..da6c77ce92 100644 --- a/gtk/gtkcellrenderer.c +++ b/gtk/gtkcellrenderer.c @@ -1058,6 +1058,32 @@ gtk_cell_renderer_get_sensitive (GtkCellRenderer *cell) return cell->priv->sensitive; } + +/** + * gtk_cell_renderer_can_focus: + * @cell: A #GtkCellRenderer + * + * Checks whether the cell renderer can receive focus. + * + * Returns: %TRUE if the cell renderer can do anything with keyboard focus + * + * Since: 3.0 + */ +gboolean +gtk_cell_renderer_can_focus (GtkCellRenderer *cell) +{ + GtkCellRendererPrivate *priv; + + g_return_val_if_fail (GTK_IS_CELL_RENDERER (cell), FALSE); + + priv = cell->priv; + + return (cell->priv->visible && + (cell->priv->mode == GTK_CELL_RENDERER_MODE_EDITABLE || + cell->priv->mode == GTK_CELL_RENDERER_MODE_ACTIVATABLE)); +} + + /** * gtk_cell_renderer_stop_editing: * @cell: A #GtkCellRenderer |