
static GStaticMutex listmutex = G_STATIC_MUTEX_INIT;
wBuiltin_gtk_clist_get_pixtext  (){


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

	gchar arg0[1024];
	gchar arg1[1024];
	gchar arg2[1024];

	sprintf(arg2 , "%s" , getstringarg());
	sprintf(arg1 , "%s" , getstringarg());
	sprintf(arg0 , "%s" , getstringarg());

	GtkWidget *obj;
	int i;
	gchar tempobjectname[255];
	gchar *objectname;
	GList *li = NULL; /* an iterator variable */

	objectname = strstr(arg0 , ":");
	if(! objectname){
		obj = glade_xml_get_widget(xml, arg0);
	//printf("glade: %s\n" , arg0);
	}else{

		i = 0;
		for(li = GTKwidgetnames; li != NULL; li = li->next){

        		sprintf(tempobjectname , ":%s", (char *)li->data);
			if (!strcmp(  tempobjectname , objectname )) {
				li = g_list_nth(GTKwidgets , i);
				obj = li->data;
				//printf("gtk: %s\n" , objectname);
				break;
			}
			i++;
		}
	}
	GdkPixmap *pixmap;
	GdkBitmap *mask; 
	gint spacing; 

	gtk_clist_get_pixtext( GTK_CLIST(obj),atoi(arg1)  , atoi(arg2)  , &returntext[3].text ,&spacing ,&pixmap , &mask );
	returnstring("Nothing");

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

wBuiltin_gtk_clist_set_pixtext  (){


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

	gchar arg0[1024];
	gchar arg1[1024];
	gchar arg2[1024];
	gchar arg3[1024];
	gchar arg4[1024];
	gchar arg5[1024];
	gchar arg6[1024];

	sprintf(arg6 , "%s" , getstringarg());
	sprintf(arg5 , "%s" , getstringarg());
	sprintf(arg4 , "%s" , getstringarg());
	sprintf(arg3 , "%s" , getstringarg());
	sprintf(arg2 , "%s" , getstringarg());
	sprintf(arg1 , "%s" , getstringarg());
	sprintf(arg0 , "%s" , getstringarg());

        GList *li6 = NULL;
        GList *li5 = NULL;

	li6 = findobject(arg6);
	li5 = findobject(arg5);

	GtkWidget *obj;
	int i;
	gchar tempobjectname[255];
	gchar *objectname;
	GList *li = NULL; /* an iterator variable */

	objectname = strstr(arg0 , ":");
	if(! objectname){
		obj = glade_xml_get_widget(xml, arg0);
	//printf("glade: %s\n" , arg0);
	}else{

		i = 0;
		for(li = GTKwidgetnames; li != NULL; li = li->next){

        		sprintf(tempobjectname , ":%s", (char *)li->data);
			if (!strcmp(  tempobjectname , objectname )) {
				li = g_list_nth(GTKwidgets , i);
				obj = li->data;
				//printf("gtk: %s\n" , objectname);
				break;
			}
			i++;
		}
	}
	gtk_clist_set_pixtext(  GTK_CLIST(obj) , atoi(arg1)  , atoi(arg2)  , arg3 , atoi(arg4) , li5->data  , li6->data  );
	returnstring("Nothing");


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

wBuiltin_gtk_get_list_selection (){


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

	gchar result[1024];  

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

        GList *li1 = NULL;
     	li1 = findobject(arg0);

	//printf("- --->%d\n" , lastfoundobject);

	sprintf(result , "%d" , listselections[lastfoundobject].selected);
        returnstring(result);

	gdk_threads_leave();
	g_static_mutex_unlock (&mutex);
}

wBuiltin_gtk_count_list_rows (){


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

	gchar result[1024];  

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

        GList *li1 = NULL;
     	li1 = findobject(arg0);

	//printf("- --->%d\n" , lastfoundobject);
	GtkCList *clist;

	clist = GTK_CLIST(li1->data);
	sprintf(result , "%d" , clist->rows);
        returnstring(result);

	gdk_threads_leave();
	g_static_mutex_unlock (&mutex);
}

/*
 *	"delete_event" signal callback.
 *
 *	Called when a GtkWindow closes.
 */
static gint HandleCloseCB(
	GtkWidget *widget, gpointer *event, gpointer data
)
{
	/* Make it simple, when one window closes we just effectively
	 * close them all by breaking out of the last GTK+ main loop
	 * so that they will all be destroyed.
	 */
	gtk_main_quit();

        return(TRUE);
}

/*
 *	"select_row" signal callback.
 *
 *	Called when a row is selected on a GtkCList.
 */



static void CListSelectRowCB(
	GtkWidget *widget,
	gint row, gint column,
        GdkEventButton *event, gpointer data
)
{
	GtkCList *clist;
	my_prog_window_struct *win = (my_prog_window_struct *)data;
	if((widget == NULL) || (win == NULL))
		return;

	clist = GTK_CLIST(widget);

	/* Selected row in bounds? */
	if((row >= 0) && (row < clist->rows))
	{
		gint cell_type;
		guint8 spacing = 0;
		gchar *text = NULL;
		GdkPixmap *pixmap = NULL;
		GdkBitmap *mask = NULL;

listselections[win->clistnumber].selected = row;


		/* Obtain the pixmap and mask pair of the icon of the
		 * selected row and update the DND icon.
		 */
		cell_type = gtk_clist_get_cell_type(clist, row, 0);
		switch(cell_type)
		{
		  case GTK_CELL_PIXMAP:
		    gtk_clist_get_pixmap(
			clist, row, 0, &pixmap, &mask
		    );
                  case GTK_CELL_PIXTEXT:
                    gtk_clist_get_pixtext(
			clist, row, 0,
			&text, &spacing, &pixmap, &mask
                    );
		}
		/* Selected row has pixmap? */
		if(pixmap != NULL)
		{
			gint w = 15, h = 15;

			/* Get size of pixmap. */
			gdk_window_get_size(
				(GdkWindow *)pixmap, &w, &h
			);
			/* Update the DND icon to be used on the next
			 * drag based on this pixmap. Set the hot spot
			 * to be at the center of this pixmap.
			 */
			gtk_drag_set_default_icon(
				gdk_colormap_get_system(),
				pixmap, mask,
				w / 2, h / 2
			);
		}

		/* If the selected row is not fully visible, attempt to
		 * scroll and make it visible in the center of the
		 * list.
		 */
		if(gtk_clist_row_is_visible(clist, row) !=
			GTK_VISIBILITY_FULL
		)
			gtk_clist_moveto(
				clist,
				row, 0,		/* Row, column. */
				0.5, 0.0	/* Row, column. */
			);
	}

}

/*
 *	"unselect_row" signal callback.
 *
 *	Called when a row is selected on a GtkCList.
 */
static void CListUnselectRowCB(
        GtkWidget *widget,
        gint row, gint column,
        GdkEventButton *event, gpointer data
)
{
	/* Ignore this. */

	my_prog_window_struct *win = (my_prog_window_struct *)data;
	if((widget == NULL) || (win == NULL))
		return;
//printf("------->%d\n" , listselections[win->clistnumber].selected);

//printf("--nr-->%d\n" , win->clistnumber);
listselections[win->clistnumber].selected = -1;


} 


/*
 *	DND "drag_begin" handler, this is called whenever a drag starts.
 */
static void DNDBeginCB(
	GtkWidget *widget, GdkDragContext *dc, gpointer data
)
{
        my_prog_window_struct *win = (my_prog_window_struct *)data;
        if((widget == NULL) || (win == NULL) || (dc == NULL))
		return;

	/* Put any needed drag begin setup code here. */



}

/*
 *      DND "drag_end" handler, this is called when a drag and drop has
 *	completed. So this function is the last one to be called in
 *	any given DND operation.
 */
static void DNDEndCB(
	GtkWidget *widget, GdkDragContext *dc, gpointer data
)
{
        my_prog_window_struct *win = (my_prog_window_struct *)data;
        if((win == NULL) || (dc == NULL))
                return;

	/* Put any needed drag end cleanup code here. */

	//LOCK=0;
	//gdk_threads_leave();
	//g_static_mutex_unlock (&listmutex);
}

/*
 *	DND "drag_motion" handler, this is called whenever the 
 *	pointer is dragging over the target widget.
 */
static gboolean DNDDragMotionCB(
        GtkWidget *widget, GdkDragContext *dc,
        gint x, gint y, guint t,
        gpointer data
)
{

//return(FALSE);

	gboolean same_widget;
	GdkDragAction suggested_action;
	GtkWidget *src_widget, *tar_widget;
	my_prog_window_struct *win = (my_prog_window_struct *)data;
        if((win == NULL) || (dc == NULL)){

                return(FALSE);
	}
	/* Get source widget and target widget. */
	src_widget = gtk_drag_get_source_widget(dc);
	tar_widget = widget;

	/* Note if source widget is the same as the target. */
	same_widget = (src_widget == tar_widget) ? TRUE : FALSE;


	/* If this is the same widget, our suggested action should be
	 * move.  For all other case we assume copy.
	 */
	if(same_widget)
		suggested_action = GDK_ACTION_MOVE;
	else
		suggested_action = GDK_ACTION_COPY;

	/* Respond with default drag action (status). First we check
	 * the dc's list of actions. If the list only contains
	 * move, copy, or link then we select just that, otherwise we
	 * return with our default suggested action.
	 * If no valid actions are listed then we respond with 0.
	 */

        /* Only move? */
        if(dc->actions == GDK_ACTION_MOVE)
            gdk_drag_status(dc, GDK_ACTION_MOVE, t);
        /* Only copy? */
        else if(dc->actions == GDK_ACTION_COPY)
            gdk_drag_status(dc, GDK_ACTION_COPY, t);
        /* Only link? */
        else if(dc->actions == GDK_ACTION_LINK)
            gdk_drag_status(dc, GDK_ACTION_LINK, t);
        /* Other action, check if listed in our actions list? */
        else if(dc->actions & suggested_action)
            gdk_drag_status(dc, suggested_action, t);
        /* All else respond with 0. */
        else
            gdk_drag_status(dc, 0, t);



	return(FALSE);
}

/*
 *	DND "drag_data_get" handler, for handling requests for DND
 *	data on the specified widget. This function is called when
 *	there is need for DND data on the source, so this function is
 *	responsable for setting up the dynamic data exchange buffer
 *	(DDE as sometimes it is called) and sending it out.
 */
static void DNDDataRequestCB(
	GtkWidget *widget, GdkDragContext *dc,
	GtkSelectionData *selection_data, guint info, guint t,
	gpointer data
)
{
	gboolean data_sent = FALSE;
	gint row;
	GList *glist;
	GtkCList *clist;
	my_prog_window_struct *win = (my_prog_window_struct *)data;
        if((widget == NULL) || (win == NULL) || (dc == NULL))
                return;

	clist = GTK_CLIST(widget);

	/* Get last selected row on the clist. */
	glist = clist->selection_end;
	row = (glist != NULL) ? (gint)glist->data : -1;

	/* Selected row in bounds? */
	if((row >= 0) && (row < clist->rows))
	{
		gint cell_type;
                guint8 spacing = 0;
                gchar *text = NULL;
                GdkPixmap *pixmap = NULL;
                GdkBitmap *mask = NULL;


                /* Obtain the text of the first cell of the selected
		 * row, then use this text and send it out to the DDE.
                 */
                cell_type = gtk_clist_get_cell_type(clist, row, 0);
                switch(cell_type)
                {
                  case GTK_CELL_TEXT:
                    gtk_clist_get_text(
                        clist, row, 0, &text
                    );
                  case GTK_CELL_PIXTEXT:
                    gtk_clist_get_pixtext(
                        clist, row, 0,
                        &text, &spacing, &pixmap, &mask
                    );
                }
                /* Selected row has text? */
		if(text != NULL)
		{
			/* Send out the data using the selection system,
			 * this is also used for cut and paste but
			 * GTK uses it for drag and drop as well. When
			 * sending a string, GTK will ensure that a null
			 * terminating byte is added to the end so we
			 * do not need to add it. GTK also coppies the
			 * data so the original will never be modified.
			 */
			gtk_selection_data_set(
				selection_data,
				GDK_SELECTION_TYPE_STRING,
				8,	/* 8 bits per character. */
				text, strlen(text)
			);
			data_sent = TRUE;
		}
	}

	/* If we did not send out any data (for whatever reason),
	 * then send out an error response since this function
	 * needs to gaurantee a response when reasonably possible.
	 */
return(0);
	if(!data_sent)
	{
		const gchar *cstrptr = "Error";

		gtk_selection_data_set(
			selection_data,
			GDK_SELECTION_TYPE_STRING,
			8,	/* 8 bits per character. */
			cstrptr, strlen(cstrptr)
		);
		data_sent = TRUE;
	}
}

/*
 *      DND "drag_data_received" handler. When DNDDataRequestCB()
 *	calls gtk_selection_data_set() to send out the data, this function
 *	recieves it and is responsible for handling it.
 *
 *	This is also the only DND callback function where the given
 *	inputs may reflect those of the drop target so we need to check
 *	if this is the same structure or not.
 */
static void DNDDataRecievedCB(
	GtkWidget *widget, GdkDragContext *dc,
	gint x, gint y, GtkSelectionData *selection_data,
	guint info, guint t, gpointer data
)
{
	gboolean same;
	gint row, column;
	GtkWidget *source_widget;
	GtkCList *clist;
        my_prog_window_struct *win = (my_prog_window_struct *)data;
        if((widget == NULL) || (win == NULL) || (dc == NULL))
                return;

	/* Important, check if we actually got data.  Sometimes errors
	 * occure and selection_data will be NULL.
	 */
	if(selection_data == NULL)
		return;
        if(selection_data->length < 0)
                return;

        /* Source and target widgets are the same? */
	source_widget = gtk_drag_get_source_widget(dc);
        same = (source_widget == widget) ? TRUE : FALSE;

        clist = GTK_CLIST(widget);

	/* Calculate the row and column at which the drop has occured
	 * over on the clist based on the given x and y coordinates.
	 */
	if(!gtk_clist_get_selection_info(
		clist,
		x,
		y - ((clist->flags & GTK_CLIST_SHOW_TITLES) ?
			clist->column_title_area.height +
			clist->column_title_area.y : 0),
		&row, &column
	))
	{
		row = -1;
		column = 0;
	}

	/* Now check if the data format type is one that we support
	 * (remember, data format type, not data type).
	 *
	 * We check this by testing if info matches one of the info
	 * values that we have defined.
	 *
	 * Note that we can also iterate through the atoms in:
	 *	GList *glist = dc->targets;
	 *
	 *	while(glist != NULL)
	 *	{
	 *	    gchar *name = gdk_atom_name((GdkAtom)glist->data);
	 *	     * strcmp the name to see if it matches
	 *	     * one that we support
	 *	     *
	 *	    glist = glist->next;
	 *	}
	 */
	if((info == DRAG_TAR_INFO_0) ||
           (info == DRAG_TAR_INFO_1) ||
           (info == DRAG_TAR_INFO_2)
	)
	{
		gint new_row;
		gchar *new_text = selection_data->data;
		gchar *text[1];
		GdkPixmap *pixmap = NULL;
		GdkBitmap *mask = NULL;


		/* Reset cells text array for adding a new row, we'll
		 * set the actual text after the row has been created.
		 */
		text[0] = "";

		/* Append or insert the new row? */
		if((row >= 0) && (row < clist->rows))
                        new_row = gtk_clist_insert(clist, row, text);
		else
			new_row = gtk_clist_append(clist, text);

		/* Check the name of the cell obtained from the received
		 * data and decipher which pixmap and mask pair to
		 * use for the new cell (if any).
		 */
//---
		if(!strcmp(new_text, "Sphere"))
		{
			pixmap = sphere_pixmap;
			mask = sphere_mask;
		}
		else if(!strcmp(new_text, "Cube"))
		{
                        pixmap = cube_pixmap;
                        mask = cube_mask;
                }
                else if(!strcmp(new_text, "Cone"))
                {
                        pixmap = cone_pixmap;
                        mask = cone_mask;
                }
//---
		/* Update the new row's cell with the pixmap (if
		 * available) and the received data as the text.
		 */
		if(pixmap != NULL)
			gtk_clist_set_pixtext(
				clist, new_row, 0,
				new_text, 2, pixmap, mask
			);
		else
			gtk_clist_set_text(
				clist, new_row, 0,
				new_text
			);
	}
}

/*
 *	DND "drag_data_delete" handler, this function is called when
 *	the data on the source `should' be deleted (ie if the DND was
 *	a move).
 */
static void DNDDataDeleteCB(
	GtkWidget *widget, GdkDragContext *dc, gpointer data
)
{
	gint row;
	GList *glist;
	GtkCList *clist;
        my_prog_window_struct *win = (my_prog_window_struct *)data;
        if((widget == NULL) || (win == NULL) || (dc == NULL))
                return;

        clist = GTK_CLIST(widget);

        /* Get last selected row on the clist. */
        glist = clist->selection_end;
        row = (glist != NULL) ? (gint)glist->data : -1;

	/* Remove the last selected row. */
	gtk_clist_remove(clist, row);
}  


/*
 *	Creates a new window with everything set up.
 */
static my_prog_window_struct *WindowNew(const gchar *title , char *thewin , char *thebox)
{
	gchar *heading[1];
	GtkWidget *w, *parent, *scrolled_window;
	GtkCList *clist;
	GtkTargetEntry target_entry[3];
	my_prog_window_struct *win = (my_prog_window_struct *)g_malloc0(
		sizeof(my_prog_window_struct)
	);

	if(win == NULL)
	    return(NULL);

win->clistnumber = GOcount; // add the number of the object in the global objectlist
listselections[win->clistnumber].selected = -1;
	// GLOBAL ! //no, not needed ?
        clistcounter++;

        GList *li1 = NULL;
        GList *li2 = NULL;

	li1 = findobject(thewin);
	li2 = findobject(thebox);

	w = li1->data;
	win->toplevel = w;

	/* Do not show the toplevel just yet. */
	parent = w;

	/* Create the scrolled window for the clist and the clist
	 * itself.
	 */

	scrolled_window = li2->data;
	gtk_scrolled_window_set_policy(
		GTK_SCROLLED_WINDOW (scrolled_window),
		GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC
	);

	heading[0] = "Name";
	w = gtk_clist_new_with_titles(1, heading);
	clist = GTK_CLIST(w);
	win->clist = w;
	gtk_clist_set_selection_mode(clist, GTK_SELECTION_SINGLE);
	gtk_clist_set_shadow_type(clist, GTK_SHADOW_IN);
	gtk_clist_column_titles_passive(clist);
        gtk_clist_set_column_justification(
            clist, 0, GTK_JUSTIFY_LEFT
        );
        gtk_clist_set_row_height(clist, 20);
	gtk_signal_connect(
		GTK_OBJECT(w), "select_row",
		GTK_SIGNAL_FUNC(CListSelectRowCB), win
	);
        gtk_signal_connect(
                GTK_OBJECT(w), "unselect_row",
                GTK_SIGNAL_FUNC(CListUnselectRowCB), win
        );
	gtk_container_add(GTK_CONTAINER(scrolled_window), w);

	/* Realize the clist widget and make sure it has a window,
	 * this will be for DND setup.
	 */
	gtk_widget_realize(w);
        if(!GTK_WIDGET_NO_WINDOW(w))
	{
		/* DND: Set up the clist as a potential DND destination.
		 * First we set up target_entry which is a sequence of of
		 * structure which specify the kinds (which we define) of
		 * drops accepted on this widget.
		 */

		/* Set up the list of data format types that our DND
		 * callbacks will accept.
		 */
		target_entry[0].target = DRAG_TAR_NAME_0;
		target_entry[0].flags = 0;
		target_entry[0].info = DRAG_TAR_INFO_0;
                target_entry[1].target = DRAG_TAR_NAME_1;
                target_entry[1].flags = 0;
                target_entry[1].info = DRAG_TAR_INFO_1;
                target_entry[2].target = DRAG_TAR_NAME_2;
                target_entry[2].flags = 0;
                target_entry[2].info = DRAG_TAR_INFO_2;

		/* Set the drag destination for this widget, using the
		 * above target entry types, accept move's and coppies'.
		 */

///*
		gtk_drag_dest_set(
			w,
			GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_HIGHLIGHT |
			GTK_DEST_DEFAULT_DROP,
			target_entry,
			sizeof(target_entry) / sizeof(GtkTargetEntry),
			GDK_ACTION_MOVE | GDK_ACTION_COPY
		);

		gtk_signal_connect(
			GTK_OBJECT(w), "drag_motion",
			GTK_SIGNAL_FUNC(DNDDragMotionCB),
			win
		);
//*/
		/* Set the drag source for this widget, allowing the user
		 * to drag items off of this clist.
		 */
		gtk_drag_source_set(
			w,
			GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
                        target_entry,
                        sizeof(target_entry) / sizeof(GtkTargetEntry),
			GDK_ACTION_MOVE | GDK_ACTION_COPY
		);
		// Set DND signals on clist.
///* 
		gtk_signal_connect(
			GTK_OBJECT(w), "drag_begin",
			GTK_SIGNAL_FUNC(DNDBeginCB), win
		);
                gtk_signal_connect(
                        GTK_OBJECT(w), "drag_end",
                        GTK_SIGNAL_FUNC(DNDEndCB), win
                );
                gtk_signal_connect(
                        GTK_OBJECT(w), "drag_data_get",
                        GTK_SIGNAL_FUNC(DNDDataRequestCB), win
                );
                gtk_signal_connect(
                        GTK_OBJECT(w), "drag_data_received",
                        GTK_SIGNAL_FUNC(DNDDataRecievedCB), win
                );
                gtk_signal_connect(
                        GTK_OBJECT(w), "drag_data_delete",
                        GTK_SIGNAL_FUNC(DNDDataDeleteCB), win
                );
//*/
	}

	return(win);
}

/*
 *	Dealloactes the given window and all its resources.
 */
static void WindowDelete(my_prog_window_struct *win)
{
	GtkWidget *w;


	if(win == NULL)
		return;

	/* Destroy the GtkCList, first remove the DND settings on it
	 * and then destroy it.
	 */
	w = win->clist;
	if(w != NULL)
	{
		/* Remove DND settings on this widget. */
		gtk_drag_dest_unset(w);
		gtk_drag_source_unset(w);

		win->clist = NULL;
		gtk_widget_destroy(w);
	}

	/* Destroy toplevel GtkWindow, thus destroying all of its
	 * child widgets.
	 */
	w = win->toplevel;
	if(w != NULL)
	{
		win->toplevel = NULL;
		gtk_widget_destroy(w);
	}

	/* Deallocate the structure itself. */
	g_free(win);
}


GtkWidget *do_create_lists(char *thewin , char *thebox){


    static int current_number = 0;
    int ret_val;
    static GStaticMutex mutex = G_STATIC_MUTEX_INIT;
    g_static_mutex_lock (&mutex);


	GtkStyle *style;
	GdkWindow *window;
	GdkPixmap **pixmap;
	GdkBitmap **mask;
	gchar **pixmap_data;
	my_prog_window_struct *win[1];


	/* Load the pixmaps that we will be using as GtkCList cell
	 * pixmaps and DND icons.
	 *
	 * This requires that we use the root window for loading of
	 * the pixmaps (hence the need to include gdk/gdkx.h).
	 */
	style = gtk_widget_get_default_style();
	window = (GdkWindow *)GDK_ROOT_PARENT();


	pixmap = &sphere_pixmap;
	mask = &sphere_mask;
	pixmap_data = sphere_xpm;
        *pixmap = gdk_pixmap_create_from_xpm_d(
            window, mask,
            &style->bg[GTK_STATE_NORMAL],
            pixmap_data
        );

        pixmap = &cube_pixmap;
        mask = &cube_mask;
        pixmap_data = cube_xpm;
        *pixmap = gdk_pixmap_create_from_xpm_d(
            window, mask,
            &style->bg[GTK_STATE_NORMAL],
            pixmap_data
        );

        pixmap = &cone_pixmap;
        mask = &cone_mask;
        pixmap_data = cone_xpm;
        *pixmap = gdk_pixmap_create_from_xpm_d(
            window, mask,
            &style->bg[GTK_STATE_NORMAL],
            pixmap_data
        );


	/* Create two windows. */
	win[0] = WindowNew("List 1" , thewin , thebox);
	//win[1] = WindowNew("List 2");



	/* Add some items to the first list. */
/*
	if(win[0] != NULL)
	{
		GtkCList *clist = (GtkCList *)win[0]->clist;
		if(clist != NULL)
		{
			gint new_row;
			gchar *text[1];


			// Reset cells text array for adding a new row,
			// we'll set the actual text after the row has
			// been created.
			//
			text[0] = "";

			// Begin creating new rows. 

			new_row = gtk_clist_append(clist, text);
                        gtk_clist_set_pixtext(
                                clist, new_row, 0,
                                "Sphere", 2,
				sphere_pixmap, sphere_mask
                        );

                        new_row = gtk_clist_append(clist, text);
                        gtk_clist_set_pixtext(
                                clist, new_row, 0,
                                "Cube", 2,
                                cube_pixmap, cube_mask
                        );

                        new_row = gtk_clist_append(clist, text);
                        gtk_clist_set_pixtext(
                                clist, new_row, 0,
                                "Cone", 2,
                                cone_pixmap, cone_mask
                        );
		}
	}
*/

g_static_mutex_unlock (&mutex);

	return(win[0]->clist);
}

