Re: display images continiously!



First off, I'd create a buffer GdkPixmap  or a GdkRGB buffer.  Then on
then on the expose event for your GtkDrawingArea, I'd write the buffer
to the screen (the drawing area's window).  I'd set the configure event
callback for the GtkDrawingArea to manage the buffer and resize it if
needed when the window changes size, etc.  Then in your timeout callback
that gets called every second (gtk_widget_add_timeout), write to the
buffer and then call gtk_widget_draw(), which will synthesize an expose
event.

Basically if you use this double-buffering scheme, then you don't have
to do anything special when the window is uncovered and asked to repaint
itself.  You just copy the buffer onto the DrawingArea on an expose
event.  All changes can be to the buffer which will be displayed by the
expose handler (which can be triggered by gtk_widget_draw and
gtk_widget_queue_draw).

Michael
 


On Sat, 2002-08-03 at 07:39, simith nambiar wrote:
> hi list,
>            i managed to open and display an image
> using GtkImage with help from the list though!
> i wanted to do that adding a timeout every 1 second 
> so i add an event expose and how do i write the expose
> code ?
> 
> i want to do something like this every 1 second on
> expose event called i just want to open a new image
> and display it , but nothing happenning for me !
> 
> regards,
> simith
> 
> =====
> <P><A href="http://www.mcamit.8k.com";>http://www.mcamit.8k.com</A>
> <P><A href="http://www.dblocks.8k.com";>http://www.dblocks.8k.com</A>&nbsp;</P>
> 
> ________________________________________________________________________
> Want to sell your car? advertise on Yahoo Autos Classifieds. It's Free!!
>        visit http://in.autos.yahoo.com
> _______________________________________________
> gtk-list mailing list
> gtk-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-list
-- 
Public key available from http://students.cs.byu.edu/~torriem


Attachment: signature.asc
Description: This is a digitally signed message part



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