Tkinter + Tcl help

S

sunitajain

Hello all,
I have a Tcldot package which I am using with Tcl (I source the package
by 'load .....\libtcldot.so.0' command.
Now I want to use this package in Tkinter.
Can anyone suggest me how to do this?
I tried the foll:
root=Tk()
root.tk.eval('load ......\libtcldot.so.0')
root.mainloop()
But I get error this way.
Any suggestions would be the most useful.
Thanks,
Sunita
 
J

Jeff Epler

I think you need to write
root.tk.eval('load', '...\\libtcldot.so.0')

When you write
root.tk.eval("x y z")
it's like doing this at the wish/tclsh prompt:
# {x y z}
Not like this:
# x y z
Now, how useful it is to have a command called "x y z", I can't
guess... but tcl would let you do it.

I've also doubled the backslash in your library filename. When using
windows-style paths in string literals, you must either double the
backslashes, or use r'' strings. When you don't, it will often work,
but if the character after the un-doubled backslash is one with special
meaning (including the commonly-seen \r and \t, but also other letters)
then you'll get a pathname and an error that leave you scratching your
head.

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFCyphLJd01MZaTXX0RAlqFAJ45AvrDg1JXbWTBGvw8pn2zCNlfqgCgoV3t
EODHDbzmiUM3O9stQWnwkS4=
=QUop
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top