how to test a widget if it is realized?
bonjour à tous,
I am looking for a few lignes of code to test if a widget is realized
or not. There is a Boolean function XtIsRealized(w) which, according to
it's man page, return a True if w is realized but the man page nothing
says if w is not realized. If I use this simple code :
if(XtIsRealized(w))
{
printf("I am here\n");
}
else
{
printf("I am not here\n");
}
the programe core dump and never print "I am not here" whene w is not
realized.
Can some one help me ?
thank you
NMF
Re: how to test a widget if it is realized?
sosroot wrote:[color=blue]
> bonjour à tous,
> I am looking for a few lignes of code to test if a widget is realized
> or not. There is a Boolean function XtIsRealized(w) which, according to
> it's man page, return a True if w is realized but the man page nothing
> says if w is not realized. If I use this simple code :
>
> if(XtIsRealized(w))
> {
> printf("I am here\n");
> }
> else
> {
> printf("I am not here\n");
> }
>
> the programe core dump and never print "I am not here" whene w is not
> realized.[/color]
It would be easier to answer if you gave us a bit more of context,
but I guess you are passing an invalid argument to XtIsRealized. The
"Widget" type is in fact a pointer to a struct, so a null or random
value will likely lead to a segmentation fault. Are you sure that "w"
has a valid value?
--- Casantos