magnify () { int pid; extern int errno; menu_set ( menu_find ( main_menu, MENU_STRING, "magnify", 0 ), MENU_INACTIVE, TRUE, 0 ); pid = vfork (); if ( pid == -1 ) /* fork failed */ { printf ( "fork failed errno is %d\n", errno ); } else if ( pid ) /* parent */ { notify_set_wait3_func ( canvas, mag_handler, pid ); } else /* child */ { execlp ( "/bin/X11/xmag", "xmag", "-display", getenv("DISPLAY"), (char *) 0); printf ( "exec failed\n" ); } }
static void menu_del_cb (GtkWidget *menu, menu_entry *me, char *target) { GtkWidget *item = menu_find (menu, me->path + me->root_offset, me->label); if (item) gtk_widget_destroy (item); }
Notify_value mag_handler () { menu_set ( menu_find ( main_menu, MENU_STRING, "magnify", 0 ), MENU_INACTIVE, FALSE, 0 ); return NOTIFY_DONE; }
static void menu_update_cb(GtkWidget *menu, menu_entry * me, char *target) { GtkWidget *item; item = menu_find(menu, me->path, me->label); if (item) { gtk_widget_set_sensitive(item, me->enable); /* must do it without triggering the callback */ if (GTK_IS_CHECK_MENU_ITEM(item)) GTK_CHECK_MENU_ITEM(item)->active = me->state; } }