Hi all , I know i am asking a silly question , please help me a bit , fun<-function() <<<-----------------------I have this function , dont know what to return here. { ------------------------JUST GIVING HERE THE MAIN WINDOW , AVOIDING GIVING THE WHOLE FUNCTION HANDLERS------------------- library(scales) library(cluster) library(plyr) library(sqldf) library(gWidgets2) library(gWidgetsRGtk2) library(e1071) library(RGtk2) options(guiToolkit="RGtk2") #main GUI code win=gwindow("BIG CLUST ") img <- gdkPixbufNewFromFile("E:/clusterring/str.1.png") getToolkitWidget(win)$setIcon(img$retval) paned<-gpanedgroup(cont=win) group<- ggroup ( cont = paned , horizontal = FALSE ) library(RGtk2); getBlock(win)$modifyBg(GtkStateType["normal"], "skyblue") tbl=glayout(cont=group) size(tbl)<-c(600,450) tbl[2,1] = gfilebrowse (text = "Select file...", type = "open", quote FALSE, filter = list("Text File" = list(patterns c("*.csv"))), container = tbl) tbl[14,1]= gbutton("CLEAR",cont=tbl,handler=function(h,...) clear_data()) tbl[14,2]<-H<-gbutton("HELP",cont=tbl,handler=function(h,...) help()) tbl[11,1]<-EDATA<<-gbutton("DATA EDIT",cont=tbl) tbl[6,1]= glabel("CHOOSE YOUR CLUSTER TYPE :-") tbl[23,1]= glabel("STATUS",cont=tbl) tbl[2,2]<-SHOW<<- gbutton("SHOW DATA",cont=tbl) tbl[1,2]=img <- gimage("E:/clusterring/pr.1.png") tbl[9,1]<-b<<-gcombobox(c("CLARA","CMEANS","KMEANS","PAM","SOM"), selected = NULL, editable = TRUE, coerce.with=NULL, handler = NULL, action = NULL, container = tbl, toolkit = guiToolkit()) tbl[13,1]<-Rbutton<<- gbutton("GET CLUSTER RESULT",cont=tbl) frame <- gframe ( "RESULT:" , cont = paned , horizontal = TRUE) size(frame)<-c(400,400) } Now this is stupid , I had called the function like :- fun() <<<<--------------------But it is not executing ,just i m getting the window ,nothing else , so any one who can help me to declare this GUI as an function . Actually , i want to make it as an package and run like "THE RATTLE" , so anybody have any idea please help me , Thank You in advance . [[alternative HTML version deleted]]