From: nishi Date: Sat, 27 Apr 2024 02:31:47 +0000 (+0000) Subject: set keyword X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=b62b709d2d83a9c07543f704e3ffc049213a1fbc;p=serenade.git set keyword git-svn-id: file:///raid/svn-main/nishi-serenade/trunk@70 0f02c867-ac3d-714e-8a88-971ba1f6efcf --- diff --git a/Examples/main.tcl b/Examples/main.tcl new file mode 100644 index 0000000..3d69c7f --- /dev/null +++ b/Examples/main.tcl @@ -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 index 0000000..e101e6b --- /dev/null +++ b/Examples/tcl.srn @@ -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)