Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.windows.x Frequently Asked Questions (FAQ) 6/7
Section - 140)+ How do I check whether an Xt widget is still valid?

( Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Forum archive ]


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?
See reader questions & answers on this topic! - Help others by sharing your knowledge

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.

User Contributions:

Comment about this article, ask questions, or add new information about this topic:




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 March 27 2014 @ 02:12 PM