Porting some exo code to GTK3 as part of SpaceFM - how to properly subclass GtkCellRendererText
OmegaPhil at startmail.com
Fri Jul 10 21:34:24 CEST 2015
SpaceFM has recently nicked the icon picker/viewer from exo (normally
used by Thunar at least), available in its GTK2 build. I've been asked
to port the code to GTK3 (no prior experience etc), however the GTK
maintainers have bricked the get_size call that
exo-cell-render-ellipsized-text relies on
(exo/exo-cell-renderer-ellipsized-text.c) - the specific call that got
my attention was:
&x0, &y0, &text_width,
in exo_cell_renderer_ellipsized_text_render (in exo git).
The parent class' get_size member is actually NULL - this is because no
function has been assigned to it in GTK3's
gtkcellrenderer.c:gtk_cell_renderer_class_init, even though there is a
get_size function available, and then in gtkcellrenderertext.c they
didn't implement a get_size either.
Looking at the general documentation I can see that
gtk_cell_renderer_get_size is deprecated (but not removed) in favour of
gtk_cell_renderer_get_preferred_size, yet looking at
gtk_cell_renderer_class_init again there is no direct call to
gtk_cell_renderer_get_preferred_size available - only bits and pieces
like gtk_cell_renderer_text_get_preferred_width and
gtk_cell_renderer_text_get_preferred_height_for_width e.g., which are
used amongst other functions in the internal implementation of
gtk_cell_renderer_get_preferred_size. So before I start copying GTK3
internal implementation I need a sanity check from someone who knows
about this kind of thing.
Do they even intend people to subclass/derive from their widgets at this
Doesn't look like exo is being ported atm in XFCE, but asking here in
case someone knows about the current code, before I ask a more generic
question on the GTK list.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: OpenPGP digital signature
More information about the Xfce4-dev