SharedSourceCLI.TK.TclInterp.Eval C# (CSharp) Метод

Eval() публичный Метод

public Eval ( string str ) : void
str string
Результат void
        public void Eval(string str) {
            unsafe {
                HandleError(TclNative.Tcl_Eval(_interp, str));
            }
        }

Usage Example

Пример #1
0
        void cmdOpen(TclInterp interp, string[]argv)
        {
            //Create a file open box.
            interp.Eval("set types { {\"Text files\" {.txt .doc}} {\"All files\" {*}} }");
            interp.Eval("set file [tk_getOpenFile -filetypes $types]");
            
            string filename = interp.GetVar("file");
            
            if(filename != "")
            {
                cur_filename = filename;
                //Clear the text box.
                interp.Eval(".text delete 1.0 end");

                //Open the file and dump it's contents into our text box.
                TextReader file = File.OpenText(filename);
                string command;
                command = ".text insert end {";
                command += file.ReadToEnd();
                command +="}";

                interp.Eval(command);
                file.Close();

                //Update titlebar to reflect filename changes.
                command = "wm title . \"C# Notepad Using TCL - ";
                command += filename;
                command += "\"";
                interp.Eval(command);
            }
        }
All Usage Examples Of SharedSourceCLI.TK.TclInterp::Eval