Re: Packing a button in a GtkCellRenderer

Emmanuele Bassi a écrit :
On Sun, 2008-09-21 at 21:30 -0400, Andrew Smith wrote:
A custom cell renderer (as in ) seems to be a lot of work, apparently I have to render the button myself.. but I may be misunderstanding.
no, you understood correctly: you need to write a custom cell renderer
that draws a button.


Ok, so does that mean I'll have to reimplement GtkButton? That's why I say it seems to be a lot of work.

you don't need to reimplement *all* GtkButton - mostly the gtk_paint
calls to make it possible for themes to actually paint your cell
renderer like a button.

Or can I use a GtkButton in a cell renderer?

no, you can't.

Is there a tutorial or some sample code somewhere anyone knows of that could help me figure this out?

not that I know of; you can have a look at how the toggle cell renderer
works - it's basically all you need to implement a button.


I had a look at GtkCellRendererToggle. That's pretty intense, I've decided my time will be better spent adding functionality to my application than writing hacks like that :)

I guess if this is how it's done in GTK, there's no point in looking for an easier way.

The thing is I /would/ have to reimplement a GtkButton. See I don't just need one drawn, I can do that (minus theme) with a pixmap. I need everything that a button does.

Thanks for the advice though, maybe one day I'll have time to play with things like that.



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