Tk Library Source Code

View Ticket
Login
Ticket UUID: 1514855
Title: error when navigate in empty Tree widget
Type: Bug Version: None
Submitter: nobody Created on: 2006-06-30 04:55:35
Subsystem: bwidget Assigned To: damonc
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2006-08-22 03:57:11
Resolution: Accepted Closed By: dev_null42a
    Closed on: 2006-08-21 20:57:11
Description:
I found an error in Tree widget when navigate inside it
with keyboard.
Script to reproduce a bug:

------------------

#! /usr/bin/wish
package require Tk
package require BWidget

Tree .t
pack .t

------------------

When I focus .t widget and press Down key I saw popup
window with error message:

.t selection set: Cannot select unknown node "".
.t selection set: Cannot select unknown node "".
    while executing
"Tree::selection .t set {}"
    ("eval" body line 1)
    invoked from within
"eval [linsert $args 0 Tree::$cmd .t]"
    (procedure ".t" line 1)
    invoked from within
"$win selection set [lindex $nodes 0]"
    ("down" arm line 4)
    invoked from within
"switch -exact -- $which {
"up" {
    # Up goes to the node that is vertically above the
current node
    # (NOT necessarily the current node's pare..."
    (procedure "Tree::_keynav" line 24)
    invoked from within
"Tree::_keynav down .t"
    (command bound to event)


I use Debian Sarge with following versions of software:
* Tcl 8.4.9
* Tk 8.4.9
* BWidget 1.7.0

As I understand last version of BWidget from cvs
repository affected by this bug too.

Patch: the simplest decision is to add folowing code to
the beginning of Tree::_keynav procedure

------------------
if {[$win nodes root] eq ""} {
    return
}
------------------
User Comments: dev_null42a added on 2006-08-22 03:57:11:
Logged In: YES 
user_id=1381097

Applied in revision 1.8.