Tk/Tcl interface module 
Author Message
 Tk/Tcl interface module

I tried out S{*filter*} Lumholt's Tk interface for python a little bit -- it
looks wonderful!  I've made it available for anon ftp on ftp.cwi.nl in
pub/python as tkinter.tar.gz.  Building is very easy, if you have
installed Tk/Tcl and Python in /usr/local (for Python you also need to
do "make inclinstall libainstall").

Good work, S{*filter*}!


URL:  < http://www.*-*-*.com/ ;



Sun, 17 Nov 1996 17:25:02 GMT  
 Tk/Tcl interface module

My Python interface to Tk/Tcl is kind of finished.  The tk & tcl
library interface is finished.  I'm still working on a set of Tk
wrapper classes.

So now it's possible to create and manipulate Tk/Tcl programs from
Python.  Python methods can also be registered as Tk/Tcl commands; so
that you don't need to write Tcl procedures!

If you use Python in interactive mode, you can (as in wish) manipulate
the running GUI interactively.  This only works if you use readline,
as rl_event_hook is used for event processing.

Here's an example (it works):

##################################################
from Tkinter import *

def do_hello():
        print 'Hello world!'

class Test(Frame):
        text = 'Testing'
        num = 1
        def do_xy(self, x, y):
                x, y = self.tk.getint(x), self.tk.getint(y)
                print (x,y)
        def do_test(self):
                self.text = self.text + ' ' + `self.num`
                self.num = self.num + 1
                self.test['text'] = self.text
        def __init__(self, master):
                Frame.__init__(self, master)
                self['bd'] = 30
                self.pack()
                self.bind('<Motion>', self.do_xy, ('%x', '%y'))
                self.hello = Button(self)
                self.hello['text'] = 'Hello'
                self.hello['command'] = do_hello
                Pack.setitem(self.hello, 'fill', 'both')
                self.hello.pack()
                self.test = Button(self)
                self.test['text'] = self.text
                self.test['command'] = self.do_test
                Pack.setitem(self.test, 'fill', 'both')
                self.test.pack()

m = Tk()
test = Test(m)
##################################################

If somebody wants to test/use Tkinter drop me a note, and I'll
email the source.

-sl



Sun, 17 Nov 1996 04:39:44 GMT  
 Tk/Tcl interface module
Which version of Tcl/Tk is expected?  I build against Tcl 7.3, Tk 3.6,
and get the following problems:

/import-writable/python/sparc-sun-sunos4.1/src/Extensions/tkinter 475 % make all CC=acc
acc -g -I/import/python/sparc-sun-sunos4.1/include/Py -I/import/python/sparc-sun-sunos4.1/lib -DHAVE_CONFIG_H -DPYTHONPATH=\".:/import/python-1.0.0/common/lib/python:/import/python-1.0.0/common/lib/python/test\" -c config.c
acc -g -I/import/python/sparc-sun-sunos4.1/include/Py -I/import/python/sparc-sun-sunos4.1/lib -DHAVE_CONFIG_H  -I/import/python/sparc-sun-sunos4.1/include -I/import/tcl7/include/tcl7.3 -I/import/tcl7/include/tk3.6 -I/import/X11R4/include -c ./tkinter.c
"./tkinter.c", line 94: warning: assignment type mismatch
ar cr lib.a tkinter.o
acc config.o lib.a /import/python/sparc-sun-sunos4.1/lib/libModules.a  /import/python/sparc-sun-sunos4.1/lib/libPython.a  /import/python/sparc-sun-sunos4.1/lib/libObjects.a  /import/python/sparc-sun-sunos4.1/lib/libParser.a \
           -L/import/tcl7/lib -L/import/X11R4/usr/lib -ltk -ltcl -lX11  -lm  -o python
ld: lib.a: warning: archive has no table of contents; add one using ranlib(1)
ld: Undefined symbol
   _Tcl_AppInit
*** Error code 2
make: Fatal error: Command failed for target `python'

Bill



Mon, 18 Nov 1996 09:05:07 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. how to access prolog from tcl?(not using tcl/tk interface from prolog)

2. NEED HELP On integrating C and Tcl modules under twine (Tcl/Tk for MS Windows)

3. Subject: NEED HELP On integrating C and Tcl modules under twine (Tcl/Tk for MS Windows)

4. NEED HELP On integrating C and Tcl modules under twine (Tcl/Tk for MS Windows)

5. NEED HELP On integrating C and Tcl modules under twine (Tcl/Tk for MS Windows)

6. NEED HELP On integrating C and Tcl modules under twine (Tcl/Tk for MS Windows)

7. NEED HELP On integrating C and Tcl modules under twine (Tcl/Tk for MS Windows)

8. ??? module function in the interface of a module function

9. non Tcl interfaces to Tk

10. Interface Cobol<->Tcl/Tk

11. Interfacing Ada with C with Tcl/Tk (Repost)

12. Interfacing Ada with C with Tcl/Tk...

 

 
Powered by phpBB® Forum Software