Re: simple widget to draw on ?



Hi,

On Sun, Mar 2, 2008 at 12:44 PM, Sven Neumann <sven gimp org> wrote:
>  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?
>

You could probably use GtkAlignment or something like that, right?

I would maybe not add a new widget for this, but instead make
GtkDrawingArea have a no-window mode. If you look at the GtkFixed
source, it has conditional branches in realize() and size_allocate()
depending on whether NO_WINDOW is set. DrawingArea could work the same
way, seems like it would be a trivial patch.

(Though, I also wonder if there's a bug in either the use of
DrawingArea or the theme shown in your screenshot; looking at the gtk
code, the drawing area's background should be set on theme change and
on realize, so maybe someone is painting over the theme background in
the expose handler, or the theme just fails to handle drawing area, or
something.)

Havoc


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