🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #24800

Re: Does XtCloseDisplay() destroys windows?

#24800
From: Oliver Jones
Date: Mon, 11 Jan 1993 15:22
43 lines
2294 bytes
In article <1iin9eINN2lr@charnel.ecst.csuchico.edu> durian28@ecst.csuchico.edu (dl) writes:
>
>I am writing a single application context program with multiple displays
>in hpux 8.0/Motif1.1 environment.
>
>I seemed to have problems with XtCloseDisplay().
>
>	1. Created a display with XtOpenDisplay() and used XtAppCreateShell(),
>	     XtCreatePopupShell() to create a toplevel widget as the parent
>            for other windows in that display.
>        2. Then, I remove the display with XtCloseDisplay().
>	3. When I reopens the same display (step #1) and 
            tried to create widgets,
>	    I get the following warning:
>   		"Warning: Try to change value of a registered window."
>	     and then core dumps.

When you close the display, destroy all the widgets associated with
that display connection.  (XtDestroyWidget on the top level shell will
do the trick.)  The widgets have corresponding windows on the X
server, and closing the display connection destroys the windows (there
is a way around this, by changing the connection's close-down mode,
but it won't help you much).

Use X11R5 Xt Intrinsics.  (Earlier versions are known to be buggy in
this respect.)

>Temporary solution:
> - Instead of XtCloseDisplay(), I use 
      XtDestroyWidget() on the toplevel widget.
      Now, the program runs perfectly, I think.  
      Will there be any future problem
>     by not closing those displays with XtCloseDisplay()?

I'm a little confused by your question.  I take it you want
to cease displaying anything on one or more of your program's
multiple displays.  Destroying the widgets does indeed remove
all the visible evidence of the display connection.  However,
if your program has no further use for a particular X server,
you should ALSO close the display connection (to free up the
port on the server).

Oliver Jones
Technical Details
Message-ID: <1993Jan11.152252.534@miki.pictel.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!hri.com!noc.near.net!gateway!miki!oj
References: <1iin9eINN2lr@charnel.ecst.csuchico.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!hri.com!noc.near.net!gateway!miki!oj
From: oj@miki.pictel.com (Oliver Jones)
Newsgroups: comp.windows.x
Subject: Re: Does XtCloseDisplay() destroys windows?
Message-ID: <1993Jan11.152252.534@miki.pictel.com>
Date: 11 Jan 93 15:22:52 GMT
References: <1iin9eINN2lr@charnel.ecst.csuchico.edu>
Reply-To: oj@world.std.com
Organization: PictureTel Corporation
Lines: 43