Re: Ghostscript rendering to GdkPixmap



Beat Zahnd <beat zahnd phim unibe ch> writes: 
This works fine. The only problem is that this functions returns after
Ghostscript has terminated. How can I get it to render the pixmap in the
background? Whithout waitpid() it isnt't working.

You might look at the source for g_spawn_async() and friends in GLib
1.3.4. I'm not sure what's going wrong, but that code shows how to
avoid the waitpid() anyhow.

Second question: why is this gdk_flush() required? Is gdk somehow
buffered?

Yes. Or rather, Xlib is. The X requests are all asynchronous and buffered.
 
Another question: how can i avoid signal handlers like this one:

----code----
void exit_handler(int signum)
{
  gtk_main_quit();
}
----code----

I think that gtk_main_quit() is not signal save.

Indeed it is not.

There are several ways, one way is the main loop source in GNOME CVS 
as beast/blib/glib-extra.h, see g_usignal_add().

Another is to have a pipe, write a byte to it in the signal handler,
and have a g_io_add_watch() main loop source that watches the other
end of the pipe and will thus wake up the main loop when you get a
UNIX signal.

Havoc




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