示例#1
0
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" );
	}
}
示例#2
0
文件: menu.c 项目: arinity/gchat2
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);
}
示例#3
0
Notify_value
mag_handler ()
{
	menu_set ( menu_find ( main_menu, MENU_STRING, "magnify", 0 ),
		MENU_INACTIVE, FALSE, 0 );

	return NOTIFY_DONE;
}
示例#4
0
文件: menu.c 项目: dmilith/ekg2-bsd
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;
	}
}