# HG changeset patch # User Diggory Hardy # Date 1237025131 -3600 # Node ID 17438f17bfb5d38fe0737b8f79dc9adf4260179f # Parent 075705ad664a027b7d3ee326962721bcb4e6aee3 Hooked redraws in for BoolContentWidget and SliderContentWidget. diff -r 075705ad664a -r 17438f17bfb5 mde/gui/widget/AChildWidget.d --- a/mde/gui/widget/AChildWidget.d Wed Feb 11 13:02:30 2009 +0000 +++ b/mde/gui/widget/AChildWidget.d Sat Mar 14 11:05:31 2009 +0100 @@ -22,7 +22,7 @@ module mde.gui.widget.AChildWidget; public import mde.gui.widget.Ifaces; -import mde.content.IContent; +import mde.content.Content; import mde.gui.exception; debug { @@ -193,6 +193,13 @@ throw new ContentException (this); } + /** Hook this function to a Content callback to cause redraws. + * + * mgr.requestRedraw could be hooked in directly if the prototype changed. */ + void contentRedraw (Content) { + mgr.requestRedraw; + } + IWidgetManager mgr; // the enclosing window IParentWidget parent; // the parent widget wdim x, y; // position diff -r 075705ad664a -r 17438f17bfb5 mde/gui/widget/miscContent.d --- a/mde/gui/widget/miscContent.d Wed Feb 11 13:02:30 2009 +0000 +++ b/mde/gui/widget/miscContent.d Sat Mar 14 11:05:31 2009 +0100 @@ -43,6 +43,7 @@ wdimPair s = mgr.renderer.getToggleSize; w = mw = s.x; h = mh = s.y; + content_.addCallback (&contentRedraw); } override IContent content () { @@ -111,6 +112,7 @@ wdimPair s = mgr.renderer.getSliderSize; w = mw = s.x; h = mh = s.y; + content_.addCallback (&contentRedraw); } override IContent content () {