A Widget Library
Ticket Change Details
Not logged in
Overview

Artifact ID: 61b0467dd0cf048d2c054166d624071325202d46
Ticket: 61882d12fbf6ae337d6e6900a26c928362160a90
Bwidet combobox does not always show selected item in list
User & Date: anonymous 2016-02-26 15:16:16
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    Corrected version of mapliste which calls see on the listbos with some delay.
    The listbox does not properly scroll to the selected entry on FIRST open! The patch fixes the problem.
    
    proc ComboBox::_mapliste { path } {
        set listb $path.shell.listb
        if {[winfo exists $path.shell] &&
            [string equal [wm state $path.shell] "normal"]} {
    	_unmapliste $path
            return
        }
    
        if { [Widget::cget $path -state] == "disabled" } {
            return
        }
        if {[llength [set cmd [Widget::getMegawidgetOption $path -postcommand]]]} {
            uplevel \#0 $cmd
        }
        if { ![llength [Widget::getMegawidgetOption $path -values]] } {
            return
        }
    
        _recreate_popup $path
    
        ArrowButton::configure $path.a -relief sunken
        update
    
        set bw [Widget::cget $path -bwlistbox]
    
        $listb selection clear 0 end
        set values [Widget::getMegawidgetOption $path -values]
        set curval [Entry::cget $path.e -text]
        if { [set idx [lsearch -exact $values $curval]] == -1 &&
             [set idx [lsearch -exact $values "$curval*"]] == -1 } {
            set idx 0
        }
        if {$bw} {
    	set idx [$listb items $idx]
        } else {
    	$listb activate $idx
        }
        $listb selection set $idx
        $listb see $idx
        # After idle does not work, make sure selected item is visible!
        after 100 [list $listb see $idx];
    
        set width [Widget::cget $path -listboxwidth]
        if {!$width} { set width [winfo width $path] }
        BWidget::place $path.shell $width 0 below $path
        wm deiconify $path.shell
        raise $path.shell
        BWidget::focus set $listb
        if {! $Widget::_aqua } {
            BWidget::grab global $path
        }
    }
    
  5. foundin changed to: "1.9.8"
  6. is_private changed to: "0"
  7. login: "anonymous"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "720cbbf8ba21fd6982dfd8639b4ecf45d5cf11a3"
  10. resolution changed to: "None"
  11. severity changed to: "Severe"
  12. status changed to: "Open"
  13. submitter changed to: "anonymous"
  14. subsystem changed to: "bwidget"
  15. title changed to:
    Bwidet combobox does not always show selected item in list
    
  16. type changed to: "Bug"