summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorhobbs <hobbs>2007-10-23 23:24:09 (GMT)
committerhobbs <hobbs>2007-10-23 23:24:09 (GMT)
commita1ef21ff8b966e9102de46c4ec958e0df0b00276 (patch)
tree0fe894c6a40a72c40b83c202e1ac74b12647677e /library
parenta33722a5bcdf2b5f88d19909557ccdcf354291e3 (diff)
downloadtk-a1ef21ff8b966e9102de46c4ec958e0df0b00276.zip
tk-a1ef21ff8b966e9102de46c4ec958e0df0b00276.tar.gz
tk-a1ef21ff8b966e9102de46c4ec958e0df0b00276.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')
-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