ImgPhotoGet couldn't find visual for window

I get this Fatal Error in Wish shortly soon after launching something, what changes screen mode (for example, StarCraft :-). Wish crashes with access violation than.

Running tkabber starpack 0.10.0 with snack.kit on Windows 2000 SP4.

Any comments?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I remember having a similar

I remember having a similar problem, maybe the same one. I think it was a problem with color switch, not resolution. And only in Windows.

The solution I found was editing the source code of Tcl (or Tk), and recompile. This is not acceptable for most people, so let's see what other solutions provide the experts :) - have this problem, running Tkabber on ActiveTcl, even on 8.5 beta.

Will try to apply this genius patch and see, what will happen. :-)

If we call XAllocColor in

If we call XAllocColor in non-palette mode, than switch to palette mode and call XFreeColors, the latter will free resources, which were never allocated. :-)

Again, we get a memory leak in opposite case. (patched)

Probably, not an elegant patch, but works for me.

I will probably send a PR to Tk developers.


The problem is with the Tk Windows port and it's not related specifically to ActiveState's distros of Tcl/Tk.

The problem stems from the fact Tk on Windows uses XLEL — an "XLib Emulation Layer" to glue Win32 API and Tk internals that were written for xlib. X Window servers by design can not change display color depth at runtime, so programs written for X just don't know such a thing can happen. Running a full-screen Windows application that changes the desktop color depth casts "the world has changed" kind of event in Tk which just don't know how to handle this problem.

The obvious solution is to always try to configure games to run with the same color depth as the desktop. If it's not possible, switch the depth to that of the game that will be played and then run Tkabber. In other words, try to prevent Tkabber from seeing runtime color depth changes.

Also note that Tk 8.5 is rumored to receive some hacks to mitigate this problem. Unfortunately, starpacks use 8.4 and will continue to do so until 8.5 is really out and well tested.

But instead of hacking the source I can propose installing the most recent 8.5 from AS and run Tkabber "from sources".

If you have any troubles with this, don't hesitate to join chatroom and ask.

BTW this bug is registered in the Tkabber's bugzilla.

Syndicate content