Skip to content

Commit

Permalink
Fix [3c2a3a988f]: ttk entry-2.1.1 fails on Ubuntu 22.04 or xvfb.
Browse files Browse the repository at this point in the history
  • Loading branch information
fvogelnew1 committed May 3, 2024
1 parent 0045adc commit 1b0f38b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/ttk/entry.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ package require tcltest 2.2
namespace import -force tcltest::*
loadTestedCommands

testConstraint failsOnUbuntu [expr {![info exists ::env(CI)] || ![string match Linux $::tcl_platform(os)]}]
testConstraint failsOnXQuarz [expr {$tcl_platform(os) ne "Darwin" || [tk windowingsystem] ne "x11" }]

variable scrollInfo
proc scroll args {
global scrollInfo
Expand Down Expand Up @@ -84,14 +81,15 @@ test entry-2.1 "Create entry before scrollbar" -body {
-expand false -fill x
} -cleanup {destroy .te .tsb}

test entry-2.1.1 "Create entry before scrollbar - scrollbar catches up" -constraints {failsOnUbuntu failsOnXQuarz} -body {
test entry-2.1.1 "Create entry before scrollbar - scrollbar catches up" -body {
pack [ttk::entry .te -xscrollcommand [list .tsb set]] \
-expand true -fill both
-expand true -fill both
.te insert end [string repeat "abc" 50]
catch {update} ; # error triggers because the -xscrollcommand callback
# errors out: invalid command name ".tsb"
focus -force .te ; # needed on some systems such as Ubuntu (see ticket [3c2a3a988f])
pack [ttk::scrollbar .tsb -orient horizontal -command [list .te xview]] \
-expand false -fill x
-expand false -fill x
update ; # no error
set res [expr [lindex [.tsb get] 1] < 1] ; # scrollbar did update
} -result 1 -cleanup {destroy .te .tsb}
Expand Down

0 comments on commit 1b0f38b

Please sign in to comment.