Re: [gtk-list] Re: blinking





On Thu, 24 Feb 2000, Matthew wrote:

> 
> Because it works, and we're releasing tomorrow :).  Give me an example.
> 
> Matthew
> 
> 
> > > int
> > > active_step(
> > >     int counter)
> > > {
> > >     counter /= 12;
> > > 
> > >     if (counter) {
> > > 	gtk_pixmap_set(GTK_PIXMAP(pixmap), pixmaps[(counter%12)+1], masks[(counter%12)+1]);
> > > 	while(gtk_events_pending())
> > > 	    gtk_main_iteration();
> > >     }
> > >     return 1;
> > > }
> > > 
> >  Why don't you use a timeout instead?
> > <ADRIAN>
> 

I just suppoused that you've got a good reason for not using it. What I'd
do is something like this:

  blink_timer = gtk_timeout_add(BLINK_TIME_INTERVAL, draw_new_pixmap,
pixmaps);


  where BLINK_TIME_INTERVAL is the time interval between sucesive pixmaps
(in microseconds I guess, GTK manual for details), and draw_new_pixmap is
tha function you use to draw a new pixmap (pixmaps is the argument).

 I think it should work. For more details, it's well explained in the GTK
tutorial.

 Hope this helps,
 Regards,
<ADRIAN> 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]