]> Nishi Git Mirror - serenade.git/commitdiff
set keyword
authornishi <nishi@0f02c867-ac3d-714e-8a88-971ba1f6efcf>
Sat, 27 Apr 2024 02:31:47 +0000 (02:31 +0000)
committernishi <nishi@0f02c867-ac3d-714e-8a88-971ba1f6efcf>
Sat, 27 Apr 2024 02:31:47 +0000 (02:31 +0000)
git-svn-id: file:///raid/svn-main/nishi-serenade/trunk@70 0f02c867-ac3d-714e-8a88-971ba1f6efcf

Examples/main.tcl [new file with mode: 0644]
Examples/tcl.srn [new file with mode: 0644]

diff --git a/Examples/main.tcl b/Examples/main.tcl
new file mode 100644 (file)
index 0000000..3d69c7f
--- /dev/null
@@ -0,0 +1,3 @@
+# $Id$
+button .b1 -text "Serenade $serenade_version"
+pack .b1 -fill both -expand true
diff --git a/Examples/tcl.srn b/Examples/tcl.srn
new file mode 100644 (file)
index 0000000..e101e6b
--- /dev/null
@@ -0,0 +1,19 @@
+; vim: syntax=lisp
+; $Id$
+(define-variable "tcl" (ffi-load "libtcl.so"))
+(define-variable "tk" (ffi-load "libtk.so"))
+(define-variable "Tcl_CreateInterp" (ffi-function (ffi-symbol tcl "Tcl_CreateInterp") "pointer"))
+(define-variable "Tcl_Init" (ffi-function (ffi-symbol tcl "Tcl_Init") "void" "pointer"))
+(define-variable "Tk_Init" (ffi-function (ffi-symbol tk "Tk_Init") "void" "pointer"))
+(define-variable "Tk_MainLoop" (ffi-function (ffi-symbol tk "Tk_MainLoop") "void"))
+(define-variable "Tcl_FindExecutable" (ffi-function (ffi-symbol tcl "Tcl_FindExecutable") "void" "string"))
+(define-variable "Tcl_EvalFile" (ffi-function (ffi-symbol tcl "Tcl_EvalFile") "void" "pointer" "string"))
+(define-variable "Tcl_SetVar" (ffi-function (ffi-symbol tcl "Tcl_SetVar") "void" "pointer" "string" "string" "integer"))
+
+(Tcl_FindExecutable "serenade")
+(define-variable "interp" (Tcl_CreateInterp))
+(Tcl_Init interp)
+(Tk_Init interp)
+(Tcl_SetVar interp "serenade_version" (serenade-version) 0)
+(Tcl_EvalFile interp "main.tcl")
+(Tk_MainLoop)