Introduction

Version 0.4 (2000/01/30)

The jTkinter module is a complete java/JNI implementation of the builtin python modules _tkinter for use with the JPython-1.1 environment.

The jTkinterr allows the original lib-tk\*.py files from CPython, to run under JPython. The jTkinter module is not an attempt to implement Tkinter module functionality on top of the java platform, but is based on the tcl and tk libraries. jTkinter includes a compiled version of Tcl/Tk 8.2.2.

jTkinter have only been tested on Windows NT 4.0 (with MS Visual C++ 5.0). The sources can compile on Linux & GNU C++, but no testing have been performed. Feedback, bugs, patches and success stories are very welcome.

Download

Installation

jTkinter 0.3 can be installed on Windows NT without compiling any sources, but installation is quite a mess. Some problems with JPython (aka bugs), prevents jTkinter from working with JPython 1.1

Because of this, I have created an upgraded version of jpython.jar and selected files from Lib that will allow jTkinter to run. Do not install this upgrade on top of your normal JPython directory. Instead install JPython again in a different directory and upgrade this new installation. I feel confident that the extra step of upgrading JPython will go away very soon.

Installation of jTkinter itself is done by performing these steps:

Test:

  c:\jpython
  JPython 1.1+jTkinter on java1.2
  Copyright 1997-1999 Corporation for National Research Initiatives
  >>> import Tkinter
  >>> 

Compatibility

jTkinter are using version 8.2.2 of Tcl/Tk. Tkinter under CPython are using version 8.0.5 of Tcl/Tk. This version change have introduced some small differences:

Some application have been succesfully tried with jTkinter and JPython. If you discover a problem with any of these programs when running under JPython, please report the problem to me first. The authors of the fine programs below have never had a change to test with JPython and can most likely not help.

Compiling

Windows

Unix

Compilation have been tested (courtesy of shel11.sourceforge.net). No execution test have been performed. Do NOT engage in the exercise of compiling jTkinter unless you have experience with embedding/extending both Java and Tcl.

Documentation and links

Note

This is a very early release of the software, so don't be surprised if you discover some bugs.

jTkinter have only been tested on Windows NT. The sources have been compiled with gnu c++ on linux, but it have never been tested.

Contact

If you have questions or bug reports regarding this software, send them to: Finn Bock

Changes

ToDo

Copyright:

  * Copyright 1999 Finn Bock.
  * Permission to use, copy and distribute this software is hereby granted,
  * provided that the above copyright notice appear in all copies and that
  * both that copyright notice and this permission notice appear in supporting
  * documentation.
  *
  * No Warranty
  * The software is provided "as is" without warranty of any kind.

Additional Copyright (Python):

  Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam,
  The Netherlands.

                          All Rights Reserved

  Permission to use, copy, modify, and distribute this software and its
  documentation for any purpose and without fee is hereby granted,
  provided that the above copyright notice appear in all copies and that
  both that copyright notice and this permission notice appear in
  supporting documentation, and that the names of Stichting Mathematisch
  Centrum or CWI or Corporation for National Research Initiatives or
  CNRI not be used in advertising or publicity pertaining to
  distribution of the software without specific, written prior
  permission.

  While CWI is the initial source for this software, a modified version
  is made available by the Corporation for National Research Initiatives
  (CNRI) at the Internet address ftp://ftp.python.org.

  STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
  MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
  CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.

Additional Copyright (_tkinter):

  /***********************************************************
  Copyright (C) 1994 Steen Lumholt.
  Copyright 1994-1995 by Stichting Mathematisch Centrum, Amsterdam,
  The Netherlands.

                          All Rights Reserved

  Permission to use, copy, modify, and distribute this software and its
  documentation for any purpose and without fee is hereby granted,
  provided that the above copyright notice appear in all copies and that
  both that copyright notice and this permission notice appear in
  supporting documentation, and that the names of Stichting Mathematisch
  Centrum or CWI or Corporation for National Research Initiatives or
  CNRI not be used in advertising or publicity pertaining to
  distribution of the software without specific, written prior
  permission.

  While CWI is the initial source for this software, a modified version
  is made available by the Corporation for National Research Initiatives
  (CNRI) at the Internet address ftp://ftp.python.org.

  STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
  MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
  CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.

  ******************************************************************/

  /* _tkinter.c -- Interface to libtk.a and libtcl.a. */

  /* TCL/TK VERSION INFO:

     Unix:
          Tcl/Tk 8.0 (even alpha or beta) or 7.6/4.2 are recommended.
          Versions 7.5/4.1 are the earliest versions still supported.
          Versions 7.4/4.0 or Tk 3.x are no longer supported.

     Mac and Windows:
          Use Tcl 8.0 if available (even alpha or beta).
          The oldest usable version is 4.1p1/7.5p1.

     XXX Further speed-up ideas, involving Tcl 8.0 features:

     - In Tcl_Call(), create Tcl objects from the arguments, possibly using
     intelligent mappings between Python objects and Tcl objects (e.g. ints,
     floats and Tcl window pointers could be handled specially).

     - Register a new Tcl type, "Python callable", which can be called more
     efficiently and passed to Tcl_EvalObj() directly (if this is possible).

  */

Additional Copyright (TCL):

  This software is copyrighted by the Regents of the University of
  California, Sun Microsystems, Inc., Scriptics Corporation,
  and other parties.  The following terms apply to all files associated
  with the software unless explicitly disclaimed in individual files.

  The authors hereby grant permission to use, copy, modify, distribute,
  and license this software and its documentation for any purpose, provided
  that existing copyright notices are retained in all copies and that this
  notice is included verbatim in any distributions. No written agreement,
  license, or royalty fee is required for any of the authorized uses.
  Modifications to this software may be copyrighted by their authors
  and need not follow the licensing terms described here, provided that
  the new terms are clearly indicated on the first page of each file where
  they apply.

  IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
  FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
  DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
  POSSIBILITY OF SUCH DAMAGE.

  THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE
  IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
  NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
  MODIFICATIONS.

  GOVERNMENT USE: If you are acquiring this software on behalf of the
  U.S. government, the Government shall have only "Restricted Rights"
  in the software and related documentation as defined in the Federal
  Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2).  If you
  are acquiring the software on behalf of the Department of Defense, the
  software shall be classified as "Commercial Computer Software" and the
  Government shall have only "Restricted Rights" as defined in Clause
  252.227-7013 (c) (1) of DFARs.  Notwithstanding the foregoing, the
  authors grant the U.S. Government and others acting in its behalf
  permission to use and distribute the software in accordance with the
  terms specified in this license.