Re: [gtk-list] Re: Two more Gtk questions (fast frame rates and thread safety)




> Do I understand the distinctions among the various display widgets
> correctly?
> 
>   drawing area: general purpose widget allowing you to draw whatever
>     to its content area
> 
>   image: more special purpose widget designed to display an image
> 
>   preview: full blown image display widget including dithering, etc.

Correct.

> If all that's more or less right, then is it possible to set a
> GtkImage up so that your own code gets called after any redraw?  I
> wanted to use that to annotate a given video frame with drawing
> primitives.  I'm talking about structural annotations like lines,
> boxes, etc.

I haven't tested it, but you should be able to hook in your own
routine with 

   gtk_signal_connect_after(GTK_OBJECT(widget), "expose_event", ...)

Using connect_after is important because by default, event signals
are set up to run before the default handler (so you can cancel it 
in your own event handler.) But here you want to draw on top of
the default stuff.

> I suppose I could do the same thing (probably more efficiently) by
> drawing to the gdk_image directly before using gtk_image_set to
> display it, but I didn't know if there was any easy way to do that; is
> there?

That isn't possible (using gtk_draw_whatever type calls) since the
image data is in the client's memory space, while the code to do
the drawing is part of the X server.

Regards,
                                        Owen



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