RE: How to redraw the application window of a multithreaded GTK app?



> From: Olexiy Avramchenko [mailto:ath beast stu cn ua]
> Sent: Wednesday, September 25, 2002 12:05 PM
>
> 1. Under the X you can use XShm shared pixmap. You can read/write
> its memory
> like an image's memory but its faster to draw it.
> 2. gdk_widget_queue_draw() is not the best way to update the screen in
> your case.
> You have to directly call gdk_draw_* in drawing thread (dont forget to
> call gdk_flush()
> to sync X server).
> 3. Set the shared pixmap as the background of the drawing area window to
> avoid
> handling "expose" event manually. There was a big thread "drawing
> graphics"
> (09.19.2001) about.

I have checked the example scribble_simple, which was mentioned in one of
the mails in the thread "drawing graphics". It works well on my PC. But it
doesn't call gdk_window_set_back_pixmap().

So I modified scribble_simple in order to use the pixmap as a back pixmap. I
called gdk_window_set_back_pixmap() in configure_event(), and I removed
gtk_signal_connect(..., "expose_event", ...) in main().

If I understood all explanations discussed in this mailing list right, I
would expect that the back pixmap refreshes the drawing area automatically
without having an expose_event handler implemented in the application. But
nothing happens when I click into the drawing area of scribble_simple.

But if I hide the scribble_simple window and reveal it again, it shows the
black rectangles drawn to the pixmap by draw_brush().

I'm not sure if it is relevant: I use X-Manager for remote login to the
Linux PC, and I have GTK+ 1.2 installed.

Any idea about that problem?

Joerg




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