SharedSourceCLI.TK.TclInterp.TclInit C# (CSharp) Method

TclInit() public method

public TclInit ( ) : void
return void
        public void TclInit() {
            unsafe {
                HandleError(TclNative.Tcl_Init(_interp));
            }
        }
        

Usage Example

        void InitProc(TclInterp interp)
        {

            /*
             * Initialize TCL - basically this function runs the init.tcl file which 
             * should be in your path environment variable.
             */
            interp.TclInit();
    
            /*
             * Initialize the TK libs - basically loads all of the .tcl files that define
             * the widgets - these should be in the tcl\lib path (which should also be in
             * your path environment variable).
             */
            interp.TkInit();

            /*
             * Evaluate a script - this creates a button, called .b with a label "Hello, World!".
             * When the button is pressed it writes "Hello, world" to the console.
             */
            
            //Create the main window.
            interp.Eval("button .b -text {Hello, World!} -command {doIt}; pack .b");
            interp.CreateCommand("doIt", new TclCmdProc(doItProc));
        }
All Usage Examples Of SharedSourceCLI.TK.TclInterp::TclInit