Use tkinter in OO (python)

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
DSM
Posts: 8
Joined: Wed May 26, 2010 6:56 pm

Use tkinter in OO (python)

Post by DSM »

Well, I know I can use dialog boxes, from the OO like:

http://wiki.services.openoffice.org/wik ... go_simples

http://user.services.openoffice.org/en/ ... 5&p=140818

http://user.services.openoffice.org/en/ ... 010#p12010

But, first, I´m trying to use Tkinter. ¿why? because I have some code that use it...
When I run the scripts outside of OO, I can use the Tkinter lib without problem.
Now, I wat to use Tkinter inside of OO with an Extension.
I see the lib-tk directory with Tkinter.py in the python installation of OO.

From python shell of OO, I try to import:
>>> import Tkinter
and the result is :
ImportError: No module named _tkinter

Searching in the Tkinter pythonInfo Wiki, http://wiki.python.org/moin/TkInter I found:
•If it fails with "No module named _tkinter", your Python configuration needs to be modified to include this module (which is an extension module implemented in C). Do **not** edit Modules/Setup (it is out of date). You may have to install Tcl and Tk (when using RPM, install the -devel RPMs as well) and/or edit the setup.py script to point to the right locations where Tcl/Tk is installed. If you install Tcl/Tk in the default locations, simply rerunning "make" should build the _tkinter extension.
I foud this old post, where talk about http://www.oooforum.org/forum/viewtopic ... ht=tkinter, but no solution

So, Is possible install TLC and use tkinter inside of OO? or, shoud I forget about it?

Thank you in advance.
OpenOffice 3.2 on Windows 7
hanya
Volunteer
Posts: 885
Joined: Fri Nov 23, 2007 9:27 am
Location: Japan

Re: Use tkinter in OO (python)

Post by hanya »

Tkinter is not supported by the bundled python and it is issued:
http://qa.openoffice.org/issues/show_bug.cgi?id=30349
Please, edit this thread's initial post and add "[Solved]" to the subject line if your problem has been solved.
Apache OpenOffice 4-dev on Xubuntu 14.04
Post Reply