Go Back   AC3D Forums > Technical > AC3D Developers
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Thread Tools Display Modes
Old 8th November 2013, 12:08 PM   #1
Senior Member
Professional user
Join Date: Nov 2007
Posts: 139
Default TCL Question in ac3d.tcl

In the file tcl/ac3d.tcl there is a proc function called "foldbuttontoggle." At the apparent bottom of this proc there appears to be an umatched quote and some strange curly bracketing. Is this the way its supposed to be structured? TCL seems to accept it, but its breaking the syntax highlighting in notepad++

proc foldbuttontoggle { name } {


	$foldcanvas configure -scrollregion " 0 0 100 $height }
	if { [ catch { set canvas $ac3d_version_revision } ] != 0 } {
	return 1
jentron is offline   Reply With Quote
Old 14th November 2013, 07:10 AM   #2
Junior Member
Geoffm's Avatar
Join Date: Aug 2013
Location: London UK
Posts: 22
Default Re: TCL Question in ac3d.tcl

There is no syntax error; but here may be a logic error in the Tcl. The "proc foldbuttontoggle" ends at the } after $foldcanvas...$height (this bracket matches the one at the "proc foldbuttontoggle" line). The if { [catch...will be performed when the tcl is loaded (at start time) and if the "set canvas $ac3d_version_revision" is an error - perhaps variable ac3d_version_revision does not exist or has not been set - then the procs following this line will not be created (positiontext, foldbutton etc).

I suggest using the Komodo Editor (free) which is much more Tcl friendly and correctly colours this syntax. However the indentation of the code suggests that the proc foldbuttontoggle is intended to end after the if...catch. Perhaps Andy can comment? I don't think I have ever used this function, which is called from "foldbutton" which is called by "proc folditem" which is never referred to in the Tcl scripts.
Geoffm is offline   Reply With Quote
Old 14th November 2013, 05:04 PM   #3
Professional user
Andy's Avatar
Join Date: Jun 2003
Posts: 4,565
Default Re: TCL Question in ac3d.tcl

This could be a programming error - too many }s!

I think this bit of code was aiming to allow more of the control panel sections to be packed into the side of AC3D, and enabling sections to be opened and closed down.

It's not used at the moment - perhaps a failed experiment, of which I'm sure there's more examples in there somewhere.

Feel free to experiment with this stuff and if you make anything that others might find useful, let us know.
Andy is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 11:59 AM.

AC3D Forum
(C) Inivis Limited 2020