summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjenglish <jenglish@flightlab.com>2008-02-23 18:41:03 (GMT)
committerjenglish <jenglish@flightlab.com>2008-02-23 18:41:03 (GMT)
commit6654ca14fff1fe29caf02e626fb790df3104bd91 (patch)
tree44fd63fc0f348539a846a76e241e28776afe8f62
parent0c1706a93153b2af96989598d81c96c8ad692fb9 (diff)
downloadtk-6654ca14fff1fe29caf02e626fb790df3104bd91.zip
tk-6654ca14fff1fe29caf02e626fb790df3104bd91.tar.gz
tk-6654ca14fff1fe29caf02e626fb790df3104bd91.tar.bz2
Arrange to deliver <<ComboboxSelected>> event after listbox is unposted,
as intended [Bug 1890211]. Clarified documentation.
-rw-r--r--ChangeLog7
-rw-r--r--doc/ttk_combobox.n5
-rw-r--r--library/ttk/combobox.tcl4
-rw-r--r--tests/ttk/combobox.test24
4 files changed, 34 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 24dd3d2..734888a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2008-02-23 Joe English <jenglish@users.sourceforge.net>
+ * library/ttk/combobox.tcl, doc/ttk_combobox.n,
+ tests/ttk/combobox.test: Arrange to deliver <<ComboboxSelected>>
+ event after listbox is unposted, as intended [Bug 1890211].
+ Clarified documentation.
+
+2008-02-23 Joe English <jenglish@users.sourceforge.net>
+
* generic/ttk/ttkPanedWindow.c: Don't enforce minimum sash
thickness of 5 pixels, just use 5 as a default [FR 1898288]
diff --git a/doc/ttk_combobox.n b/doc/ttk_combobox.n
index e9e1dc7..9f3b83a 100644
--- a/doc/ttk_combobox.n
+++ b/doc/ttk_combobox.n
@@ -4,7 +4,7 @@
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
-'\" RCS: @(#) $Id: ttk_combobox.n,v 1.14 2008/01/29 15:38:00 dkf Exp $
+'\" RCS: @(#) $Id: ttk_combobox.n,v 1.15 2008/02/23 18:41:06 jenglish Exp $
'\"
.so man.macros
.TH ttk::combobox n 8.5 Tk "Tk Themed Widget"
@@ -99,7 +99,8 @@ widget commands (see \fIttk::entry(n)\fR for details):
.SH "VIRTUAL EVENTS"
The combobox widget generates a \fB<<ComboboxSelected>>\fR virtual event
when the user selects an element from the list of values.
-This event is generated after the listbox is unposted.
+If the selection action unposts the listbox,
+this event is delivered after the listbox is unposted.
.SH "SEE ALSO"
ttk::widget(n), ttk::entry(n)
.SH KEYWORDS
diff --git a/library/ttk/combobox.tcl b/library/ttk/combobox.tcl
index 401548c..2f4838f 100644
--- a/library/ttk/combobox.tcl
+++ b/library/ttk/combobox.tcl
@@ -1,5 +1,5 @@
#
-# $Id: combobox.tcl,v 1.11 2007/12/13 15:27:08 dgp Exp $
+# $Id: combobox.tcl,v 1.12 2008/02/23 18:41:07 jenglish Exp $
#
# Combobox bindings.
#
@@ -169,7 +169,7 @@ proc ttk::combobox::SelectEntry {cb index} {
$cb current $index
$cb selection range 0 end
$cb icursor end
- event generate $cb <<ComboboxSelected>>
+ event generate $cb <<ComboboxSelected>> -when mark
}
## Scroll -- Mousewheel binding
diff --git a/tests/ttk/combobox.test b/tests/ttk/combobox.test
index 3c20bd3..8f25a81 100644
--- a/tests/ttk/combobox.test
+++ b/tests/ttk/combobox.test
@@ -1,5 +1,5 @@
#
-# Tile package: combobox widget tests
+# ttk::combobox widget tests
#
package require Tk 8.5
@@ -43,6 +43,26 @@ test combobox-2.4 "current -- value not in list" -body {
.cb current
} -result -1
-test combobox-end "Cleanup" -body { destroy .cb }
+test combobox-2.end "Cleanup" -body { destroy .cb }
+
+
+test combobox-1890211 "ComboboxSelected event after listbox unposted" -body {
+ # whitebox test...
+ pack [ttk::combobox .cb -values [list a b c]]
+ set result [list]
+ bind .cb <<ComboboxSelected>> {
+ lappend result Event [winfo ismapped .cb.popdown] [.cb get]
+ }
+ lappend result Start 0 [.cb get]
+ ttk::combobox::Post .cb
+ lappend result Post [winfo ismapped .cb.popdown] [.cb get]
+ .cb.popdown.l selection clear 0 end; .cb.popdown.l selection set 1
+ ttk::combobox::LBSelected .cb.popdown.l
+ lappend result Select [winfo ismapped .cb.popdown] [.cb get]
+ update
+ set result
+} -result [list Start 0 {} Post 1 {} Select 0 b Event 0 b] -cleanup {
+ destroy .cb
+}
tcltest::cleanupTests