Gtk-Perl

 view release on metacpan or  search on metacpan

Gnome/xs/GnomeDialog.xs  view on Meta::CPAN

	Gnome::Dialog	dialog
	SV *	first
	CODE:
	{
		int count = items-1;
		const char ** b = malloc(sizeof(char*) * (count+1));
		int i;
		
		for(i=0;i<count;i++)
			b[i] = SvPV(ST(i+1), PL_na);
		b[i] = 0;
		gnome_dialog_append_buttonsv(dialog, b);
		free(b);
	}

void
gnome_dialog_append_button_with_pixmap (dialog, name, pixmap)
	Gnome::Dialog dialog
	char *	name
	char *	pixmap

void
gnome_dialog_append_buttons_with_pixmaps (dialog, first_name, first_pixmap, ...)
	Gnome::Dialog	dialog
	SV *	first_name
	SV *	first_pixmap
	CODE:
	{
		int count = items-1;
		const char ** b;
		const char ** p;
		int i;
		
		if (count % 2)
			croak("need an even number of buttons and pixmaps");
		count /= 2;
		b = malloc(sizeof(char*) * (count+1));
		p = malloc(sizeof(char*) * (count+1));
		for(i=0;i<count;i+=2) {
			b[i] = SvPV(ST(i+1), PL_na);
			p[i] = SvPV(ST(i+2), PL_na);
		}
		b[i] = 0;
		p[i] = 0;
		gnome_dialog_append_buttons_with_pixmaps(dialog, b, p);
		free(b);
		free(p);
	}

Gtk::Widget_OrNULL_Up
action_area(dialog)
	Gnome::Dialog dialog
	CODE:
	RETVAL = GTK_WIDGET(dialog->action_area);
	OUTPUT:
	RETVAL

void
buttons(dialog)
	Gnome::Dialog	dialog
	PPCODE:
	{
		GList * l = dialog->buttons;
		while(l) {
			EXTEND(sp,1);
			PUSHs(sv_2mortal(newSVGtkWidget((GtkWidget*)l->data)));
			l=l->next;
		}
	}

#endif



( run in 0.988 second using v1.01-cache-2.11-cpan-5511b514fd6 )