zoukankan      html  css  js  c++  java
  • TickleSharp

    TickleSharp

    From the TickleSharp project page, Scott Adams said that: TickSharp is a portable binding to the Tcl/Tk scripting language for the .NET platform. The assembly consists of two files, one is a small C wrapper library that allows for Callbacks into your .NET code, and the other is the assembly itself written in C#. The C# code uses P/Invoke to get at the wrapper and Tcl/Tk DLL's.

    TickleSharp 已在 MS.NET, Mono, DotGNU 這些平台通過測試,要開發 TickleSharp App,只要把 TickleSharp.dll, tclwrapper.dll (libtclwrapper.so for Linux) 放在 bin 資料夾即可。另外,你還要裝個 Tcl/Tk 環境才能執行程式,例如 ActiveTcl

    底下提供幾個 Embed Tcl/Tk into dotNet Application 的範例 (TickleSharpSamples Download):

    HelloTcl

    A HelloTcl Program:

    using System;
    using TickleSharp;
    
    namespace TickleSharpExamples
    {    
        public class HelloTcl
        {
            static Tcl tcl;
            
            [STAThread]
            static void Main()
            {
                tcl = new Tcl();
                tcl.Eval("expr 5 * 6");
                
                Console.WriteLine("expr 5 * 6 = " + tcl.Result);
            }
        }
    }

    HelloTk

    A Hello Tk Program (GUI frontend):

    using System;
    using TickleSharp;
    
    namespace TickleSharpExamples
    {
        
        public class HelloTk
        {
            static Tk tk;
            
            [STAThread]
            static void Main()
            {
                // Create a tcl interpreter with Tk initialized
                tk = new Tk();
                
                // Create the GUI
                tk.Eval("wm title . {Hello Tk}");
                tk.Eval("button .b -text {Say Hello} -command {sayHello} -padx 20");
                tk.Eval("pack .b");
                tk.Eval("proc sayHello {} {tk_messageBox -message {Hello Tk} }");
                
                // Enter Tk_MainLoop
                tk.Run();
            }
        }
    }
    
  • 相关阅读:
    Python 列表字典制作名册管理
    AS3获取SWF文件中AS链接
    AS3多选多模型
    AS3视频播放器
    测试
    Makefile三个有用变量$@,$^,$<
    CentOS 7.2 安装教程
    Ubuntu 查看/修改文件编码
    API 进程、线程函数
    API 菜单函数
  • 原文地址:https://www.cnblogs.com/greencolor/p/2065141.html
Copyright © 2011-2022 走看看