Bug 45570

Summary: DirTree is broken with Tix python module.
Product: [Retired] Red Hat Linux Reporter: Theodore Roth <troth>
Component: tcltkAssignee: Jens Petersen <petersen>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: low Docs Contact:
Priority: medium    
Version: 7.1CC: support
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: 8.1.4-89 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-06-27 02:46:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Theodore Roth 2001-06-22 23:12:16 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.2-2_troth_smp i686)

Description of problem:
In trying to use the DirTree class from the Tix module in python I
get a TclError and stack trace.

How reproducible:
Always

Steps to Reproduce:
Run this python script:

#!/usr/bin/python
from Tix import *
root = Tk()
DirTree(root).pack(expand=YES, fill=BOTH)
root.mainloop()


Actual Results:  Here's the output:

Traceback (most recent call last):
 File "./dirTree.py", line 11, in ?
  DirTree(root, showhidden=YES).pack(expand=YES, fill=BOTH)
 File "/usr/lib/python2.1/lib-tk/Tix.py", line 476, in __init__
  TixWidget.__init__(self, master, 'tixDirTree', ['options'], cnf, kw)
 File "/usr/lib/python2.1/lib-tk/Tix.py", line 151, in __init__
  apply(self.tk.call, (widgetName, self._w) + extra)
TclError: no value given for -window option.


Expected Results:  Should not generate the error and should display a dir
tree.

Additional info:

I was able to get the DirList widget to work which looks the same in tix.py
in the python distribution. Then I looked at DirList.tcl and noticed the
lines with -window were commented out. This wasn't the case in DirTree.tcl.
I commented out the lines in DirTree.tcl and it worked. Yippee! Here's my
patch for the DirTree.tcl file:

--- DirTree.tcl.orig    Fri Jun 22 16:43:10 2001
+++ DirTree.tcl Fri Jun 22 16:39:16 2001
@@ -89,10 +89,10 @@
     # We must creat an extra copy of these images to avoid flashes on
     # the screen when user changes directory
     #
-    set data(images) [image create compound -window $data(w:hlist)]
-    $data(images) add image -image [tix getimage act_fold]
-    $data(images) add image -image [tix getimage folder]
-    $data(images) add image -image [tix getimage openfold]
+#    set data(images) [image create compound -window $data(w:hlist)]
+#    $data(images) add image -image [tix getimage act_fold]
+#    $data(images) add image -image [tix getimage folder]
+#    $data(images) add image -image [tix getimage openfold]
 }
 
 proc tixDirTree:SetBindings {w} {

Comment 1 Eido Inoue 2001-07-24 21:46:11 UTC
fixed in release 61.


Comment 2 Need Real Name 2002-02-01 02:01:52 UTC
I have my doubts about this patch - it's very rare you fix Python Tix problems
by changing the Tcl. What is the RCS header on the Tix.py file?

The code that is commented out works in Tcl, and the error message makes
me think that it is a Tix.py problem. Could you try replacing the Tix.py file with
the one in the latest Tix release 8.1.3 from http://tix.sourceforge.net ?
When I use that Tix with python 2.1 it works without the patch.

I've opened a bug report on tix.sourceforge.net for this:
http://sourceforge.net/tracker/index.php?func=detail&aid=510928&group_id=5649&atid=105649

Could you explain this part more for me? I don't understand what you mean:
" I was able to get the DirList widget to work which looks the same in tix.py
 in the python distribution. Then I looked at DirList.tcl and noticed the
 lines with -window were commented out. This wasn't the case in DirTree.tcl.
 I commented out the lines in DirTree.tcl and it worked."



Comment 3 Theodore Roth 2002-02-02 18:50:26 UTC
Tix.py version from Python-2.1.1 on my system is "$Id: Tix.py,v 1.2 2001/03/21
17:24:49 moshez Exp $"

Explanation:

The code for DirList and DirTree in tix.py are identical (except for tixDirList
being tixDirTree). I compared the DirList.tcl and DirTree.tcl files and noticed
the lines with -window were commented out in DirList.tcl but not in DirTree.tcl.
Since the -window option showed up in the python exception when using DirTree, I
commented it out and things worked.

I just ran the test script I provided on my Redhat-7.2 system
(/usr/lib/tix8.2/DirTree.tcl) with and without the lines in question commented
out. It worked in both cases, thus you are probably right that my patch is not
the correct solution to the (now non-existant with 7.2) problem.

My 7-1 system has tix-4.1.0.6-53 and my 7.2 system has tix-8.2.0b1-65. Maybe the
problem was fixed along the way.

Comment 4 Jens Petersen 2002-12-03 14:33:38 UTC
Ok, I'll be dropping the patch in the coming tix-8.1.3 package.  Thanks!

Comment 5 Jens Petersen 2002-12-10 07:09:21 UTC
The patch is no longer in tcltk-8.3.5-76.
However I am not able to get the above test to run in
the above package release.  I get:

Traceback (most recent call last):
  File "test.py", line 3, in ?
    root = Tk()
  File "//usr/lib/python2.2/lib-tk/Tix.py", line 213, in __init__
    self.tk.eval('package require Tix')
TclError: couldn't load file "/usr/share/libtix8.1.8.3.so":
/usr/share/libtix8.1.8.3.so: cannot open shared object file: No such file or
directory

Looks a problem with the tix installation, which I'll look into.

Comment 6 Need Real Name 2002-12-11 08:04:53 UTC
Glad the first bug is closed.

/usr/share/libtix8.1.8.3.so looks like it should be /usr/share/lib/tix8.1.8.3.so
- I've never heard of this happening on any linux system I know of.
Is this with a default canonical configure/make/install?

I have a new minor release ready to go but not yet announced.
Would you like to try it out and see if there are any problems
before I announce it. It's a bugfix release with no major changes
to the configure/make.

http://tix.sourceforge.net/dist/tix-8.1.4.tar.gz


Comment 7 Jens Petersen 2002-12-12 02:29:55 UTC
Actually I think it should be "/usr/lib/libtix8.1.8.3.so".
The thing is I'm installing the arch independent files under
datadir (ie "/usr/share/tix8.1"); by default they end up under
libdir.  So I suspect there is a relative path somewhere, like
"../libtix8.1.8.3.so" which breaks when noarch files are in datadir
and arch dependent files in libdir.

Thanks for the heads-up about 8.1.4.  I'll try to take a look
at it.

Comment 8 Jens Petersen 2003-03-20 16:28:22 UTC
The problem of comment 5 should be fixed in tix-8.1.4-89.