home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / windows / x / 21005 < prev    next >
Encoding:
Internet Message Format  |  1993-01-11  |  2.2 KB

  1. Path: sparky!uunet!spool.mu.edu!hri.com!noc.near.net!gateway!miki!oj
  2. From: oj@miki.pictel.com (Oliver Jones)
  3. Newsgroups: comp.windows.x
  4. Subject: Re: Does XtCloseDisplay() destroys windows?
  5. Message-ID: <1993Jan11.152252.534@miki.pictel.com>
  6. Date: 11 Jan 93 15:22:52 GMT
  7. References: <1iin9eINN2lr@charnel.ecst.csuchico.edu>
  8. Reply-To: oj@world.std.com
  9. Organization: PictureTel Corporation
  10. Lines: 43
  11.  
  12. In article <1iin9eINN2lr@charnel.ecst.csuchico.edu> durian28@ecst.csuchico.edu (dl) writes:
  13. >
  14. >I am writing a single application context program with multiple displays
  15. >in hpux 8.0/Motif1.1 environment.
  16. >
  17. >I seemed to have problems with XtCloseDisplay().
  18. >
  19. >    1. Created a display with XtOpenDisplay() and used XtAppCreateShell(),
  20. >         XtCreatePopupShell() to create a toplevel widget as the parent
  21. >            for other windows in that display.
  22. >        2. Then, I remove the display with XtCloseDisplay().
  23. >    3. When I reopens the same display (step #1) and 
  24.             tried to create widgets,
  25. >        I get the following warning:
  26. >           "Warning: Try to change value of a registered window."
  27. >         and then core dumps.
  28.  
  29. When you close the display, destroy all the widgets associated with
  30. that display connection.  (XtDestroyWidget on the top level shell will
  31. do the trick.)  The widgets have corresponding windows on the X
  32. server, and closing the display connection destroys the windows (there
  33. is a way around this, by changing the connection's close-down mode,
  34. but it won't help you much).
  35.  
  36. Use X11R5 Xt Intrinsics.  (Earlier versions are known to be buggy in
  37. this respect.)
  38.  
  39. >Temporary solution:
  40. > - Instead of XtCloseDisplay(), I use 
  41.       XtDestroyWidget() on the toplevel widget.
  42.       Now, the program runs perfectly, I think.  
  43.       Will there be any future problem
  44. >     by not closing those displays with XtCloseDisplay()?
  45.  
  46. I'm a little confused by your question.  I take it you want
  47. to cease displaying anything on one or more of your program's
  48. multiple displays.  Destroying the widgets does indeed remove
  49. all the visible evidence of the display connection.  However,
  50. if your program has no further use for a particular X server,
  51. you should ALSO close the display connection (to free up the
  52. port on the server).
  53.  
  54. Oliver Jones
  55.