[comp.windows.x.motif] LabelGadget problems

pasturel@sctc.com (Pierre Pasturel) (11/10/90)

I have a call back that looks like this:

Callback()
        n = 0;
        label_string = XmStringCreateLtoR (".. processing", charset);
        XtSetArg (args[n], XmNlabelString, label_string); n++;
        XtSetValues( prompt_display, args, n);
        XFlush(display_ptr);

        ... processing stuff (takes a few seconds to execute)

        n = 0;        
        label_string = XmStringCreateLtoR (" finished processing", charset);
        XtSetArg (args[n], XmNlabelString, label_string); n++;
        XtSetValues( prompt_display, args, n);
        XFlush(display_ptr);

end of callback.


 where prompt_display is a LabelGadget widget.


The problem that I'm having is that the label becomes blank after
the first XtSetValues, and it doesn't get updated until after
the callback finishes executing, by which time it comes up with
"finished processing" from the second setting of the labelString.


I tried using XSync(display_ptr, false) instead of XFlush(), but that
didn't work either.

I also tried creating prompt_display as a Label widget and that didn't
work either.

I finally used Text widgets instead of LabelGadgets and they work fine (ie they
update their XmNvalue ok), but I really want to use labels instead.

Anyone else have this problem or have any suggestions?
I'm using motif 1.0.

Pierre
pasturel@sctc.com

nazgul@alphalpha.com (Kee Hinckley) (11/14/90)

> The problem that I'm having is that the label becomes blank after
> the first XtSetValues, and it doesn't get updated until after
> the callback finishes executing, by which time it comes up with
> "finished processing" from the second setting of the labelString.

I seem to recall someone once saying that labelGadgets do text
display by doing a clear and waiting for an expose event, at
which point they draw the text.

nazgul@alphalpha.com (Kee Hinckley) (11/14/90)

>   how, then, do you force an expose event to occur so the update occurs
> when you want it to???

Assuming that this is the problem you'll have to set up some way
of getting called when the expose occurs and then doing the work.
The expose event will occur when the server gets the clear.

pasturel@SCTC.COM (Pierre Pasturel) (11/14/90)

> The problem that I'm having is that the label becomes blank after
> the first XtSetValues, and it doesn't get updated until after
> the callback finishes executing, by which time it comes up with
> "finished processing" from the second setting of the labelString.

I seem to recall someone once saying that labelGadgets do text
display by doing a clear and waiting for an expose event, at
which point they draw the text.


==>

  how, then, do you force an expose event to occur so the update occurs
when you want it to???

Pierre
pasturel@sctc.com

mikey@eukanuba.wpd.sgi.com (Mike Yang) (11/15/90)

In article <9011132157.AA13392@SCTC.COM>, pasturel@SCTC.COM (Pierre Pasturel) writes:
|>   how, then, do you force an expose event to occur so the update occurs
|> when you want it to???

Use XmUpdateDisplay to force handling of exposure events.

-----------------------------------------------------------------------
                 Mike Yang        Silicon Graphics, Inc.
               mikey@sgi.com           415/335-1786