how to test a widget if it is realized? - Motif

This is a discussion on how to test a widget if it is realized? - Motif ; 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 ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: how to test a widget if it is realized?

  1. 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


  2. Re: how to test a widget if it is realized?


    sosroot wrote:
    > 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.


    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


+ Reply to Thread