[incr Tcl]



Itk - Megawidget framework based on incr Tcl iwidgets - A megawidget set based on incr Tcl and incr Tk signal - Unix/POSIX Signal handling for Tcl; tclogl - OpenGL bindings; tclx - Extended Tcl; togl - A Tk widget for OpenGL rendering; vu - Extra valuator widgets. Deeply experimental. Colibri - Cloverfield project. Stack Overflow The World’s Largest Online Community for Developers. The incr command expects an integer variable and by default increments the variable by one. Free electric motor design software. However, it is possible to override this behavior and increment by other values or even decrement the variable by passing a third parameter such as incr x -2 which decrements x by 2. incr Tcl provides a set of object-oriented extensions for the Tcl language, enabling programmers to write high-level building blocks that are more easily assembled into a finished application. This course describes object-oriented programming with incr Tcl. incr Tcl was designed this way, to blend naturally into a Tcl/Tk application. But incr Tcl extends the Tk paradigm from being merely object-based to being fully object-oriented. An object-oriented system supports inheritance, allowing classes to share common behaviors by inheriting them from an ancestor or base class.

[incr Tcl] is an OO system for Tcl. The name is a play on C++, and [incr Tcl] provides a similar object model, including multiple inheritance, and public and private classes and variables. The name is often written as “itcl” as that contains no metacharacters (i.e., space or brackets).

See Also edit

Tcl++
A pure Tcl implementation of incr Tcl
wigwam
dresses up Tk widgets as incr Tcl classes

Documentation edit

official reference
incr Tk/itk and incr Widgets/iwidgets
Incr Tcl Design Patterns
BOOK Tcl/Tk Tools
contains an out of date tutorial for itcl
BOOK incr Tcl from the Ground Up

Download edit

[incr Tcl] is a component of some batteries included Tcl distributions, such as Tcl Dev Kit, ActiveTcl, Tclkit and dqkit.

JTcl/Jacl Port edit

[incr Tcl] was ported to the JTcl Interpreter and Jacl by Mo DeJong, and is included in those intepreters.

Widget Sets

[incr Tcl] is also the foundation of [incr Tk] and the Iwidgets megawidgets. The home page is http://incrtcl.sourceforge.net/itcl/, and source code is available at http://sourceforge.net/projects/incrtcl

Script level commands in the itcl extension edit

Why use itcl? edit

Marty Backe posted an apt testimonial to comp.lang.tcl: 'I've been using Iwidgets for awhile now, and recently completed a project that was fully implemented in itcl (including Iwidgets). I'm converted. Once you write a program based on objects, you might be hard pressed to go back to the straight tcl way. It becomes VERY easy to write clear, concise code. Of course you can do the same with namespaces (that's what I've been doing), but it takes a lot more work, and the result isn't as satisfying (IMHO).My current approach is to have one file that contains the main application, which primarily creates objects via class files sourced from a class/ directory. Each object is defined in one class file. This facilitates testing of the objects prior to integration into the application.

Add on classes for incr tcl

  • [incr Tcl class info wrapper]
  • [incr Tcl general library]
  • [incr Tcl Modifications/Enhancements]
  • [itclpython]
  • [Jultaf]/[Jumble]
  • [SampleItclExtension]
  • [transportable objects]

Debugging edit

See Itcl trace.

History edit

Between 1995 and 2008 there were over a dozen OO extensions for Tcl: [incr Tcl] eventually won as the community recognised that the consolidating OO systems would permit the community to focus energies and gain strength.From Tcl 8.5 itcl was revamped in an initiative called itcl-ng using the tclOO mechanisms; this formed the basis for the version of itcl that is integrated with Tcl 8.6. This is detail as it maintains the same itcl programmer interface.LV: In Dec, 2008, on comp.lang.tcl, it was announced that TIP #50 [1] had finally been realized, with itcl 4.0 being merged into the Tcl 8.6 source tree.apw 2008-12-20: for a feature list of itcl 4.0 (called also itcl-ng) see: [2]. There are a lot of new features like delegation, components, types, widgetadaptors, widgets etc.FPX 2008-03-06: Yes. [incr Tcl] is very stable and robust, and it is still actively maintained to work with the latest versions of Tcl. Its Web presence may not always be up to date, but the code base in CVS is.FPX 2008-03-06: [incr Tcl] 3.4 is required with Tcl 8.5 and later.more about history here, if you please.LV: Actually, itcl-ng (aka incr tcl 4.0) is required with Tcl 8.5 and later.

Caveats to this page edit

This page deliberately simplifies the status of itcl, the fact that it was separate to tcl, and how it won over the other object systems.

Bugs edit

AMG, 2014 April 08: [incr Tcl] dies with SIGSEGV in at least one case where a private method is invoked [3].
Category Object OrientationCategory PackageCategory Itcl
University of California, Berkeley
EECS Dept, CS Division
Jordan Smith SLIDE: Scene Language for
Interactive Dynamic Environments
Prof. Carlo H. Séquin
HomeGoalsPublicationsPeopleGalleryAssignmentsDistributions
wish program or into the command prompt ofthe slide rendering program.

Command Delimiters

Tcl incr decr

Tcl is line interpreter, so the 'n' at the end of a line is thenormal command delimiter. You can put multiple commands on the sameline if you place a ';' in between them. You can havecommands which span multiple lines two different ways. First, you canopen a '{' block and not terminate it before the 'n'.Second, you can escape the 'n' by placing a '' as thelast character on a line. The Tcl interpreter will then consider thenext line as a continuation of the current line.

Comments

The # as the first character of a command willcomment it out.

Control Flow

With all control flow constructs, it is important to open the{ on the same line, so that Tcl knows that the command isnot complete when in encounters the }.

if

Tcl

switch

while

for

Subexpression Evaluation

[ ] will evaluate a command in place and become thereturned value of that command.

expr is one very useful command to use in this way. Another useful command is subst which will substitute all $ and [] expressions.

Lists

The list data structure is used by SLIDE's Tcl interface to theSLIDE parser. The slide instance command can take a list oftransforms where each transform is a list of parameters:

An equivalent way of writing this in Tcl is the following:

Tcl Incr Command

[incr

The difference between { } and [list ] iswhen the terms within them get evaluated. The following exampleillustrates the difference:

Associative Arrays

An associative array is a useful data structure for simulating Cstyle arrays, two dimensional arrays, structures, and classes. Anassociative array is really a hashtable where the hash keys areabitrary strings. One convenient property of associative arrays isthat you can get access to all of its fields by declaring that justthe base name is available within a scope.

Procedures

Ati 9550 driver download. Tcl procedures can be created using the proc command. These areuseful for creating call back functions for different widgets.

Interfacing C++ and Tcl

Tcl has mechanisms for interfacing with C code, but their supportfor C++ objects is not as nice. I have developed a C++ class whichmakes it easier to create C++ classes which can be accessed from Tcl.I modeled the Tcl interface after [Incr Tcl]. [Incr Tcl] is an objectoriented extension to Tcl which makes it possible to program Tcl in anobject oriented way, but does not extend the Tcl interface to C toinclude C++.

My Tcl to C++ interface is called ItclCxx because it gives an[Incr Tcl] look and feel to C++ objects. To use this interface, youcreate a C++ class which is subclassed from ItclCxx. You mustimplement 3 static functions on the class which define the interfaceto Tcl. Then it is possible to create, manipulate, and delete C++objects from Tcl.

A Bezier class example

In the source file below we only show the functions which arespecial to the ItclCxx interface. Ati radeon 2100 graphics driver update.

A testing session in Tcl



This page was originally built by Jordan Smith.

Tcl Incr Array

Incr

Last modified: Sunday, 24-Nov-2002 23:15:05 PST