Tk Library Source Code

View Ticket
Login
Ticket UUID: 2762361
Title: ComboBox Backround error "ambiguous state"
Type: Bug Version: None
Submitter: oehhar Created on: 2009-04-14 15:54:41
Subsystem: bwidget Assigned To: damonc
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2009-06-10 15:07:52
Resolution: Accepted Closed By: oehhar
    Closed on: 2009-06-10 08:07:52
Description:
A backround error was invoked using a BWidget combo box:

> ambiguous state "": must be active, disabled, or normal
>     (processing "-state" option)
>     invoked from within
> "$path configure $realopt $value"
>     (procedure "Widget::_test_tkresource" line 7)
>     invoked from within
> "$_optiontype($type) $option $value [lindex $optdesc 3]"
>     (procedure "Widget::configure" line 31)
>     invoked from within
> "Widget::configure $path $args"
>     (procedure "configure" line 2)
>     invoked from within
> "configure $path -state $_grab(oldstate)"
>     (procedure "ArrowButton::_leave" line 6)
>     invoked from within
> "ArrowButton::_leave .wizard.layoutFrame.advanced.clientArea.c1.a.c"
>     (command bound to event)

This indicates, that the leave event may be invoked without a former enter event.

To fortify the widget against this situation, the following two patches may be used:

arrow.tcl Line 73:
Old contents:
    array set _grab {current "" pressed "" oldstate "" oldrelief ""}
New contents:
    array set _grab {current "" pressed "" oldstate "normal" oldrelief ""}

Alternate patch:
(Line 436)
proc ArrowButton::_leave { path } {
...
configure $path -state $_grab(oldstate)
...
The configure line may be protected to empty string contents by:
if {0 == [string length $_grab(oldstate)]} {
    configure $path -state $_grab(oldstate)
}

Version information:
BWidget 1.8.0
TCL8.4.16
Windows XP (not shure)
User Comments: oehhar added on 2009-06-10 15:07:52:
Updated in cvs