tclkit error on "image create photo"

251 views
Skip to first unread message

Zbigniew Diaczyszyn

unread,
Dec 10, 2009, 6:22:21 PM12/10/09
to sta...@googlegroups.com
I am working with ActiveState Tcl/Tk 8.5.7. I tried Linux tclkit x86-Version
8.5.1 and Version 8.5.7 from http://www.patthoyts.tk/tclkit/linux-ix86/

My Test-Code is as follows:

-----------------------------------
set button [image create photo -data "
R0lGODlhFAASAKEBAC5Ecv///5sJCQAAACH5BAEAAAMALAAAAAAUABIAAAJCnI+pywoPowQIBDvj
rbnXAIaiSB1WIAhiSn5oqr7sZo52WBrnDPK03oMFZ7nB6TYq7mLBVk0Wg8WUSJuyk2lot9wCADs=
"]

wm title . "Password Gorilla"
wm iconname . "Gorilla"
wm iconphoto . $button
-----------------------------------

$ tclkit sdx.kit qwrap tclkit_test.tcl
5 updates applied

$ tclkit tclkit_test.kit
invalid command name "image"
while executing
"image create photo -data "
R0lGODlhFAASAKEBAC5Ecv///5sJCQAAACH5BAEAAAMALAAAAAAUABIAAAJCnI+pywoPowQIBDvj
rbnXAIaiSB1WIAhiSn5oqr7sZo52WBrnDPK03oMFZ7nB6T..."
invoked from within
"set button [image create photo -data "

wish 8.5.7 does not complain and is showing the icon without problems.



Uwe Koloska

unread,
Dec 10, 2009, 8:08:49 PM12/10/09
to sta...@googlegroups.com
> $ tclkit sdx.kit qwrap tclkit_test.tcl
> 5 updates applied

no need to wrap -- just execute:
$ tclkit tclkit_test.tcl

> $ tclkit tclkit_test.kit
> invalid command name "image"

you missed to require Tk that is not loaded by default in a tclkit. So every
app that uses Tk has to require it explicitly:

package require Tk

and if you use Ttk for example you must give the version, too:

package require Tk 8.5

Best regards
Uwe

Pat Thoyts

unread,
Dec 10, 2009, 8:09:18 PM12/10/09
to Zbigniew Diaczyszyn, sta...@googlegroups.com

you need to add package require Tk to your script. wish does an implicit require Tk as you would only run wush to get Tk. However tclsh and tclkit both need you to declare your requirement. tclkit avoids loading Tk unless your program needs it.




--
You received this message because you are subscribed to the "starkit" group.
To post to this group, send email to sta...@googlegroups.com
To unsubscribe from this group, send email to starkit-u...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/starkit?hl=en

Zbigniew Diaczyszyn

unread,
Dec 11, 2009, 3:08:20 AM12/11/09
to sta...@googlegroups.com
> you need to add package require Tk to your script

@all:

Thank you for the quick response, that was it.

I've put the "package require Tk" command in a procedure, thus tclkit could not
find the command at runtime.

I will rebuild the programm...



avs

unread,
Dec 11, 2009, 4:45:59 AM12/11/09
to starkit
You probably forgot
"package require Tk"

Wish itself contains Tk.

Tclkit by default - no, it is like tclsh, so under Linux wish equals
to "tclsh; package require Tk".


On 11 дек, 02:22, Zbigniew Diaczyszyn <z....@gmx.de> wrote:
> I am working with ActiveState Tcl/Tk 8.5.7. I tried Linux tclkit x86-Version
> 8.5.1 and Version 8.5.7 fromhttp://www.patthoyts.tk/tclkit/linux-ix86/
Reply all
Reply to author
Forward
0 new messages