On 23-Oct-00 at 18:46, hector duque ([EMAIL PROTECTED]) wrote:

> 1) My lesstif application create a push button widget.

> 2) Then, a call back procedure is activated. This CB has a loop which
> put a pixmap into de button by each time in the loop (N times).
> Something like:
> 
>        for (i=0; i<N; i++){
> 
>                  XpmCreatePixmapFromData( ....)
> 
>                  other  ....
> 
>                   XtVaSetValues(DISPLAYbutton,
>                     XmNlabelType, XmPIXMAP,

Set the labelType resource at the widget creation time. You don't neet so
repeat this every time.

>                     XmNlabelPixmap, pixmapP,
>                 NULL);
>                 .
>          }
> 
> the problem:   I only got the last update on the button; I mean, I
> expected to see N pixmaps into the button, in secuence, one after the
> last one, but not, I only see the last one.

You are using the wrong approach here. Both Xt and Xlib cache most of the
requests and flush them in blocks. This means that a sequence of
XtVaSetValues may not work as you want. Consider the option of creating a
list of pixmaps and using XtAppAddTimeout to register a function to change
the labelPixmap resource at each n milliseconds.

BTW, the AnimatedButton widget, available in Xlt, does exactly what you
want to do.
  
--
Carlos A. M. dos Santos

Federal University of Pelotas         Meteorological Research Center
Av. Ildefonso Simoes Lopes 2791       Pelotas, RS, Brasil, CEP 96060-290
WWW: http://www.cpmet.ufpel.tche.br   RENPAC (X.25): 153231641
Phone: +55 53 277-6767                FAX: +55 53 277-6722

Reply via email to