/* drawingArea.c */

#include "gnocl.h"
#include <string.h>
#include <assert.h>

static GnoclOption buttonOptions[] =
{
	{ "-switch1", GNOCL_OBJ, NULL },        /* 0 */
	{ "-switch2", GNOCL_OBJ, NULL },        /* 1 */
};


static int configure( Tcl_Interp *interp, GtkWidget *button, GnoclOption options[] )
{

	return TCL_OK;
}

static int cget( Tcl_Interp *interp, GtkButton *button, GnoclOption options[], int idx )
{
	return TCL_OK;
}


/* configure/hand widget commands */
static int widgetFunc( ClientData data, Tcl_Interp *interp, int objc, Tcl_Obj * const objv[] )
{
	return TCL_OK;
}


int gnoclWidgetNameCmd( ClientData data, Tcl_Interp *interp, int objc, Tcl_Obj * const objv[] )
{
	int       ret;
	GtkWidget *button;

	/* create and show the wudget */
	button = gtk_file_chooser_button_new("Choose a folder", GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER );
	gtk_widget_show( GTK_WIDGET( button ) );




	/* intitalise options, and clear memory when done, return error initialisation fails */
	ret = gnoclSetOptions( interp, buttonOptions, G_OBJECT( button ), -1 );
	if( ret == TCL_OK ) {
		ret = configure( interp, button, buttonOptions );
		}
	gnoclClearOptions( buttonOptions );

	if( ret != TCL_OK ) {
		gtk_widget_destroy( GTK_WIDGET( button ) );
		return TCL_ERROR;
		}

	/* register the new widget for use with the Tcl interpretor */
	return gnoclRegisterWidget( interp, GTK_WIDGET( button ), buttonFunc );
}

