


GtkWidget *do_create_PixmapFromFile(gchar *thefile);
GtkWidget *do_create_PixmapFromFile(gchar *thefile){

/*
	static GStaticMutex mutex = G_STATIC_MUTEX_INIT;
	g_static_mutex_lock (&mutex);
	gdk_threads_enter ();
*/
	GtkWidget *pixmapwid;


        GdkPixbuf *pixbuf;
	GdkPixmap *pixmap;
	GdkBitmap *mask; 

	pixbuf = gdk_pixbuf_new_from_file (thefile,0);

	gdk_pixbuf_render_pixmap_and_mask(pixbuf, &pixmap, &mask, 128);
	pixmapwid = gtk_pixmap_new( pixmap, mask );
/*
	gdk_threads_leave ();
	g_static_mutex_unlock (&mutex);
*/
	return(pixmapwid);

}

// this does not work
GdkPixmap *do_create_Pixmap(GtkWidget *pixmapwid);
GdkPixmap *do_create_Pixmap(GtkWidget *pixmapwid){

	GdkPixmap *pixmap;
	GdkBitmap *mask; 
	gtk_pixmap_get (pixmapwid, pixmap , mask);
	return(pixmap);

}

void wBuiltin_gtk_get_pixmap_and_mask();
void wBuiltin_gtk_get_pixmap_and_mask(){

	static GStaticMutex mutex = G_STATIC_MUTEX_INIT;
	g_static_mutex_lock (&mutex);
	gdk_threads_enter ();

// object cannot be created by glade, so it was added with createobject
// so find it

	gchar maskname[1024];
	sprintf(maskname , "%s" , getstringarg());

	gchar pixname[1024];
	sprintf(pixname , "%s" , getstringarg());


	gchar arg0[1024];
	sprintf(arg0 , "%s" , getstringarg());


	GtkWidget *obj;

	obj = findwidget(arg0);

	GdkPixmap *pixmap;
	GdkBitmap *mask; 
	gtk_pixmap_get (GTK_WIDGET( obj), &pixmap , &mask);


	GO[GOcount].obj = pixmap;
	sprintf(GO[GOcount].name , "%s" , pixname);
	sprintf(GO[GOcount].type , "%s" , "GdkPixmap");

	GTKwidgets = g_list_append(GTKwidgets , GO[GOcount].obj);
	GTKwidgetnames = g_list_append(GTKwidgetnames , GO[GOcount].name);
	//GTKwidgettypes = g_list_append(GTKwidgettypes , "GdkPixmap");
	GOcount++;


	GO[GOcount].obj = mask;
	sprintf(GO[GOcount].name , "%s" , maskname);
	sprintf(GO[GOcount].type , "%s" , "GdkMask");

	GTKwidgets = g_list_append(GTKwidgets , GO[GOcount].obj);
	GTKwidgetnames = g_list_append(GTKwidgetnames , GO[GOcount].name);
	//GTKwidgettypes = g_list_append(GTKwidgettypes , "GdkMask");
	GOcount++;

	gdk_threads_leave ();
	g_static_mutex_unlock (&mutex);
	return;
}








