Re: Point of GtkDrawingArea?



Chris Seaton wrote:
What's the point of GtkDrawingArea? I want to write my own widget, and the docs say that's what GtkDrawingArea is for, but what does subclassing it add over just subclassing GtkWidget?

I looked at the source code in gtkdrawingarea.c and there's less than a screen of code! What's the point of this class? Is subclassing it the correct thing to do when writing your own widget?

I might be diverging alot from what the docs say here but here is
my understanding; GtkDrawingArea is a solution for people who want
a widget they can simply draw to (i.e. widget->window); subclassing
GtkDrawingArea is OK, but as you've pointed out (IMO also) kindof
pointless.

The correct thing to do when writing your own widget is to look
at the existing object heirarchy and subclass a widget that does
most of what you need it to do and then extend its functionality,
i.e. Why would GtkRadioButton be a subclass of GtkDrawingArea and
not GtkButton ?

Cheers,
                                 -Tristan




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