 |
GTK+ Forums Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
|
|
|
| Author |
Message |
|
|
bil Familiar Face
Joined: 27 Mar 2007 Posts: 26
|
Posted: Fri May 11, 2007 5:02 am Post subject: drawable and expose_event |
|
|
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: 386 Location: Fairfax, Virginia
|
Posted: Fri May 11, 2007 1:16 pm Post subject: |
|
|
| 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
|
Posted: Fri May 11, 2007 1:39 pm Post subject: |
|
|
| 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 |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group CodeBB 1.0 Beta 2
|