Re: Placing widget on top of DrawingArea



On Sat, Feb 22, 2003 at 09:34:44PM -0600, Lars Clausen wrote:
> 
> In Dia, we have the diagram displayed in a GtkDrawingArea widget.
> Currently, we do text editing in the diagram by rendering our own cursor
> and handling all events on our own.  That's not a very practical approach
> for several reasons.
> 
> Instead, I'd like to place an appropriate text editing widget (GtkTextView
> + GtkTextBuffer) on top of the text in the diagram, and get all the
> standard editing for free.  But GtkDrawingArea is not a container widget --
> is there any reasonable way I can place the GtkTextView on top of the
> GtkDrawingArea?  It'll be removed as soon as the editing is done, e.g. when
> anything else is done to the diagram.
> 

A DrawingArea really is just a widget that doesn't offer any
functionality; so it's pretty trivial to create a GtkContainer
subclass that could contain the TextView and also let you draw on
it. Or GtkFixed with its GdkWindow turned on (see GtkFixed docs) may
be just what you want, you can override its expose handler.

Havoc



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