diff options
author | Kristian Rietveld <kris@gtk.org> | 2003-12-18 00:06:43 +0000 |
---|---|---|
committer | Kristian Rietveld <kristian@src.gnome.org> | 2003-12-18 00:06:43 +0000 |
commit | c43efa516fb4dfbed2fe210959d930523965a26a (patch) | |
tree | b4d3743ba8c0954f26fb3f6daeac384ce29ad396 /gtk/gtkcellrenderertext.c | |
parent | 62a15f2ae1dd4cec4511775429cd97c99ead303b (diff) | |
download | gdk-pixbuf-c43efa516fb4dfbed2fe210959d930523965a26a.tar.gz |
Migrating all cell renderers to use the new instance private data
Thu Dec 18 00:57:18 2003 Kristian Rietveld <kris@gtk.org>
Migrating all cell renderers to use the new instance private data
construction.
* gtk/gtktreeprivate.h: remove GtkCellRendererInfo, as it is no
longer being used.
* gtk/gtkcellrenderer.c (gtk_cell_renderer_init),
(gtk_cell_renderer_class_init), (gtk_cell_renderer_get_property),
(set_cell_bg_color), (gtk_cell_renderer_render): remove old
GtkCellRendererInfo handling, migrate to instance private data.
* gtk/gtkcellrenderertext.c (gtk_cell_renderer_text_editing_done),
(gtk_cell_renderer_text_start_editing): moved focus_out_id
from GtkCellRendererInfo to text renderer private data.
* gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_init),
(gtk_cell_renderer_pixbuf_class_init),
(gtk_cell_renderer_pixbuf_finalize),
(gtk_cell_renderer_pixbuf_get_property),
(gtk_cell_renderer_pixbuf_set_property),
(gtk_cell_renderer_pixbuf_create_stock_pixbuf),
(gtk_cell_renderer_pixbuf_get_size), (gtk_cell_renderer_pixbuf_render):
migrate to instance private data.
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_class_init),
(gtk_cell_renderer_toggle_get_property),
(gtk_cell_renderer_toggle_set_property),
(gtk_cell_renderer_toggle_render): migrate to instance private data.
Diffstat (limited to 'gtk/gtkcellrenderertext.c')
-rw-r--r-- | gtk/gtkcellrenderertext.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/gtk/gtkcellrenderertext.c b/gtk/gtkcellrenderertext.c index ac87f35f6..9451eb082 100644 --- a/gtk/gtkcellrenderertext.c +++ b/gtk/gtkcellrenderertext.c @@ -120,6 +120,7 @@ typedef struct _GtkCellRendererTextPrivate GtkCellRendererTextPrivate; struct _GtkCellRendererTextPrivate { guint single_paragraph : 1; + gulong focus_out_id; }; @@ -1369,15 +1370,14 @@ gtk_cell_renderer_text_editing_done (GtkCellEditable *entry, { const gchar *path; const gchar *new_text; - GtkCellRendererInfo *info; + GtkCellRendererTextPrivate *priv; - info = g_object_get_data (G_OBJECT (data), - GTK_CELL_RENDERER_INFO_KEY); + priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (data); - if (info->focus_out_id > 0) + if (priv->focus_out_id > 0) { - g_signal_handler_disconnect (entry, info->focus_out_id); - info->focus_out_id = 0; + g_signal_handler_disconnect (entry, priv->focus_out_id); + priv->focus_out_id = 0; } if (GTK_ENTRY (entry)->editing_canceled) @@ -1409,11 +1409,12 @@ gtk_cell_renderer_text_start_editing (GtkCellRenderer *cell, GdkRectangle *cell_area, GtkCellRendererState flags) { - GtkCellRendererText *celltext; GtkWidget *entry; - GtkCellRendererInfo *info; - + GtkCellRendererText *celltext; + GtkCellRendererTextPrivate *priv; + celltext = GTK_CELL_RENDERER_TEXT (cell); + priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (cell); /* If the cell isn't editable we return NULL. */ if (celltext->editable == FALSE) @@ -1429,15 +1430,12 @@ gtk_cell_renderer_text_start_editing (GtkCellRenderer *cell, gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1); - info = g_object_get_data (G_OBJECT (cell), - GTK_CELL_RENDERER_INFO_KEY); - gtk_widget_show (entry); g_signal_connect (entry, "editing_done", G_CALLBACK (gtk_cell_renderer_text_editing_done), celltext); - info->focus_out_id = g_signal_connect (entry, "focus_out_event", + priv->focus_out_id = g_signal_connect (entry, "focus_out_event", G_CALLBACK (gtk_cell_renderer_text_focus_out_event), celltext); |