It is currently Fri Apr 26, 2024 5:03 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Tkinter is implented in 2.8.18 but Tcl not
PostPosted: Tue Nov 08, 2016 4:09 am  (#1) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
GIMP Version: 2.8.14
Operating System: Windows
GIMP Experience: Intermediate Level



Hello,
learning about other UI's I kame across Tkinter in Gimp.
But examples using Tkinter need Tcl, which is not implemented dircectly by installing Gimp.

One gets errors like this:
TclError: Can't find a usable init.tcl in the following directories:
{C:/Program Files/GIMP 2/Python/lib/tcl8.5} {C:/Program Files/GIMP 2/lib/tcl8.5} {C:/Program Files/lib/tcl8.5} {C:/Program Files/GIMP 2/library} {C:/Program Files/library} {C:/Program Files/tcl8.5.15/library} C:/tcl8.5.15/library

I have a working wish (etc.) from ActiveState at d:/tcl8641 ...
How to "persuade" Gimp to use Tcl from there (or its subdirectories).

Or do you have an Tkinter example (without Tcl) working for me?
Link(s) or source?

Help is very much appreciated ;)

Peter


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Tkinter is implented in 2.8.18 but Tcl not
PostPosted: Tue Nov 08, 2016 7:03 am  (#2) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
I can get slightly further forward that you have, by setting the TCL_LIBRARY environment variable to point to the directory containing init.tcl:

From the Python-Fu console:
>>> from gimpfu import *
>>> import Tkinter, tkFileDialog
>>> import os, sys
>>>
>>> os.environ["TCL_LIBRARY"]="C:/Tcl/lib/tcl8.5"
>>> root = Tkinter.Tk()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Program Files\GIMP-2.8.14\Python\lib\lib-tk\Tkinter.py", line 1814, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
TclError: Can't find a usable init.tcl in the following directories:
    C:/Tcl/lib/tcl8.5 {C:/Program Files/GIMP-2.8.14/Python/lib/tcl8.5} {C:/Program Files/GIMP-2.8.14/lib/tcl8.5} {C:/Program Files/lib/tcl8.5} {C:/Program Files/GIMP-2.8.14/library} {C:/Program Files/library} {C:/Program Files/tcl8.5.15/library} C:/tcl8.5.15/library

C:/Tcl/lib/tcl8.5/init.tcl: version conflict for package "Tcl": have 8.5.15, need exactly 8.5.13
version conflict for package "Tcl": have 8.5.15, need exactly 8.5.13
    while executing
"package require -exact Tcl 8.5.13"
    (file "C:/Tcl/lib/tcl8.5/init.tcl" line 18)
    invoked from within
"source C:/Tcl/lib/tcl8.5/init.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list source $tclfile]"


This probably means that Tcl wasn't installed properly.


But there is now a version mis-match as the version of Tcl/Tk with GIMP 2.8.18 appears to be 8.5.15 and I have a stand-alone TclTk 8.5.13

You would probably do better asking the developers why the Windows installer doesn't include a complete Tkinter environment, although Tkinter doesn't offer much that is different to PyGTK (other than using the native file open/close dialog)

Kevin


Top
 Post subject: Re: Tkinter is implented in 2.8.18 but Tcl not
PostPosted: Tue Nov 08, 2016 7:15 am  (#3) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4739
TkInter is somewhat easier to use than PyGTK or PyQT, but also somewhat more limited (for instance, there is no asynchronous execution).

_________________
Image


Top
 Post subject: Re: Tkinter is implented in 2.8.18 but Tcl not
PostPosted: Tue Nov 08, 2016 8:40 am  (#4) 
Offline
GimpChat Member

Joined: Sep 13, 2016
Posts: 137
Txs both
my TCL does not work either

os.environ["TCL_LIBRARY"]="d:/tcl8641/lib/tcl8.6" #not good
os.environ["TCL_LIBRARY"]="d:\\tcl8641\\lib\\teapot\\package\\tcl\\lib\\BWidget1.9.81" #not good
the directories containing init.tcl


Top
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group