home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / tcl / 2189 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  1.9 KB

  1. Path: sparky!uunet!spool.mu.edu!agate!sprite.Berkeley.EDU!ouster
  2. From: ouster@sprite.Berkeley.EDU (John Ousterhout)
  3. Newsgroups: comp.lang.tcl
  4. Subject: Re: Tk3.0 bug?
  5. Date: 21 Dec 1992 19:37:29 GMT
  6. Organization: U.C. Berkeley Sprite Project
  7. Lines: 59
  8. Distribution: world
  9. Message-ID: <1h56dpINNfvt@agate.berkeley.edu>
  10. References: <SLS.92Dec18163617@batcomputer.aero.org>
  11. NNTP-Posting-Host: tyranny.berkeley.edu
  12.  
  13. In article <SLS.92Dec18163617@batcomputer.aero.org>, sls@aero.org (Sam Shen) writes:
  14. |> This short script puts up a button and another toplevel window .hello.
  15. |> The button alternately does a wm withraw .hello/wm deiconify .hello.
  16. |> This works fine with tk2.3, but under tk3.0 the .hello window never
  17. |> shows up.  I'm running on a sparc 2/SunOS 4.1.1/MIT X11R5.
  18. |> 
  19. |>     -Sam
  20. |> 
  21. |> toplevel .hello
  22. |> pack append .hello \
  23. |>     [label .hello.l -text "Hello, world!"] ""
  24. |> wm withdraw .hello
  25. |> 
  26. |> pack append . \
  27. |>     [button .b] "fill expand"
  28. |> 
  29. |> proc Show {} {
  30. |>     wm deiconify .hello
  31. |>     .b config -text "Hide" -command Hide
  32. |> }
  33. |> 
  34. |> proc Hide {} {
  35. |>     wm withdraw .hello
  36. |>     .b config -text "Show" -command Show
  37. |> }
  38. |> 
  39. |> Show
  40. |> 
  41.  
  42. Tk 3.0 appears to have broken the ability to start a window off
  43. withdrawn and later deiconify it.  Here is a patch to tkWm.c that
  44. should fix the problem.  Sorry about that...
  45.  
  46. *** /tmp/,RCSt1084779    Mon Dec 21 11:36:13 1992
  47. --- tkWm.c    Mon Dec 21 11:30:53 1992
  48. ***************
  49. *** 386,394 ****
  50.       XTextProperty textProp;
  51.       int savedX, savedY, savedFlags;
  52.   
  53. -     if (wmPtr->hints.initial_state == WithdrawnState) {
  54. -     return;
  55. -     }
  56.       if (wmPtr->flags & WM_NEVER_MAPPED) {
  57.       wmPtr->flags &= ~WM_NEVER_MAPPED;
  58.   
  59. --- 386,391 ----
  60. ***************
  61. *** 433,438 ****
  62. --- 430,438 ----
  63.           }
  64.       }
  65.       }
  66. +     if (wmPtr->hints.initial_state == WithdrawnState) {
  67. +     return;
  68. +     }
  69.       wmPtr->flags |= WM_ABOUT_TO_MAP;
  70.       UpdateGeometryInfo((ClientData) winPtr);
  71.       wmPtr->flags &= ~WM_ABOUT_TO_MAP;
  72.