Re: fork in callbacks
- From: Owen Taylor <otaylor redhat com>
- To: "Rodrigo Moya" <Moya_Rodrigo/madrid_tecnologia sinvest es>
- Cc: "GTK App Development List" <gtk-app-devel-list redhat com>, "GNOME Discussion" <gnome-list gnome org>
- Subject: Re: fork in callbacks
- Date: 03 Dec 1998 12:15:26 -0500
"Rodrigo Moya" <Moya_Rodrigo/madrid_tecnologia@sinvest.es> writes:
> Hi all!
>
> Can I fork() inside a (GNOME) widget callback?, for example:
>
> void checkout_dialog_cb (GtkWidget *w, gint button_number, gpointer
> data)
> {
> GtkWidget *dialog = GTK_WIDGET(data);
> g_return_if_fail(dialog != NULL);
> switch (button_number)
> {
> case 0 : // 'Ok' button
> switch (fork())
> {
> ..............whatever()..................
> }
> break;
> case 1 : // 'Cancel' button
> gtk_widget_destroy(dialog);
> break;
> }
> }
>
> This is a callback for a GnomeDialog widget.
Yes, as long as you:
- Make no libgnomeui or GTK+ calls in the child process
- Exit the child process with _exit() instead of exit().
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]