simple widget to draw on ?



Hi,

I have come across this several times in the past and I am wonderding if
GTK+ is missing a simple widget that does nothing else providing a space
to draw on in an expose-event callback. Look for example at bug #519317:

 http://bugzilla.gnome.org/show_bug.cgi?id=519317

The Print dialog wants to draw an image using Cairo. It does this
currently using a GtkDrawingArea. This has the disadvantage that
GtkDrawingArea has its own output window. So the patch I attached to
this bug-report changes the code to use a GtkEventBox. Somewhat better
as the drawing will now be done on the background window. A GtkEventBox
does however have an input window which is completely unnecessary here.

Shouldn't GTK+ provide a really simple output widget for this use case?
I would just instantiate a GtkWidget, but GtkWidget is abstract. Am I
missing something obvious?


Sven




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