Menu

#110 HList's "header exists" command doesn't work due a typo

bug
open
nobody
None
5
2015-12-19
2015-12-19
No

According to the documentation the HList widget supports the "header exists" command:

          pathName header exists col
                 Return true if an header display item exists for the col-th column; return false otherwise.

But actually this command doesn't work due to a typo in sources. "header exist" works instead.

I think that to conformance with the documentation and other commands "exist" should be fixed to "exists". But for backward compatibility "exist" should be supported as an alias to "exists".

This bug was reported on Python tracker: http://bugs.python.org/issue25464 .

Discussion

  • Serhiy Storchaka

    Here is a patch (inlined, attaching doesn't work for me).

    ? hlist_header_exists.patch
    Index: generic/tixHLHdr.c
    ===================================================================
    RCS file: /cvsroot/tix/tix/generic/tixHLHdr.c,v
    retrieving revision 1.3
    diff -u -r1.3 tixHLHdr.c
    --- generic/tixHLHdr.c 28 Mar 2004 02:44:56 -0000 1.3
    +++ generic/tixHLHdr.c 19 Dec 2015 10:02:32 -0000
    @@ -343,6 +343,8 @@
    "column ?option value ...?"},
    {TIX_DEFAULT_LEN, "delete", 1, 1, Tix_HLHdrDelete,
    "column"},
    + {TIX_DEFAULT_LEN, "exists", 1, 1, Tix_HLHdrExist,
    + "column"},
    {TIX_DEFAULT_LEN, "exist", 1, 1, Tix_HLHdrExist,
    "column"},
    {TIX_DEFAULT_LEN, "size", 1, 1, Tix_HLHdrSize,
    Index: tests/hlist/HLHdr.tcl
    ===================================================================
    RCS file: /cvsroot/tix/tix/tests/hlist/HLHdr.tcl,v
    retrieving revision 1.2
    diff -u -r1.2 HLHdr.tcl
    --- tests/hlist/HLHdr.tcl 13 Nov 2002 21:12:18 -0000 1.2
    +++ tests/hlist/HLHdr.tcl 19 Dec 2015 10:02:32 -0000
    @@ -76,6 +76,14 @@
    test {puts [$h header size 1]}

    +# Test for exists
    +#
    +test {$h header exists} {args}
    +test {$h header exists hello hi} {args}
    +test {$h header exists 4} {exist}
    +test {puts [$h header exists 0]}
    +test {puts [$h header exists 1]}
    +
    # Test for exist
    #
    test {$h header exist} {args}

     
    • Serhiy Storchaka

      Trying to attach a patch via e-mail.

       

Log in to post a comment.