Bug 225999 - tcl/tk broken if built with x11-proto/xproto-7.0.13
Bug#: 225999 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: tcltk@gentoo.org Reported By: jeanfrancisroy@gmail.com
Component: Applications
URL:  http://sourceforge.net/tracker/index.php?func=detail&aid=2010422&group_id=12997&atid=112997
Summary: tcl/tk broken if built with x11-proto/xproto-7.0.13
Keywords:  
Status Whiteboard: 
Opened: 2008-06-11 23:55 0000
Description:   Opened: 2008-06-11 23:55 0000
tcl/tk fails to execute if compiled while using x11-proto/xproto-7.0.13.

Reproducible: Always

Steps to Reproduce:
1. upgrade to x11-proto/xproto-7.0.13
2. compile tcl and tk
3. start any application using them

Actual Results:  
$ wish                                                                          
Application initialization failed: Can't find a usable tk.tcl in the following
directories:             
    /usr/lib64/tcl8.5/tk8.5 /usr/lib64/tk8.5 /lib/tk8.5 /usr/library            

/usr/lib64/tk8.5/tk.tcl: no event type or button # or keysym
no event type or button # or keysym                         
    while executing                                         
"bind Listbox <MouseWheel> {                               
        %W yview scroll [expr {- (%D / 120) * 4}] units     
    }"                                                     
    invoked from within                                     
"if {[tk windowingsystem] eq "aqua"} {                     
    bind Listbox <MouseWheel> {                             
        %W yview scroll [expr {- (%D)}] units               
    }                                                       
    bind Listbox <Option-Mou..."                           
    (file "/usr/lib64/tk8.5/listbox.tcl" line 182)
    invoked from within
"source /usr/lib64/tk8.5/listbox.tcl"
    (in namespace eval "::" script line 1)
    invoked from within
"namespace eval :: [list source [file join $::tk_library $file.tcl]]"
    (procedure "SourceLibFile" line 2)
    invoked from within
"SourceLibFile listbox"
    (in namespace eval "::tk" script line 4)
    invoked from within
"namespace eval ::tk {
        SourceLibFile button
        SourceLibFile entry
        SourceLibFile listbox
        SourceLibFile menu
        SourceLibFile panedwindow
        SourceLibFile ..."
    invoked from within
"if {$::tk_library ne ""} {
    proc ::tk::SourceLibFile {file} {
        namespace eval :: [list source [file join $::tk_library $file.tcl]]
    }
   ..."
    (file "/usr/lib64/tk8.5/tk.tcl" line 404)
    invoked from within
"source /usr/lib64/tk8.5/tk.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list source $file]"


This probably means that tk wasn't installed properly.


Expected Results:  
Tcl/TK applications to work correctly.

# paludis -I
paludis 0.26.2   
Paludis build information:
    Compiler:             
        CXX:                   x86_64-pc-linux-gnu-g++ 4.3.1
        CXXFLAGS:              -march=core2 -O2 -pipe       
        LDFLAGS:                                           
        DATE:                  2008-06-11T12:38:31-0400     

    Libraries:
        C++ Library:           GNU libstdc++ 20080606

    Reduced Privs:
        reduced_uid:           101
        reduced_uid->name:     paludisbuild
        reduced_uid->dir:      /var/tmp/paludis
        reduced_gid:           1000           
        reduced_gid->name:     paludisbuild   

    Paths:
        DATADIR:               /usr/share
        LIBDIR:                /usr/lib64
        LIBEXECDIR:            /usr/libexec
        SYSCONFDIR:            /etc       
        PYTHONINSTALLDIR:      /usr/lib64/python2.5/site-packages
        RUBYINSTALLDIR:                                         

Repository virtuals:
    format:                    virtuals

Repository installed-virtuals:
    format:                    installed_virtuals
    root:                      /                 

Repository gentoo:
    format:                    ebuild
    location:                  /usr/portage
    append_repository_name_to_write_cache: true
    binary_destination:        false           
    binary_keywords:                           
    binary_uri_prefix:                         
    builddir:                  /var/tmp/paludis
    cache:                     /usr/portage/metadata/cache
    distdir:                   /usr/portage/distfiles     
    eapi_when_unknown:         0                         
    eapi_when_unspecified:     0                         
    eclassdirs:                /usr/portage/eclass       
    ignore_deprecated_profiles: false                     
    layout:                    traditional               
    names_cache:               /var/cache/paludis/names   
    newsdir:                   /usr/portage/metadata/news
    profile_eapi:              0                         
    profiles:                 
/usr/portage/profiles/default/linux/amd64/2008.0/desktop
    securitydir:               /usr/portage/metadata/glsa                       
    setsdir:                   /usr/portage/sets                                
    sync:                      rsync://rsync.europe.gentoo.org/gentoo-portage   
    sync_options:                                                               
    use_manifest:              use                                              
    write_cache:               /var/empty                                       

    Package information:
        app-admin/eselect-compiler: (none)
        app-shells/bash:       3.2_p39   
        dev-java/java-config:  1.3.7 2.1.6
        dev-lang/python:       2.4.4-r13 2.5.2-r4
        dev-python/pycrypto:   2.0.1-r6         
        dev-util/ccache:       (none)           
        dev-util/confcache:    (none)           
        sys-apps/baselayout:   2.0.0             
        sys-apps/openrc:       0.2.5             
        sys-apps/sandbox:      1.2.18.1-r2       
        sys-devel/autoconf:    2.13 2.62         
        sys-devel/automake:    1.10.1-r1 1.5 1.7.9-r1 1.9.6-r2
        sys-devel/binutils:    2.18-r1                       
        sys-devel/gcc-config:  1.4.0-r4                       
        sys-devel/libtool:     2.2.4                         
        virtual/os-headers:    2.6.25-r4 (for
sys-kernel/linux-headers::installed)

Repository installed:
    format:                    vdb
    location:                  /var/db/pkg
    builddir:                  /var/tmp/paludis
    names_cache:               /var/cache/paludis/names
    provides_cache:            /var/cache/paludis/provides
    root:                      /

------- Comment #1 From Patrick Fourniols 2008-06-12 22:54:11 0000 -------
idem for me, and before finding this bug report, i have tried tcl tk 8.5.1:
idem unless downgrading to xproto-7.0.12 and re emerging tcl tk...

------- Comment #2 From M. Edward Borasky 2008-06-15 00:20:05 0000 -------
Got something very much like this with tcl/tk 8.4 when trying to access tk from
R. I have no idea how I managed to find this bug, but I did. :) I thought it
was an R bug, then a threads bug, then a gcc 4.3 bug. I guess I can upgrade to
Tcl/Tk 8.5 now.

------- Comment #3 From John Brendler 2008-06-18 02:50:41 0000 -------
Same here (with both tk 8.4.18 and tk 8.4.15-r1).
Error discovered while trying to run tk interfaces in python.

------- Comment #4 From George Howlett 2008-06-21 20:01:53 0000 -------
The bug is in generic/tkBind.c in the flagArray.  xproto-7.0.13 adds
a new event GenericEvent.  Probably every version of Tk (8.*) is affected.
Here's a patch.

--- tkBind.c    2006-07-21 02:26:54.000000000 -0400
+++ tkBind.c-new        2008-06-21 15:51:50.000000000 -0400
@@ -586,6 +586,9 @@
    /* ColormapNotify */                COLORMAP,
    /* ClientMessage */         0,
    /* MappingNotify */         0,
+#ifdef GenericEvent
+   /* GenericEvent */          0,
+#endif 
    /* VirtualEvent */          VIRTUAL,
    /* Activate */              ACTIVATE,           
    /* Deactivate */            ACTIVATE,

------- Comment #5 From Zebediah C. McClure 2008-06-29 06:34:14 0000 -------
Behavior observed under ~x86, scope of breakage is wider than just AMD64
platform.

------- Comment #6 From Jean-Francis Roy 2008-06-29 06:47:19 0000 -------
Hardware changed from AMD64 to All

------- Comment #7 From Carsten Lohrke 2008-07-04 13:21:22 0000 -------
*** Bug 230621 has been marked as a duplicate of this bug. ***

------- Comment #8 From Carsten Lohrke 2008-07-04 13:21:37 0000 -------
*** Bug 230727 has been marked as a duplicate of this bug. ***

------- Comment #9 From Geert Vanhaute 2008-07-05 12:42:59 0000 -------
Created an attachment (id=159623) [details]
tk-8.4.18-tkBind.patch

The above mentionned patch

------- Comment #10 From Fred Krogh 2008-07-05 18:09:37 0000 -------
*** Bug 230877 has been marked as a duplicate of this bug. ***

------- Comment #11 From gtlinuxman 2008-07-10 13:56:01 0000 -------
The bug is tracked upstream:
http://sourceforge.net/tracker/index.php?func=detail&aid=2010422&group_id=12997&atid=112997

During today discussion in the Tcler's chatroom Kevin Kenny proposed a more
clean short-term solution than the patch from comment #4. This proposed
solution is documented as a comment for upstream bug.

There's no upstream fix yet.

----
xmpp:tkabber@conference.jabber.ru/kostix

------- Comment #12 From Carsten Lohrke 2008-07-15 16:09:27 0000 -------
*** Bug 231874 has been marked as a duplicate of this bug. ***

------- Comment #13 From Carsten Lohrke 2008-07-21 16:23:09 0000 -------
*** Bug 232550 has been marked as a duplicate of this bug. ***

------- Comment #14 From Lars Wendler (Polynomial-C) 2008-07-24 06:37:47 0000 -------
Created an attachment (id=161242) [details]
tk-8.4-lastevent.patch

Hi,

the attached patch is slightly reworked (some line adjustment to apply cleanly
to tk-8.4.x) taken directly from
http://sourceforge.net/tracker/index.php?func=detail&aid=2010422&group_id=12997&atid=112997
It solved the issues with app-text/ding I had from this bug.

Cheers
Poly-C

------- Comment #15 From Jim Ramsay 2008-07-24 14:43:33 0000 -------
(In reply to comment #14)
> the attached patch is slightly reworked (some line adjustment to apply cleanly
> to tk-8.4.x) taken directly from
> http://sourceforge.net/tracker/index.php?func=detail&aid=2010422&group_id=12997&atid=112997

Works for me: solves the problems I was seeing with gitk from 'USE=tk
dev-util/git'

I vote this patch goes in to the tree.

------- Comment #16 From Carsten Lohrke 2008-07-28 17:19:50 0000 -------
*** Bug 233173 has been marked as a duplicate of this bug. ***

------- Comment #17 From Marek Aaron Sapota 2008-08-28 17:11:55 0000 -------
*** Bug 234965 has been marked as a duplicate of this bug. ***

------- Comment #18 From Boris Petersen 2008-09-05 12:20:07 0000 -------
patch works for me aswell
++ into tree

------- Comment #19 From Carsten Lohrke 2008-09-09 10:42:10 0000 -------
*** Bug 237056 has been marked as a duplicate of this bug. ***

------- Comment #20 From sargun dhillon 2008-09-23 08:05:31 0000 -------
Works for me. PLEASE put into tree. :-)

------- Comment #21 From Tomas Cohen Arazi 2008-09-25 00:10:26 0000 -------
++

------- Comment #22 From mondrillo 2008-09-26 19:17:01 0000 -------
Have this patch solved this issue, I've the same problem with chessDB. 

dev-lang/tk
      Latest version available: 8.4.18
      Latest version installed: 8.4.18
      Size of files: 3,285 kB
      Homepage:      http://dev.scriptics.com/software/tcltk/
      Description:   Tk Widget Set
      License:       BSD

------- Comment #23 From Chiyeh Chen 2008-10-02 08:02:54 0000 -------
tk-8.4-lastevent.path have problem , out of array. 
But for insight , it didn't workable. tk-8.4.18

------- Comment #24 From mondrillo 2008-10-10 13:11:33 0000 -------
Hello I put the ChessdB error :-(

$ chessdb
Application initialization failed: Can't find a usable tk.tcl in the following
directories: 
    /usr/lib/snack2.2/tk8.4 /usr/lib64/tcl8.4/tk8.4 /usr/lib64/tk8.4
/usr/games/lib/tk8.4 /usr/lib/tk8.4 /usr/games/library /usr/library
/usr/tk8.4.18/library /tk8.4.18/library

/usr/lib64/tk8.4/tk.tcl: no event type or button # or keysym
no event type or button # or keysym
    while executing
"bind Listbox <MouseWheel> {
        %W yview scroll [expr {- (%D / 120) * 4}] units
    }"
    invoked from within
"if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
    bind Listbox <MouseWheel> {
        %W yview scroll [expr {- (%D)}] uni..."
    (file "/usr/lib64/tk8.4/listbox.tcl" line 181)
    invoked from within
"source /usr/lib64/tk8.4/listbox.tcl"
    (in namespace eval "::" script line 1)
    invoked from within
"namespace eval :: [list source [file join $::tk_library $file.tcl]]"
    (procedure "SourceLibFile" line 2)
    invoked from within
"SourceLibFile listbox"
    (in namespace eval "::tk" script line 4)
    invoked from within
"namespace eval ::tk {
        SourceLibFile button
        SourceLibFile entry
        SourceLibFile listbox
        SourceLibFile menu
        SourceLibFile panedwindow
        SourceLibFile ..."
    invoked from within
"if {$::tk_library ne ""} {
    if {$tcl_platform(platform) eq "macintosh"} {
        proc ::tk::SourceLibFile {file} {
            if {[catch {
                namespace eval :: ..."
    (file "/usr/lib64/tk8.4/tk.tcl" line 407)
    invoked from within
"source /usr/lib64/tk8.4/tk.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list source $file]"
/usr/lib/tk8.4/tk.tcl: no event type or button # or keysym
no event type or button # or keysym
    while executing
"bind Listbox <MouseWheel> {
        %W yview scroll [expr {- (%D / 120) * 4}] units
    }"
    invoked from within
"if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
    bind Listbox <MouseWheel> {
        %W yview scroll [expr {- (%D)}] uni..."
    (file "/usr/lib/tk8.4/listbox.tcl" line 181)
    invoked from within
"source /usr/lib/tk8.4/listbox.tcl"
    (in namespace eval "::" script line 1)
    invoked from within
"namespace eval :: [list source [file join $::tk_library $file.tcl]]"
    (procedure "SourceLibFile" line 2)
    invoked from within
"SourceLibFile listbox"
    (in namespace eval "::tk" script line 4)
    invoked from within
"namespace eval ::tk {
        SourceLibFile button
        SourceLibFile entry
        SourceLibFile listbox
        SourceLibFile menu
        SourceLibFile panedwindow
        SourceLibFile ..."
    invoked from within
"if {$::tk_library ne ""} {
    if {$tcl_platform(platform) eq "macintosh"} {
        proc ::tk::SourceLibFile {file} {
            if {[catch {
                namespace eval :: ..."
    (file "/usr/lib/tk8.4/tk.tcl" line 407)
    invoked from within
"source /usr/lib/tk8.4/tk.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list source $file]"


This probably means that tk wasn't installed properly.

Error in startup script: invalid command name "sc_info"
    while executing
"sc_info version"
    (file "/usr/games/bin/chessdb" line 1)

Can I have running chessdb masking x11-proto/xproto-7.0.13?
Thank's and regards

------- Comment #25 From cucu ionut 2008-10-10 15:26:08 0000 -------
it's how I solved it

------- Comment #26 From Wormo 2008-10-22 22:31:32 0000 -------
*** Bug 243282 has been marked as a duplicate of this bug. ***

------- Comment #27 From Jon Hurst 2008-10-25 19:07:54 0000 -------
(In reply to comment #18)
> patch works for me aswell
> ++ into tree
> 

Also works for me

------- Comment #28 From Federico Ferri 2008-10-26 11:22:53 0000 -------
this is fixed in version 8.5.5.
also 8.4 got bumped to 8.4.19.

please test; reopen if doesn't work.

------- Comment #29 From Lars Wendler (Polynomial-C) 2008-10-26 11:49:30 0000 -------
tk-8.4.19 still doesn't work without this patch...

------- Comment #30 From Federico Ferri 2008-10-26 14:36:46 0000 -------
Reopening then

------- Comment #31 From Federico Ferri 2008-10-27 20:33:04 0000 -------
added tk-8.4-lastevent.patch to tk-8.14.18-r1 and tk-8.4.19 ebuilds in CVS
please resync & test
thank you

------- Comment #32 From Jean-Francis Roy 2008-10-27 21:25:23 0000 -------
Just synced and tested, everything works, hanks :)

------- Comment #33 From Federico Ferri 2008-11-16 09:01:26 0000 -------
*** Bug 246774 has been marked as a duplicate of this bug. ***

------- Comment #34 From fuzion 2008-11-24 12:16:38 0000 -------
I just did this:
emerge --sync
emerge tk (also did tcl)
emerge insight

I am getting the following error, is it related to this PR or should it be a
new PR? What else do I need to do to get insight working again? I'll try emerge
-u world.

The computer is an x86 (posted because error has 'macintosh' in it?).

Error I am seeing now is:

Tk_Init failed: Can't find a usable tk.tcl in the following directories: 
    /usr/share/insight/tk8.4 /usr/lib/tk8.4 /lib/tk8.4 /usr/library /library
/tk8.4.1/library /tk8.4.1/library

/usr/share/insight/tk8.4/tk.tcl: no event type or button # or keysym
no event type or button # or keysym
    while executing
"bind Listbox <MouseWheel> {
    %W yview scroll [expr {- (%D / 120) * 4}] units
}"
    (file "/usr/share/insight/tk8.4/listbox.tcl" line 182)
    invoked from within
"source /usr/share/insight/tk8.4/listbox.tcl"
    (in namespace eval "::" script line 1)
    invoked from within
"namespace eval :: [list source [file join $::tk_library $file.tcl]]"
    (procedure "SourceLibFile" line 2)
    invoked from within
"SourceLibFile listbox"
    (in namespace eval "::tk" script line 4)
    invoked from within
"namespace eval ::tk {
        SourceLibFile button
        SourceLibFile entry
        SourceLibFile listbox
        SourceLibFile menu
        SourceLibFile panedwindow
        SourceLibFile ..."
    invoked from within
"if {$::tk_library ne ""} {
    if {[string equal $tcl_platform(platform) "macintosh"]} {
        proc ::tk::SourceLibFile {file} {
            if {[catch {
                namesp..."    (file "/usr/share/insight/tk8.4/tk.tcl" line 393)
    invoked from within
"source /usr/share/insight/tk8.4/tk.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list source $file]"
/usr/lib/tk8.4/tk.tcl: can't import command "mc": already exists
can't import command "mc": already exists
    while executing
"namespace import ::msgcat::mc"
    (in namespace eval "::tk::msgcat" script line 21)
    invoked from within
"namespace eval msgcat {
        namespace export mc mcmax
        if {[interp issafe] || [catch {package require msgcat}]} {
            # The msgcat package..."
    (in namespace eval "::tk" script line 3)
    invoked from within
"namespace eval ::tk {
    # Set up the msgcat commands
    namespace eval msgcat {
        namespace export mc mcmax
        if {[interp issafe] || [catch {p..."
    (file "/usr/lib/tk8.4/tk.tcl" line 20)
    invoked from within
"source /usr/lib/tk8.4/tk.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list source $file]"


This probably means that tk wasn't installed properly.

------- Comment #35 From fuzion 2008-11-25 03:09:18 0000 -------
emerge -u world did not fix it for me

I'm going to try using tk 8.5.5, since it has a hard mask
(http://gentoo-portage.com/dev-lang/tk/ChangeLog) I'm going to do this:
echo "=dev-lang/tcl-8.5.5" >> /etc/portage/packages.unmask
echo "=dev-lang/tk-8.5.5" >> /etc/portage/package.unmask
emerge tk

This should replace tcl 8.4.19 and tk 8.4.19-r1 with 8.5.5. Hopefully that will
fix it for me. I was under the impression that tk 8.4.19-r1 had this fixed.

------- Comment #36 From fuzion 2008-11-25 03:29:30 0000 -------
After upgrading to tcl/tk 8.5.5 I had to run this command (twice):
revdep-rebuild

Insight still won't start. I'm going to try:
emerge insight
with hopes that it will detect the new tcl/tk version. Strangely enough in the
error message it only seems to be looking for tk8.4 or tk8.4.1. Maybe it is
insight that needs to be patched (i.e. does it come with its own copy of tcl/tk
that it is using?)

I still get this error when I run insight:
Tk_Init failed: Can't find a usable tk.tcl in the following directories: 
    /usr/share/insight/tk8.4 /usr/lib/tk8.4 /lib/tk8.4 /usr/library /library
/tk8.4.1/library /tk8.4.1/library

/usr/share/insight/tk8.4/tk.tcl: no event type or button # or keysym
no event type or button # or keysym
    while executing
"bind Listbox <MouseWheel> {
    %W yview scroll [expr {- (%D / 120) * 4}] units
}"
    (file "/usr/share/insight/tk8.4/listbox.tcl" line 182)
    invoked from within
"source /usr/share/insight/tk8.4/listbox.tcl"
    (in namespace eval "::" script line 1)
    invoked from within
"namespace eval :: [list source [file join $::tk_library $file.tcl]]"
    (procedure "SourceLibFile" line 2)
    invoked from within
"SourceLibFile listbox"
    (in namespace eval "::tk" script line 4)
    invoked from within
"namespace eval ::tk {
        SourceLibFile button
        SourceLibFile entry
        SourceLibFile listbox
        SourceLibFile menu
        SourceLibFile panedwindow
        SourceLibFile ..."
    invoked from within
"if {$::tk_library ne ""} {
    if {[string equal $tcl_platform(platform) "macintosh"]} {
        proc ::tk::SourceLibFile {file} {
            if {[catch {
                namesp..."
    (file "/usr/share/insight/tk8.4/tk.tcl" line 393)
    invoked from within
"source /usr/share/insight/tk8.4/tk.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list source $file]"


This probably means that tk wasn't installed properly.

------- Comment #37 From fuzion 2008-11-25 03:36:02 0000 -------
Reinstalling insight did not fix the problem.

Should this PR be re-opened? What else can I try?

------- Comment #38 From John Brendler 2008-11-25 03:46:32 0000 -------
(In reply to comment #37)
Did you apply the patch?

------- Comment #39 From fuzion 2008-11-25 03:56:26 0000 -------
I thought that the patch was in the 'mainstream' so it wouldn't need to be
applied manually. Isn't that why the PR is closed?

------- Comment #40 From fuzion 2008-11-25 03:57:13 0000 -------
Going to xproto 7.0.12 was the only thing that fixed it for me (of the things I
tried). I had to do this:
- put this line in /usr/portage/profiles/package.mask:
>=x11-proto/xproto-7.0.13
- emerge xproto
- emerge tcl; emerge tk; emerge insight

I think this means that insight comes with its own tcl/tk. So would it be
feasible to apply the same patch to insight's tk that was applied to tk for
this PR?

Should I raise a new PR for this against insight? I'm worried someone will
strike it down as a duplicate of this PR.

I appologize for all of the posts to this PR tonight. Hopefully the details
will help someone else.

------- Comment #41 From John Brendler 2008-11-25 04:12:16 0000 -------
(In reply to comment #39)
> I thought that the patch was in the 'mainstream' so it wouldn't need to be
> applied manually. Isn't that why the PR is closed?
Oh yeah.  Sorry.  Checking I see that I'm not longer using a local ebuild for
this.
dev-lang/tk-8.4.18 and x11-proto/xproto-7.0.13 are working for me, but I don't
use insight.

------- Comment #42 From John Brendler 2008-11-25 04:15:13 0000 -------
Correction, I'm using dev-lang/tk-8.4.19-r1 and x11-proto/xproto-7.0.13

------- Comment #43 From fishping 2008-12-14 00:26:22 0000 -------
(In reply to comment #0)
> tcl/tk fails to execute if compiled while using x11-proto/xproto-7.0.13.
> Reproducible: Always
> Steps to Reproduce:
> 1. upgrade to x11-proto/xproto-7.0.13
> 2. compile tcl and tk
> 3. start any application using them
> Actual Results:  
> $ wish                                                                          
> Application initialization failed: Can't find a usable tk.tcl in the following
> directories:             
>     /usr/lib64/tcl8.5/tk8.5 /usr/lib64/tk8.5 /lib/tk8.5 /usr/library            
> /usr/lib64/tk8.5/tk.tcl: no event type or button # or keysym
> no event type or button # or keysym                         
>     while executing                                         
> "bind Listbox <MouseWheel> {                               
>         %W yview scroll [expr {- (%D / 120) * 4}] units     
>     }"                                                     
>     invoked from within                                     
> "if {[tk windowingsystem] eq "aqua"} {                     
>     bind Listbox <MouseWheel> {                             
>         %W yview scroll [expr {- (%D)}] units               
>     }                                                       
>     bind Listbox <Option-Mou..."                           
>     (file "/usr/lib64/tk8.5/listbox.tcl" line 182)
>     invoked from within
> "source /usr/lib64/tk8.5/listbox.tcl"
>     (in namespace eval "::" script line 1)
>     invoked from within
> "namespace eval :: [list source [file join $::tk_library $file.tcl]]"
>     (procedure "SourceLibFile" line 2)
>     invoked from within
> "SourceLibFile listbox"
>     (in namespace eval "::tk" script line 4)
>     invoked from within
> "namespace eval ::tk {
>         SourceLibFile button
>         SourceLibFile entry
>         SourceLibFile listbox
>         SourceLibFile menu
>         SourceLibFile panedwindow
>         SourceLibFile ..."
>     invoked from within
> "if {$::tk_library ne ""} {
>     proc ::tk::SourceLibFile {file} {
>         namespace eval :: [list source [file join $::tk_library $file.tcl]]
>     }
>    ..."
>     (file "/usr/lib64/tk8.5/tk.tcl" line 404)
>     invoked from within
> "source /usr/lib64/tk8.5/tk.tcl"
>     ("uplevel" body line 1)
>     invoked from within
> "uplevel #0 [list source $file]"
> This probably means that tk wasn't installed properly.
> Expected Results:  
> Tcl/TK applications to work correctly.
> # paludis -I
> paludis 0.26.2   
> Paludis build information:
>     Compiler:             
>         CXX:                   x86_64-pc-linux-gnu-g++ 4.3.1
>         CXXFLAGS:              -march=core2 -O2 -pipe       
>         LDFLAGS:                                           
>         DATE:                  2008-06-11T12:38:31-0400     
>     Libraries:
>         C++ Library:           GNU libstdc++ 20080606
>     Reduced Privs:
>         reduced_uid:           101
>         reduced_uid->name:     paludisbuild
>         reduced_uid->dir:      /var/tmp/paludis
>         reduced_gid:           1000           
>         reduced_gid->name:     paludisbuild   
>     Paths:
>         DATADIR:               /usr/share
>         LIBDIR:                /usr/lib64
>         LIBEXECDIR:            /usr/libexec
>         SYSCONFDIR:            /etc       
>         PYTHONINSTALLDIR:      /usr/lib64/python2.5/site-packages
>         RUBYINSTALLDIR:                                         
> Repository virtuals:
>     format:                    virtuals
> Repository installed-virtuals:
>     format:                    installed_virtuals
>     root:                      /                 
> Repository gentoo:
>     format:                    ebuild
>     location:                  /usr/portage
>     append_repository_name_to_write_cache: true
>     binary_destination:        false           
>     binary_keywords:                           
>     binary_uri_prefix:                         
>     builddir:                  /var/tmp/paludis
>     cache:                     /usr/portage/metadata/cache
>     distdir:                   /usr/portage/distfiles     
>     eapi_when_unknown:         0                         
>     eapi_when_unspecified:     0                         
>     eclassdirs:                /usr/portage/eclass       
>     ignore_deprecated_profiles: false                     
>     layout:                    traditional               
>     names_cache:               /var/cache/paludis/names   
>     newsdir:                   /usr/portage/metadata/news
>     profile_eapi:              0                         
>     profiles:                 
> /usr/portage/profiles/default/linux/amd64/2008.0/desktop
>     securitydir:               /usr/portage/metadata/glsa                       
>     setsdir:                   /usr/portage/sets                                
>     sync:                      rsync://rsync.europe.gentoo.org/gentoo-portage   
>     sync_options:                                                               
>     use_manifest:              use                                              
>     write_cache:               /var/empty                                       
>     Package information:
>         app-admin/eselect-compiler: (none)
>         app-shells/bash:       3.2_p39   
>         dev-java/java-config:  1.3.7 2.1.6
>         dev-lang/python:       2.4.4-r13 2.5.2-r4
>         dev-python/pycrypto:   2.0.1-r6         
>         dev-util/ccache:       (none)           
>         dev-util/confcache:    (none)           
>         sys-apps/baselayout:   2.0.0             
>         sys-apps/openrc:       0.2.5             
>         sys-apps/sandbox:      1.2.18.1-r2       
>         sys-devel/autoconf:    2.13 2.62         
>         sys-devel/automake:    1.10.1-r1 1.5 1.7.9-r1 1.9.6-r2
>         sys-devel/binutils:    2.18-r1                       
>         sys-devel/gcc-config:  1.4.0-r4                       
>         sys-devel/libtool:     2.2.4                         
>         virtual/os-headers:    2.6.25-r4 (for
> sys-kernel/linux-headers::installed)
> Repository installed:
>     format:                    vdb
>     location:                  /var/db/pkg
>     builddir:                  /var/tmp/paludis
>     names_cache:               /var/cache/paludis/names
>     provides_cache:            /var/cache/paludis/provides
>     root:                      /

------- Comment #44 From hsx 2008-12-16 13:32:32 0000 -------
s 

------- Comment #45 From Serkan Kaba 2009-02-14 17:16:25 0000 -------
*** Bug 258988 has been marked as a duplicate of this bug. ***

------- Comment #46 From Nikos Chantziaras 2009-02-14 17:22:21 0000 -------
Somehow I missed this bug before opening a new one.

Please reopen? The problem is still there.

------- Comment #47 From Richard Li 2009-03-05 08:17:02 0000 -------
I still have this problem, too.

(I applied tk-8.4.18-tkBind.patch, which seems not to be in tree right now.)

------- Comment #48 From Wade Fitzpatrick 2009-03-09 16:03:20 0000 -------
Created an attachment (id=184467) [details]
Reworked ebuild for dev-lang/tk-8.4.18-r2

I hit this bug running python+Tkinter scripts from Scribus.

Added '=dev-lang/tk-8.4.18-r1 ~amd64' to package.keywords to get Lars'
lastevent patch included. Scribus now happily displays Tkinter dialogs.

I am attaching a reworked ebuild that doesn't bump the DEPEND to
 >=x11-proto/xproto-7.0.13 but will still apply the patch if the later version
of xproto is in use.

CAN SOMEONE PLEASE TEST AND BUMP dev-lang/tk-8.4.18-r2 TO STABLE??? THIS BUG
HAS BEEN FIXED IN UNSTABLE FOR 7 MONTHS!!!

------- Comment #49 From Lars Wendler (Polynomial-C) 2009-03-09 16:25:14 0000 -------
Why not just request stabilization of tk-8.4.19-r1 which has the fix already
included?

------- Comment #50 From Wade Fitzpatrick 2009-03-20 15:13:09 0000 -------
(In reply to comment #49)
> Why not just request stabilization of tk-8.4.19-r1 which has the fix already
> included?
> 

Well, whatever, but I encourage you to not make >=x11-proto/xproto-7.0.13 a
dependency as these patches are only workarounds not proper fixes. The patch
should only be applied if >=x11-proto/xproto-7.0.13 is already on the system.

The proper fixes weren't added to upstream until tk-8.5.4 (cvs rev 1.35.2.1)
http://tktoolkit.cvs.sourceforge.net/viewvc/tktoolkit/tk/generic/tkEvent.c?view=log&pathrev=core-8-5-4

------- Comment #51 From Tom Gall 2009-05-01 14:17:17 0000 -------
I just ran into this last night. I don't see how this bug is either
resolved/fixed at least for the random users of gentoo. 

In my case I ran into this on x86_64. (Tho curiously I didn't run into this on
ppc64 which makes me wonder if maybe the amd64 team is just behind on bugs?!?)



------- Comment #52 From Federico Ferri 2009-05-01 19:30:12 0000 -------
please, include with your reports the output of:

# emerge -pv dev-lang/tcl dev-lang/tk x11-proto/xproto

many ppl are reporting different cases, and it becomes difficult to track the
progress of this pr

------- Comment #53 From Patrick Lauer 2009-05-01 20:17:44 0000 -------
Seems to still hit people. Reopening.

------- Comment #54 From Robert Cernansky 2009-05-03 09:25:40 0000 -------
On amd64 system here:
 - with tk-8.4.18 - broken; same error
 - with tk-8.4.18-r1 - works fine

Tested with wish and tkabber.

[ebuild   R   ] dev-lang/tcl-8.4.18  USE="threads -debug" 0 kB
[ebuild   R   ] x11-proto/xproto-7.0.14  0 kB
[ebuild   R   ] dev-lang/tk-8.4.18-r1  USE="threads -debug" 0 kB

Please stabilize tk-8.4.18-r1.

------- Comment #55 From Andrea 2009-05-04 18:23:09 0000 -------
my bugs http://bugs.gentoo.org/show_bug.cgi?id=267979 was  partially resolved
using the tk-8.4.18-r1 packages.

i say to stabilize this package

------- Comment #56 From Rodrigo Saboya 2009-05-04 19:41:10 0000 -------
Had this problem when trying to run idle. Emerging =dev-lang/tk-8.4.18-r1 fixed
it for me.

------- Comment #57 From Federico Ferri 2009-05-07 17:25:16 0000 -------
=dev-lang/tk-8.4.18-r1 is going stable soon. check bug #268174

------- Comment #58 From Federico Ferri 2009-05-12 20:10:47 0000 -------
so it's finally fixed

------- Comment #59 From Magnus Granberg 2009-05-22 23:53:02 0000 -------
Patch from comment #2 works on amd64

------- Comment #60 From fuzion 2009-05-29 20:25:00 0000 -------
Is this supposed to be fixed now?

I just finished a fresh install of Gentoo on a new computer. Insight is not
working and it seems to be the same problem. Here is some output from this new
Gentoo install (it is on a Pentium D machine). All of the other programs that I
installed are working fine. I shouldn't have to reference this PR to get
insight to work. Using 'emerge insight' should take care of everything for me.

dev ~ # emerge -p xproto

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] x11-proto/xproto-7.0.14 
dev ~ # emerge -p tk     

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] dev-lang/tk-8.5.7 
dev ~ # emerge -p insight

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] dev-util/insight-6.8 
dev ~ # insight
Tk_Init failed: Can't find a usable tk.tcl in the following directories: 
    /usr/share/insight/tk8.4 /usr/lib/tk8.4 /lib/tk8.4 /usr/library /library
/tk8.4.1/library /tk8.4.1/library

/usr/share/insight/tk8.4/tk.tcl: no event type or button # or keysym
no event type or button # or keysym
    while executing
"bind Listbox <MouseWheel> {
    %W yview scroll [expr {- (%D / 120) * 4}] units
}"
    (file "/usr/share/insight/tk8.4/listbox.tcl" line 182)
    invoked from within
"source /usr/share/insight/tk8.4/listbox.tcl"
    (in namespace eval "::" script line 1)
    invoked from within
"namespace eval :: [list source [file join $::tk_library $file.tcl]]"
    (procedure "SourceLibFile" line 2)
    invoked from within
"SourceLibFile listbox"
    (in namespace eval "::tk" script line 4)
    invoked from within
"namespace eval ::tk {
        SourceLibFile button
        SourceLibFile entry
        SourceLibFile listbox
        SourceLibFile menu
        SourceLibFile panedwindow
        SourceLibFile ..."
    invoked from within
"if {$::tk_library ne ""} {
    if {[string equal $tcl_platform(platform) "macintosh"]} {
        proc ::tk::SourceLibFile {file} {
            if {[catch {
                namesp..."
    (file "/usr/share/insight/tk8.4/tk.tcl" line 393)
    invoked from within
"source /usr/share/insight/tk8.4/tk.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list source $file]"


This probably means that tk wasn't installed properly.

dev ~ # 

------- Comment #61 From fuzion 2009-06-08 12:06:43 0000 -------
I don't have to rebuild tcl and tk to fix this problem.

Going to xproto 7.0.12 and rebuilding insight fixes it for me:
- put this line in /usr/portage/profiles/package.mask:
>=x11-proto/xproto-7.0.13
- emerge xproto
- emerge insight

Is this bug supposed to be fixed now so that the above is not required?

------- Comment #62 From Federico Ferri 2009-06-08 13:30:47 0000 -------
your problem it's not about xproto and tcl, it's insight being broken. please
report that in another bug and file it under insight.
in addition, insight ships his own (8.4) version of the tcl libraries, which
makes it more and more broken.

------- Comment #63 From hainaye 2009-09-21 09:58:14 0000 -------
Created an attachment (id=204779) [details]
.patch