ITcl ??? - długie....
Wojciech "Sas" Cieciwa
cieciwa w alpha.zarz.agh.edu.pl
Pią, 9 Paź 1998, 10:28:24 CEST
Drobne pytanko:
znalazłem coś takiego u siebie w jakimś archiwum i zastanawiam się, czy
brać się za to ???
========================================================================
------------------------------------------------------------------------
[incr Tcl] - version 2.2
------------------------------------------------------------------------
This version includes tcl7.6 / tk4.2 upgraded to support
namespaces, along with [incr Tk] and [incr Widgets].
Binary distributions for Windows95 and Macintosh platforms
are available on our web site:
http://www.tcltk.com/itcl/
Many different people have contributed code for this release,
and I thank them for their contributions. Please read the
acknowledgements section below.
Send comments or suggestions to the [incr Tcl] mailing list
(itcl w tcltk.com) or directly to me (mmclennan w lucent.com).
If you want to subscribe to the mailing list, send a message
with the subject "subscribe" to "itcl-request w tcltk.com".
========================================================================
OVERVIEW
------------------------------------------------------------------------
- What is [incr Tcl]?
- Getting started
- Installation
- Integrating [incr Tcl] with other extensions
- Acknowledgements
------------------------------------------------------------------------
What is [incr Tcl]?
------------------------------------------------------------------------
[incr Tcl] is an object-oriented extension of the Tcl language. It
was created to support more structured programming in Tcl. Tcl scripts
that grow beyond a few thousand lines become extremely difficult to
maintain. This is because the building blocks of vanilla Tcl are
procedures and global variables, and all of these building blocks
must reside in a single global namespace. There is no support for
protection or encapsulation.
[incr Tcl] introduces the notion of objects. Each object is a bag
of data with a set of procedures or "methods" that are used to
manipulate it. Objects are organized into "classes" with identical
characteristics, and classes can inherit functionality from one
another. This object-oriented paradigm adds another level of
organization on top of the basic variable/procedure elements, and
the resulting code is easier to understand and maintain.
Among other things, [incr Tcl] can be used to create new widgets that
look and work like the usual Tk widgets, but are written entirely at
the Tcl language level (C code is optional). These "mega-widgets"
can be created using [incr Tk], a set of base classes which provide
the core mega-widget functionality. [incr Widgets] is a set of
high-level mega-widgets built using [incr Tk]. It has more than
35 widget classes, and can be used right out of the box to create:
- fileselectiondialog
- tabnotebook
- panedwindow
- scrolledhtml
- combobox
- optionmenu
- scrolledlistbox
- scrolledframe
- messagedialog
- and many others...
Classes and/or related procedures can also be encapsulated in their
own "namespace". A namespace is a collection of commands, variables,
classes and other namespaces that is set apart from the usual global
scope. Elements within a namespace can be "private" or "protected",
so that access to them is restricted. An "import" command allows all
of the elements from one namespace to be integrated into another.
Extension writers will immediately see the benefit of namespaces.
With vanilla Tcl, each extension must add its commands and variables
at the global scope. Extension writers are encouraged to add a unique
prefix to all of the names in their package, to avoid naming collisions.
Extensions can now sit in their own namespace of commands and variables,
and sensitive elements can be protected from accidental access. For
example, the current release of [incr Tcl] has a namespace "itcl"
for object-oriented support, a namespace "itk" for mega-widget
support, and a namespace "iwidgets" for the [incr Widgets] package.
Each of these namespaces has its own collection of commands and
variables. Developers can then pick and choose among the extensions,
and integrate the parts that they need for their application by
importing various namespaces at the global scope.
[...]
6) Use the final product. This distribution creates and installs
four executables:
ish7.6 ........... [incr Tcl] sh (tclsh + namespaces)
iwish4.2 ......... [incr Tcl] wish (wish + namespaces)
itclsh2.2 ........ tclsh + namespaces + classes
itkwish2.2 ....... wish + namespaces + classes + megawidgets
If you configured this distribution with "--enabled-shared" to
request dynamic loading, you can use "ish" or "iwish" as the
core program and load everything else as needed. For example,
you can start up "iwish" and load the [incr Widgets] package
like this:
[...]
Integrating [incr Tcl] with other extensions
------------------------------------------------------------------------
[incr Tcl] now requires its own version of Tcl/Tk with support for
namespaces. Therefore, you must use the version of Tcl/Tk that
comes in this distribution as a basis for other applications.
Hopefully, the namespace support will become a part of the standard
distribution some day.
You can add other extensions into the [incr Tcl] package by
following the usual instructions for Tcl/Tk:
1) Put the source code for the extension in the directory
"itcl2.2", at the same level as the directories "tcl7.6"
and "tk4.2".
2) Copy "tclAppInit.c" or "tkAppInit.c" from the standard
distribution. Choose the appropriate version according to
your needs:
tcl7.6/tclAppInit.c .... Tcl with namespaces
tk4.2/tkAppInit.c ...... Tcl/Tk with namespaces
itcl/tclAppInit.c ...... Tcl with namespaces and [incr Tcl]
itk/tkAppInit.c ........ Tcl/Tk with namespaces and [incr Tcl]/[incr Tk]
[...]
4) Link your application with the appropriate libraries.
For example, with non-shared libraries, you would link
against:
libtcl7.6i.a ............ Tcl with namespaces
libtk4.2i.a ............. Tk with namespaces
libitcl2.2.a ............ [incr Tcl]
libitk2.2.a ............. [incr Tk]
and on Unix systems, you will also need:
-lX11 ................... X11 library
=============================================================================
UNIX System Administrator, POLAND
_/_/_/_/ _/_/_/_/ _/_/_/_/ Wojciech 'Sas' Cieciwa
_/ _/ _/ _/
_/_/_/_/ _/_/_/_/ _/_/_/_/ cieciwa w alpha.zarz.agh.edu.pl
_/ _/ _/ _/ sas w uci.agh.edu.pl
_/_/_/_/ _/ _/ _/_/_/_/
http://alpha.zarz.agh.edu.pl/~cieciwa
Więcej informacji o liście dyskusyjnej pld-devel-pl