GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

drawable and expose_event

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
bil
Familiar Face


Joined: 27 Mar 2007
Posts: 26

PostPosted: Fri May 11, 2007 5:02 am    Post subject: drawable and expose_event Reply with quote

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
Back to top
openldev
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 376
Location: State College, Pennsylvania

PostPosted: Fri May 11, 2007 1:16 pm    Post subject: Reply with quote

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?
Back to top
bil
Familiar Face


Joined: 27 Mar 2007
Posts: 26

PostPosted: Fri May 11, 2007 1:39 pm    Post subject: Reply with quote

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.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP