Re: Text alignment in a custom cell renderer?

On Mon, 2006-07-10 at 11:03 +1000, Daniel Kasak wrote:

I assume I have to get the value of the 'xalign' property and manually
set alignment, but I can't quite figure out how to do that. There's no
parent object for the layout ( I originally thought it might have a
Gtk2::Alignment parent ... as in my previous alignment question ...  but
no such luck in this case ). I've tried the 'set_alignment' method of
the layout object, but this doesn't seem to align things either. Any clues?

I think you'll have to override GET_SIZE and return an appropriate
x-offset value, depending on the desired alignment.  See `perldoc
Gtk2::CellRenderer´ / DERIVING NEW CELL RENDERERS.  For an example, take
a look at gtkcellrenderertext.c in gtk+'s source, function get_size().


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]