[comp.windows.x] Widget re-display

dan@juniper.uucp (Dan Galewsky) (08/05/88)

I have built a 'gauge' widget which is roughly based on the 'clock' widget.  It
has an internal timer which wakes up periodically and checks to see if the value
of the gauge has changed.  If it has, it erases the hand and redraws it at the
new position for the current value.  Clients of this widget change its value by
setting an attribute of the gauge widget and may do so at a frequency different
than the internal timing interval.

When I run this widget as a simple widget as a direct child of the root widget
it works fine and updates correctly without doing a redisplay except when it
becomes un-obscured or when it changes size.

When I try to use this widget as a child of a constraint widget, it gets an
expose event every time the value is changed which causes my expose redisplay
routine to execute and redisplay the whole widget.

All I want to do is redraw the hands when the value has changed between 
internal wake-ups without having the whole widget redrawn .
How can I keep the widget from having to redraw itself when the value 
changes?

(note: when my SetValues routine is called with the new widget value it is
correclty returning FALSE for the redisplay)

		Thanks
		Dan Galewsky
		galewsky%asc@sdr.slb.com

swick@ATHENA.MIT.EDU (Ralph R. Swick) (08/10/88)

> When I try to use this widget as a child of a constraint widget, it gets an
> expose event every time the value is changed which causes my expose redisplay
> routine to execute and redisplay the whole widget.

Sounds like your constraint widget is broken.  What widget are you
using as the parent?  Remember that when the parent is a constraint
widget, its constraint.set_values method will be called as well when
you change the value in the child.