PDA

View Full Version : Force Window Instance Redraw



dulux-oz
April 1st, 2017, 04:24
Hi Guys,

Is there a way (ie a function or technique) to force the system to redraw a window instance (programmatically)?

My issue is that a dynamically sized subwindow is being drawn too big and I need to trigger a redraw, because as soon as I drag the parent window's edge (even by just 1 pixel) the redraw happens and everything is AOK. I've tried issuing a resize() via the subwindow's onInit() and also via the parent's onInit(), and while the resize() does occur (verified by a Debug.console(getSize()) embedded in the resize()/onInit()) and the values given are correct, but the windowinstance is still being draw approx 105 px too wide on first viewing.

If people would like an example load up my DOE: Alignment Graph Extension (doesn't maker which Ruleset - use CoreRPG for consistency) and immediately select the Quiz Tab (mislabeled as "Quix") - the right-hand edges of the top and right-hand windowframes are anchored to the right-hand edge of the subwindow. If you then turn off/on the Instructions via the Checkbox everything is suddenly lined up properly - (for the record, all the onValueChanged() function of the checkbox does is set the height of the top windowframe ie setAnchoredHeight("55")/setAnchoredHeight("195"), plus turn on/off a couple of strings).

Cheers

Moon Wizard
April 1st, 2017, 04:52
You'll need to trigger a redraw after the onInit for subwindows, since the onInit occurs before the layout is finalized. Have you tried looking at OnSubwindowInstantiated?

JPG

dulux-oz
April 1st, 2017, 07:22
@Moon => I love you and I want to have your babies!

Thanks mate, that got it (and solved a couple of other issues I was having as well) :)

Cheers