Re: Ghostscript rendering to GdkPixmap
- From: Havoc Pennington <hp redhat com>
- To: Beat Zahnd <beat zahnd phim unibe ch>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Ghostscript rendering to GdkPixmap
- Date: 22 Apr 2001 10:59:10 -0400
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
Yes. Or rather, Xlib is. The X requests are all asynchronous and buffered.
Another question: how can i avoid signal handlers like this one:
void exit_handler(int signum)
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
] [Thread Prev