summaryrefslogtreecommitdiffstats
path: root/library/ttk
diff options
context:
space:
mode:
authorhobbs <hobbs>2007-10-23 23:24:09 (GMT)
committerhobbs <hobbs>2007-10-23 23:24:09 (GMT)
commite3658d66f9314e3bff496f38883d69835a29e727 (patch)
tree0fe894c6a40a72c40b83c202e1ac74b12647677e /library/ttk
parent4080a997da8ef252595ced57e5ed4bc1ecdc13fa (diff)
downloadtk-e3658d66f9314e3bff496f38883d69835a29e727.zip
tk-e3658d66f9314e3bff496f38883d69835a29e727.tar.gz
tk-e3658d66f9314e3bff496f38883d69835a29e727.tar.bz2
* library/ttk/combobox.tcl (ttk::combobox::PopdownWindow): redo wm
transient on each drop to handle reparent-able frames. [Bug 1818441]
Diffstat (limited to 'library/ttk')
-rw-r--r--library/ttk/combobox.tcl24
1 files changed, 17 insertions, 7 deletions
diff --git a/library/ttk/combobox.tcl b/library/ttk/combobox.tcl
index 1bcca30..df76c04 100644
--- a/library/ttk/combobox.tcl
+++ b/library/ttk/combobox.tcl
@@ -1,5 +1,5 @@
#
-# $Id: combobox.tcl,v 1.6 2007/10/23 17:09:09 jenglish Exp $
+# $Id: combobox.tcl,v 1.7 2007/10/23 23:24:09 hobbs Exp $
#
# Combobox bindings.
#
@@ -234,8 +234,9 @@ namespace eval ::ttk::combobox {
proc ttk::combobox::PopdownWindow {cb} {
variable scrollbar
- if {![winfo exists $cb.popdown]} {
- set popdown [PopdownToplevel $cb.popdown]
+ set popdown $cb.popdown
+ if {![winfo exists $popdown]} {
+ PopdownToplevel $popdown
$scrollbar $popdown.sb \
-orient vertical -command [list $popdown.l yview]
@@ -254,7 +255,16 @@ proc ttk::combobox::PopdownWindow {cb} {
grid columnconfigure $popdown 0 -weight 1
grid rowconfigure $popdown 0 -weight 1
}
- return $cb.popdown
+ # to handle reparented frame/toplevel, recalculate transient each time
+ switch -- [tk windowingsystem] {
+ x11 {
+ wm transient $popdown [winfo toplevel [winfo parent $popdown]]
+ }
+ win32 {
+ wm transient $popdown [winfo toplevel [winfo parent $popdown]]
+ }
+ }
+ return $popdown
}
## PopdownToplevel -- Create toplevel window for the combobox popdown
@@ -276,19 +286,19 @@ proc ttk::combobox::PopdownWindow {cb} {
# (resp. reappear) when the parent toplevel is deactivated.
#
proc ttk::combobox::PopdownToplevel {w} {
- toplevel $w -class ComboboxPopdown
+ if {![winfo exists $w]} {
+ toplevel $w -class ComboboxPopdown
+ }
wm withdraw $w
switch -- [tk windowingsystem] {
default -
x11 {
$w configure -relief solid -borderwidth 1
wm overrideredirect $w true
- wm transient $w [winfo toplevel [winfo parent $w]]
}
win32 {
$w configure -relief solid -borderwidth 1
wm overrideredirect $w true
- wm transient $w [winfo toplevel [winfo parent $w]]
}
aqua {
$w configure -relief solid -borderwidth 0