OSDN Git Service

* library/managedwin.itb (_create): If given a transient window,
authorkseitz <kseitz>
Thu, 14 Feb 2002 02:39:13 +0000 (02:39 +0000)
committerkseitz <kseitz>
Thu, 14 Feb 2002 02:39:13 +0000 (02:39 +0000)
make sure that the SrcWin that is to become its master exists;
otherwise, use ".".

gdb/gdbtk/ChangeLog
gdb/gdbtk/library/managedwin.itb

index aad3007..473410b 100644 (file)
@@ -1,3 +1,9 @@
+2002-02-13  Keith Seitz  <keiths@redhat.com>
+
+       * library/managedwin.itb (_create): If given a transient window,
+       make sure that the SrcWin that is to become its master exists;
+       otherwise, use ".".
+
 2002-02-12  Keith Seitz  <keiths@redhat.com>
 
        From Don Bowman <don@sandvine.com>:
index 53d3d42..59a2cbd 100644 (file)
@@ -255,7 +255,17 @@ body ManagedWin::_create { class args } {
 
   if {$transient} {
     wm resizable $top 0 0
-    wm transient $top [winfo toplevel [namespace tail [lindex [ManagedWin::find SrcWin] 0]]]
+
+    # If a SrcWin is around, use its toplevel as the master for
+    # the transient. Otherwise use ".". (The splash screen will
+    # need ".", for example.)
+    set srcs [ManagedWin::find SrcWin]
+    if {[llength $srcs] > 0} {
+      set w [winfo toplevel [namespace tail [lindex $srcs 0]]]
+    } else {
+      set w .
+    }
+    wm transient $top $w
   } elseif {$::tcl_platform(platform) == "unix"} {
     # Modal dialogs DONT get Icons...
     if {[pref get gdb/use_icons] && ![$newwin isa ModalDialog]} {