Re: inserting ColorButton in CellRenderer ....



Ok I saw it .. What I don't understand is why do you have to paint the widget from scratch?? and check if it is active, or toggled to paint that particular behaviour?? isn't there a simpler way to just add it to the cell and call the widget's own paint function?? The widget I want is a little more complex it has an inner rectangle showing the current color.

Thanks

2008/3/14 Andrew E. Makeev <andrew solvo ru>:
В Чтв, 13/03/2008 в 15:14 -0400, Roberto Alejandro Espí Muñoz пишет:
> Thanks for your help. I'm trying to follow your directions.  I still
> have some doubts about how to define the two functions you wish me to
> override.  In get_size_vfunc I receive a &Widget, a Gdk::Rectangle*
> cell_area, an offset to x and y and a width and height parameters.
> How can I use them? Do I set those parameters onto the oncoming widget
> or do I set them from the Widget's parameters??  For the second
> function render_vfunc I didn't clearly understand what you wanted me
> to do.

The best way to understand those functions behavior is to look at source
code:

gtkcellrenderertext.c
gtkcellrenderertoggle.c

get_size_vfunc - should set width and height for cell you are going to
poaint button on.

render_vfunc - should paint the button itself.

I will attach source of my ButtonRenderer (Button with text) to give you
some hints. But don't copy it to your code, just get some clue how to
implement your renderer.

-andrew




--
teratux
------------
http://teratux.blogspot.com


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