Wiki pages with [Critcl] examples (incomplete list): * [Accessing C library functions using Critcl] * [Critcl example with the Mancala game] * [Critcl NAG] * [fast alpha blending (transparency)] (involves [Tk]) * [loadf] * [odyce] (actually a "competitor" providing Critcl emulation) * [PAM] * [Passing arrays of data] * [photo image equality in Critcl] (involves [Tk]) * [Standalone bgexec] (rather long) * [tclAppleHelp] * [tclAuthorization] * [tclCarbonHICommand] * [tclCarbonNotification] (very structured -- worth a look as a template for your own packages) * [tclCarbonProcesses] * [userid] ---- [LV]: Has anyone investigated making use of Critcl to create an HTML rendering widget, perhaps based on [BrowseX]? [JCW]: Yep, Tkhtml can be built with Critcl, though it's tricky. See [http://www.equi4.com/critlib/rhtml.README], now in critlib. ---- Has someone looked at http://root.cern.ch/root/Cint.html as a possible way to integrate C with Tcl without having to compile C... [SWT]: I have built a working cint shared lib for tcl. It works great! Now to "run" c code the cint library is only needed for each platform that support is required for. ---- [Brian Theado] 17Dec2004 - Examples with Tcl_Obj* return type The presence of Tcl_IncrRefCount is crucial here and nothing gets returned without it. I guess Critcl automatically decrements the reference count on this return type. Could someone provide a counter example where the automatic reference count decrement is useful? package require critcl critcl::cproc abc {} Tcl_Obj* { char test[4] = "abc"; Tcl_Obj * rv = Tcl_NewStringObj ("abc", 3); Tcl_IncrRefCount (rv); return rv; } critcl::cproc 123 {} Tcl_Obj* { char test[3] = {1, 2, 3}; Tcl_Obj * obj = Tcl_NewByteArrayObj (test, 3); Tcl_IncrRefCount (obj); return obj; } puts [abc] binary scan [123] H* result puts $result Output: abc 010203 ---- ''2005-09-02 [Sarnold]'' See also [Critcl example with the Mancala game] and [foriter - a loop command]. ---- ''2006-11-21 [dzach]'' Could someone post a basic critcl snipet on how to access the [snack] sound library? Play a sound or record a sound, for instance? ---- [[ [Category Critcl] | [Category Example] ]]