Re: window visibility notification



On Sat, 5 Aug 2000, Ben K wrote:

> i have a program that updates a few labels very frequently based on some 
> system stuff.  there is an idle function that uses up a great deal of 
> processing power.  what i want to do is only have it update when it is on 
> the screen, thereby reducing the amount of processor it takes up; if i want 
> it to stop sucking resources, i'll just collapse it or move it to another 
> desktop etc.
> 
> i looked at GDK_VISIBILITY_NOTIFY_MASK, but it seems like i would have to 
> make a lot of assumptions in order to use this.  if i collapse the window, 
> it creates two of these events, if i move to another desktop it only makes 
> one.  my initial idea was to have a counter that increments each time the 
> visibility function is called, and it would toggle the updating based on the 
> parity of the counter.

  I don't think that not performing drawing on labels of invisble window and
performing drawing will differ that much in CPU utilization (the only
exception is when strings drawn in labels differ in size greatly, that leads
to constant resizing of the window). If I were you, I wouldn't bother with it
at all.
  As for checking the visibility of widget - may be GTK_WIDGET_VISIBLE() will
be the solution (I don't know what it returns)?

> if anyone has any ideas about this, of has done it before, thanks for your 
> response.
> -ben k.
> 
> ________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
> 
> 
> _______________________________________________
> gtk-list mailing list
> gtk-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtk-list
> 

 Best regards,
  -Vlad





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