Thread: Force Window Instance Redraw
-
April 1st, 2017, 04:24 #1
Force Window Instance Redraw
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).
CheersDulux-Oz
√(-1) 2^3 Σ Π
...And it was Delicious!
Alpha-Geek
ICT Professional
GMing Since 1982
NSW, Australia, UTC +10
LinkedIn Profile: www.linkedin.com/in/mjblack
Watch our games on Twitch: www.twitch.tv/dulux_oz
Support Me on Patreon: www.patreon.com/duluxoz
Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz
-
April 1st, 2017, 04:52 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,563
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
-
April 1st, 2017, 07:22 #3
@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)
CheersDulux-Oz
√(-1) 2^3 Σ Π
...And it was Delicious!
Alpha-Geek
ICT Professional
GMing Since 1982
NSW, Australia, UTC +10
LinkedIn Profile: www.linkedin.com/in/mjblack
Watch our games on Twitch: www.twitch.tv/dulux_oz
Support Me on Patreon: www.patreon.com/duluxoz
Past Games, etc, on my YouTube Channel: www.youtube.com/c/duluxoz
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks