Porting some exo code to GTK3 as part of SpaceFM - how to properly subclass GtkCellRendererText

OmegaPhil OmegaPhil at startmail.com
Sat Jul 11 16:17:28 CEST 2015


On 11/07/15 01:47, Matthew Brush wrote:
> On 2015-07-10 05:07 PM, compmastermike at yahoo.com wrote:
>>> On Friday, July 10, 2015 3:34 PM, OmegaPhil <OmegaPhil at startmail.com>
>>> wrote:
>>> SpaceFM[0] has recently nicked the icon picker/viewer from exo [...]
>>
>>
>> You shouldn't be using _get_size() at all in gtk3. This is the new
>> height-for-width stuff [...]
> 
> It might be different regarding sizes of cell renderers. I don't know
> much about Gtk+ tree cells except that I don't think they are normal
> widgets, though it's possible they do indeed share the same layout
> mechanisms as widgets.
> 
> Cheers,
> Matthew Brush
> 
> _______________________________________________
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
> https://mail.xfce.org/mailman/listinfo/xfce4-dev


Thanks all for the responses. I did an experiment replacing out the text
cell renderer with GTK's standard one to see how things went - I got the
same brokenness and CPU rape, which is good news for me (i.e. its a more
general GTK3 problem rather than me porting this particular cell renderer).

When using GtkCellRendererText the key thing that changes is that the
cell text no longer gets selected when you select the icon - this is
what the exo renderer's follow-state[0] is talking about - so I will be
keeping the exo renderer and the 'architectural problem' I've been
happening is probably irrelevant (can't call get_size or
get_preferred_size off GtkCellRendererClass in
exo_cell_renderer_ellipsized_text_render? Who cares, just use the
gtk_cell_renderer_get_size function call rather than depending on
pointers (reasons why I shouldn't do this are appreciated ;)).


0:
http://git.xfce.org/xfce/exo/tree/exo/exo-cell-renderer-ellipsized-text.c#n47

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://mail.xfce.org/pipermail/xfce4-dev/attachments/20150711/712a4ab2/attachment.sig>


More information about the Xfce4-dev mailing list