From e3658d66f9314e3bff496f38883d69835a29e727 Mon Sep 17 00:00:00 2001 From: hobbs Date: Tue, 23 Oct 2007 23:24:09 +0000 Subject: * library/ttk/combobox.tcl (ttk::combobox::PopdownWindow): redo wm transient on each drop to handle reparent-able frames. [Bug 1818441] --- ChangeLog | 5 +++++ library/ttk/combobox.tcl | 24 +++++++++++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1c37726..033dcdc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-10-23 Jeff Hobbs + + * library/ttk/combobox.tcl (ttk::combobox::PopdownWindow): redo wm + transient on each drop to handle reparent-able frames. [Bug 1818441] + 2007-10-23 Joe English * library/ttk/combobox.tcl: [namespace import ::ttk::scrollbar] 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 -- cgit v0.12