Re: tkinter + TkPixmap
tnb2d@brunelleschi.cs.virginia.edu
Wed, 31 Aug 94 10:30:55 EDT
Hi Fred,
I did exactly what you are proposing to do, and as easy it
should have been I was in agony the whole way through. Hooking a
TkPixmap'd tk into tkinter is trivial, you make no Python changes, no
C changes, just relink after you've built TkPixmap into tk. It is
getting TkPixmap into tk that is the problem. The Makefiles make
assumptions that are, at least in my case, incorrect and the
building instructions basically did not work. It turns out the
problem is the Makefile decides whether or not your system supports
dynamic linking, and if it does it automatically makes the shared
TkPixmap libraries for you. But in the process it tries to get stuff
from a directory that does not exist in the standard tk distribution.
So I basically had to eliminate the target from the Makefile that
tried to do this. That's when the trouble began, because the Makefile
is too dumb to know whether you've tried to make it before and making
it twice screws things up even worse! So every time I tried to
recover from a make failure I had to rm the directory and unpack a
fresh distribution all over again. THAT WAS A PAIN IN THE NECK!
So my advice is, by all means build this thing because having
full color pixmaps on buttons and canvases is just a grand qualitative
difference over simple bitmaps. But be very careful as you follow the
building instructions, and use this little checklist to help you as
you go:
- make a standard tk
- unpack the TkPixmap distribution in the same directory as tcl and tk
- run configure in the TkPixmap dir (use --prefix and --exec_prefix)
- check the Makefiles to see if TK_LIBRARY is correct, change it in if
it is not. The Makefiles to check are in TkPixmap, TkPixmap/libtk
and TkPixmap/wish.
- take out the shared target from libtk/Makefile all: SO, the target
that looked like this:
all: $(SHLIBSO) lib$(LOCAL_LIB_NAME).a
should look like this:
all: lib$(LOCAL_LIB_NAME).a
- from TkPixmap dir make build-libtk
- copy the libtk.a from the TkPixmap/libtk dir to prefix/lib
- from TkPixmap make build-xpm
- make sure wherever in the Python Makefiles/Setups you had
-Lprefix/lib -ltk -ltcl
you also have
-lxpm
- relink python
- done.
Fred L. Drake, Jr. writes:
|
| Hello, All,
| I have a quick question about the tkinter module. I've successfully built
| it on Linux w/out any problems, but would like to add the TkPixmap extension.
| Has anyone here tried this on either Linux or OSF/1? Did you get it to work
| without too many difficulties?
| Please post or e-mail any experiences you care to share. I'd really
| appreciate hearing about results before I spend a lot of time on this.
| Thanks!
|
| -Fred
|
-------> Tommy.
"I am who I am who I am. Well, who am I?" -- Dave Matthews