From 014b4675af8c2a789caf37365b6ff284c3981006 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 13 Nov 2016 15:14:38 +0000 Subject: Added test combobox-3 to check [f60c54bec6] --- tests/ttk/combobox.test | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/ttk/combobox.test b/tests/ttk/combobox.test index 43f3cf1..c134bfc 100644 --- a/tests/ttk/combobox.test +++ b/tests/ttk/combobox.test @@ -45,6 +45,15 @@ test combobox-2.4 "current -- value not in list" -body { test combobox-2.end "Cleanup" -body { destroy .cb } +test combobox-3 "Read postoffset value dynamically from current style" -body { + ttk::combobox .cb -values [list a b c] -style "DerivedStyle.TCombobox" + pack .cb -expand true -fill both + ttk::style configure DerivedStyle.TCombobox -postoffset [list 25 0 0 0] + ttk::combobox::Post .cb + winfo x .cb.popdown +} -result 25 -cleanup { + destroy .cb +} test combobox-1890211 "ComboboxSelected event after listbox unposted" -body { # whitebox test... -- cgit v0.12 From c3149fa0b5bd697ccb9d9afafc37b3aa55739af1 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sun, 13 Nov 2016 15:15:46 +0000 Subject: Fix for [f60c54bec6] Combobox does not retrieve -postoffset value from correct style. Thanks to Daniele Panza. --- library/ttk/combobox.tcl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/ttk/combobox.tcl b/library/ttk/combobox.tcl index 03821a2..6ceccef 100644 --- a/library/ttk/combobox.tcl +++ b/library/ttk/combobox.tcl @@ -368,7 +368,8 @@ proc ttk::combobox::PlacePopdown {cb popdown} { set y [winfo rooty $cb] set w [winfo width $cb] set h [winfo height $cb] - set postoffset [ttk::style lookup TCombobox -postoffset {} {0 0 0 0}] + set style [$cb cget -style] + set postoffset [ttk::style lookup $style -postoffset {} {0 0 0 0}] foreach var {x y w h} delta $postoffset { incr $var $delta } -- cgit v0.12 From 690db09c143da53cd3adebb52f8eac12db5c767c Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Fri, 18 Nov 2016 13:12:18 +0000 Subject: constrain new test-case to UNIX only, since on Windows the test-result appears to depend on the window's border. --- tests/ttk/combobox.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ttk/combobox.test b/tests/ttk/combobox.test index c134bfc..35ded6c 100644 --- a/tests/ttk/combobox.test +++ b/tests/ttk/combobox.test @@ -45,7 +45,7 @@ test combobox-2.4 "current -- value not in list" -body { test combobox-2.end "Cleanup" -body { destroy .cb } -test combobox-3 "Read postoffset value dynamically from current style" -body { +test combobox-3 "Read postoffset value dynamically from current style" -constraints unix -body { ttk::combobox .cb -values [list a b c] -style "DerivedStyle.TCombobox" pack .cb -expand true -fill both ttk::style configure DerivedStyle.TCombobox -postoffset [list 25 0 0 0] -- cgit v0.12