1function scimihm(%_xmlfile) 2 // Scicos initialization GUI (IHM d'initialisation) 3 // Masoud Najafi, Nov. 2007 4 5 global icpr 6 icpr=list(); 7 8 sciGUI_init() 9 if execstr("%_filename="+%_xmlfile,"errcatch")~=0 then 10 error(msprintf(_("%s: Wrong input argument.\n"), "scimihm")); 11 end 12 13 try 14 %_winId=TCL_GetVar("IHMLoc") 15 catch 16 %_winId="nothing"; 17 end 18 19 if (%_winId <> "nothing") then 20 running=TCL_EvalStr("winfo exists [sciGUIName "+%_winId+"]") 21 if running=="1" then 22 TCL_EvalStr("sciGUIDestroy "+%_winId); 23 end 24 end 25 26 TCL_EvalStr("set IHMLoc [MIHM_Init -1]"); 27 %_winId=TCL_GetVar("IHMLoc"); 28 29 //if evstr(%_winId)>1 then 30 // messagebox("winId="+%_winId+" is greater than 1, check your program"); 31 // return; 32 //end 33 34 35 TCL_SetVar("sciGUITable(win,"+%_winId+",data,Scixmlfile)",%_filename); 36 TCL_SetVar("sciGUITable(win,"+%_winId+",data,SCI_TMPDIR)",string(TMPDIR)); 37 TCL_SetVar("sciGUITable(win,"+%_winId+",data,IERROR)","?"); 38 39 //----- launching the GUI 40 TCL_EvalStr("MIHM_Create "+%_winId); 41 42 //----- simulating a click on the OpenXML Button 43 TCL_EvalStr("button_OpenXML "+%_winId); 44 45endfunction 46 47