Re: How to limit signal propagation?

On Thu, Jun 01, 2006 at 05:06:16PM +0200, Daniel Haude wrote:

This widget has no less than five adjustments associated with it -- the  
widget lets the user select a rectangular region from a large square area;  
the rectangle has a center point, a width, a height, and it can be  
rotated. These five parameters are also reflected onto five spinbuttons.

As the user drags and rotates the rectangle with the mouse, the widget  
keeps emitting "value_changed" signals to the five adjustments so that the  
spinbuttons' contents are continuously updated. Of course the  
"value_changed" signals are also reflected back into the widget's five  
callbacks, each of which initiates the recalculation of the rectangle's  
corners' coordinates and a re-draw of the window. That's five redraws  
where one will do.

gtk_widget_queue_draw(widget) just invalidates the complete
widget window. Therefore it is [locally] idempotent and once
the main loop gets to redrawing -- which happens after all
the signal processing -- the widget is redrawn. Once.

So how it comes your widget is redrawn five times?


Anonyms eat their boogers.

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