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.
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:
c:\jpython JPython 1.1+jTkinter on java1.2 Copyright 1997-1999 Corporation for National Research Initiatives >>> import Tkinter >>>
PySol is installed for JPython by installing the binary version (to get the cardset
and other data files) and then extract the source distribution into the same
directory. Start PySol with jpython ...\PySol-3.30\src\pysol.py
. Expect an
initial startup time at 10-20 seconds due to compilation of python sources.
re
module instead. Greg McFarlane have hinted
that the next version of PMW will be using re
.
A part implementation of the imp module is required when using IDLE and is included with jTkinter. Luckily IDLE only uses parts of imp which can be implemented under JPython.
The builtin code module must be disabled, and the code.py from CPython 1.5.2
(included in jTkinter) must be copied to ...\Lib.
The builtin code module can be disabled by adding code:null
to
python.modules.builtin:
python.modules.builtin = code:null
jTkinter have only been tested on Windows NT. The sources have been compiled with gnu c++ on linux, but it have never been tested.
* 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.
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.
/*********************************************************** 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). */
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.