priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (celltext);
- GTK_CELL_RENDERER (celltext)->xalign = 0.0;
- GTK_CELL_RENDERER (celltext)->yalign = 0.5;
- GTK_CELL_RENDERER (celltext)->xpad = 2;
- GTK_CELL_RENDERER (celltext)->ypad = 2;
+ g_object_set(celltext, "xalign", 0.0, NULL);
+ g_object_set(celltext, "yalign", 0.5, NULL);
+ g_object_set(celltext, "xpad", 2, NULL);
+ g_object_set(celltext, "ypad", 2, NULL);
celltext->font_scale = 1.0;
celltext->fixed_height_rows = -1;
celltext->font = pango_font_description_new ();
celltext->editable = g_value_get_boolean (value);
celltext->editable_set = TRUE;
if (celltext->editable)
- GTK_CELL_RENDERER (celltext)->mode = GTK_CELL_RENDERER_MODE_EDITABLE;
+ g_object_set(celltext, "mode", GTK_CELL_RENDERER_MODE_EDITABLE, NULL);
else
- GTK_CELL_RENDERER (celltext)->mode = GTK_CELL_RENDERER_MODE_INERT;
+ g_object_set(celltext, "mode", GTK_CELL_RENDERER_MODE_INERT, NULL);
g_object_notify (object, "editable-set");
break;
priv = GHB_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
+ gint cell_width, cell_height, cell_xpad, cell_ypad;
+ gfloat cell_xalign, cell_yalign;
+ g_object_get(cell,
+ "width", &cell_width,
+ "height", &cell_height,
+ "xpad", &cell_xpad,
+ "ypad", &cell_ypad,
+ "xalign", &cell_xalign,
+ "yalign", &cell_yalign, NULL);
+
if (celltext->calc_fixed_height)
{
PangoContext *context;
pango_font_description_free (font_desc);
gtk_cell_renderer_set_fixed_size (cell,
- cell->width, 2*cell->ypad +
+ cell_width, 2*cell_ypad +
celltext->fixed_height_rows * PANGO_PIXELS (row_height));
if (height)
{
- *height = cell->height;
+ *height = cell_height;
height = NULL;
}
celltext->calc_fixed_height = FALSE;
pango_extents_to_pixels (&rect, NULL);
if (height)
- *height = cell->ypad * 2 + rect.height;
+ *height = cell_ypad * 2 + rect.height;
/* The minimum size for ellipsized labels is ~ 3 chars */
if (width)
char_width = pango_font_metrics_get_approximate_char_width (metrics);
pango_font_metrics_unref (metrics);
- *width = cell->xpad * 2 + (PANGO_PIXELS (char_width) * MAX (priv->width_chars, 3));
+ *width = cell_xpad * 2 + (PANGO_PIXELS (char_width) * MAX (priv->width_chars, 3));
}
else
{
- *width = cell->xpad * 2 + rect.x + rect.width;
+ *width = cell_xpad * 2 + rect.x + rect.width;
}
}
if (x_offset)
{
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- *x_offset = (1.0 - cell->xalign) * (cell_area->width - (rect.x + rect.width + (2 * cell->xpad)));
+ *x_offset = (1.0 - cell_xalign) * (cell_area->width - (rect.x + rect.width + (2 * cell_xpad)));
else
- *x_offset = cell->xalign * (cell_area->width - (rect.x + rect.width + (2 * cell->xpad)));
+ *x_offset = cell_xalign * (cell_area->width - (rect.x + rect.width + (2 * cell_xpad)));
if ((priv->ellipsize_set && priv->ellipsize != PANGO_ELLIPSIZE_NONE) || priv->wrap_width != -1)
*x_offset = MAX(*x_offset, 0);
}
if (y_offset)
{
- *y_offset = cell->yalign * (cell_area->height - (rect.height + (2 * cell->ypad)));
+ *y_offset = cell_yalign * (cell_area->height - (rect.height + (2 * cell->ypad)));
*y_offset = MAX (*y_offset, 0);
}
}
layout = get_layout (celltext, widget, TRUE, flags);
get_size (cell, widget, cell_area, layout, &x_offset, &y_offset, NULL, NULL);
- if (!cell->sensitive)
+ gboolean sensitive;
+ gint xpad, ypad;
+ g_object_get(cell,
+ "sensitive", &sensitive,
+ "xpad", &xpad,
+ "ypad", &ypad,
+ NULL);
+ if (!sensitive)
{
state = GTK_STATE_INSENSITIVE;
}
if (priv->ellipsize_set && priv->ellipsize != PANGO_ELLIPSIZE_NONE)
pango_layout_set_width (layout,
- (cell_area->width - x_offset - 2 * cell->xpad) * PANGO_SCALE);
+ (cell_area->width - x_offset - 2 * xpad) * PANGO_SCALE);
else if (priv->wrap_width == -1)
pango_layout_set_width (layout, -1);
expose_area,
widget,
"cellrenderertext",
- cell_area->x + x_offset + cell->xpad,
- cell_area->y + y_offset + cell->ypad,
+ cell_area->x + x_offset + xpad,
+ cell_area->y + y_offset + ypad,
layout);
g_object_unref (layout);
priv->entry_menu_popdown_timeout = 0;
}
+ gboolean editing_canceled;
+ g_object_get(entry, "editing-canceled", &editing_canceled, NULL);
gtk_cell_renderer_stop_editing (GTK_CELL_RENDERER (data),
- GTK_ENTRY (entry)->editing_canceled);
- if (GTK_ENTRY (entry)->editing_canceled)
+ editing_canceled);
+ if (editing_canceled)
return;
path = g_object_get_data (G_OBJECT (entry), GHB_CELL_RENDERER_TEXT_PATH);
if (priv->in_entry_menu)
return FALSE;
- GTK_ENTRY (entry)->editing_canceled = TRUE;
+ g_object_set(entry, "editing-canceled", TRUE, NULL);
gtk_cell_editable_remove_widget (GTK_CELL_EDITABLE (entry));
gtk_cell_editable_editing_done (GTK_CELL_EDITABLE (entry));
if (celltext->editable == FALSE)
return NULL;
+ gint xalign;
+ g_object_get(cell, "xalign", &xalign, NULL);
priv->entry = g_object_new (GTK_TYPE_ENTRY,
"has-frame", FALSE,
- "xalign", cell->xalign,
+ "xalign", xalign,
NULL);
if (celltext->text)
if (number_of_rows == -1)
{
+ gint width;
+ g_object_get(renderer, "width", &width, NULL);
gtk_cell_renderer_set_fixed_size (GTK_CELL_RENDERER (renderer),
- GTK_CELL_RENDERER (renderer)->width,
+ width,
-1);
}
else