GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Aug 22, 2014 9:38 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: drawable and expose_event
PostPosted: Fri May 11, 2007 5:02 am 
Offline
Familiar Face

Joined: Tue Mar 27, 2007 8:56 am
Posts: 26
I want to display random pictures each time expose_event is called.

There are 2 related problems,
1) how to clear all content of the drawable?

2) when the previous picture is partially covered and then if I use gdk_draw_pixbuf to draw a new picture, some portion of the old picture is still leaved untouched, Is there any means to invalidate the whole drawable inside the expose_event?

Thankx


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 11, 2007 1:16 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
You can use gdk_window_clear() to erase the contents of a GdkWindow. As for your second problem, could we see a bit of code?

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 11, 2007 1:39 pm 
Offline
Familiar Face

Joined: Tue Mar 27, 2007 8:56 am
Posts: 26
openldev wrote:
You can use gdk_window_clear() to erase the contents of a GdkWindow. As for your second problem, could we see a bit of code?


Hi, thank you for suggestion. I tried that but it didn't work. But I finally found the reason. It is because inside the expose_event, gtk+ already call gdk_begin_paint_region so that only those hidden portion will be updated after gdk_end_paint. I turn off double buffering and it works.

thanks again.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot], newguy and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group