[ Usenet FAQs | Web FAQs | Documents | RFC Index ]
    Search the FAQ Archives

Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page

Top Document: comp.windows.x Frequently Asked Questions (FAQ) 6/7
Previous Document: 146) Why don't XtConfigureWidget/XtResizeWidget/XtMoveWidget work?
Next Document: 147) Why can't I get data back in my callback procedure?


140)+ How do I check whether an Xt widget is still valid?



You may be tempted to use a check like this one to determine whether the
widget has yet to be destroyed:

	(XtWindowToWidget(XtDisplay(toplevel), XtWindow(widget)) == widget)

However, this is not a robust solution. It depends on assumptions about how
Xt uses memory allocation and how that memory allocation works; in addition,
it assumes that no subsequent widgets are created with the same handle and
window id.

In addition, XtIsWidget() simply checks whether an existing, valid object
is a widget or a gadget. It can't be used to check for current existence.

In general, you should track destruction, possibly by using
XtNdestroyCallback callbacks.



Top Document: comp.windows.x Frequently Asked Questions (FAQ) 6/7
Previous Document: 146) Why don't XtConfigureWidget/XtResizeWidget/XtMoveWidget work?
Next Document: 147) Why can't I get data back in my callback procedure?

Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page


[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
faq%craft@uunet.uu.net (X FAQ maintenance address)

Last Update October 22 2009 @ 05:36 AM

Some parts © 2009 Advameg, Inc.