PDA

View Full Version : Setting window position during onInit()



Ken L
January 4th, 2018, 05:34
I can't seem to set the window position during the onInit() sequence. I'm guessing this has to do with integrating saved window positions which sets it to its 'old' position after invoking the onInit given windowclass and record. The same positioning logic functions as expected when placed on other controls within the window by invoking window.setPosition(...).

Is there a way to bypass this 'use old window position' behavior, or does this behavior stem from something else?

My usecase is to set the position of this window when it's opened to a specific position depending on the position + parameter of another window.

Moon Wizard
January 5th, 2018, 02:54
You can use the "nosave" tag in the windowclass definition to bypass the saved position restore for specific windows.

JPG

Ken L
January 5th, 2018, 12:06
Just what I needed. I don't think this is documented though as an XML option in WindowClass (https://www.fantasygrounds.com/refdoc/windowclass.xcp). It also only has an effect if within the <position> tags which I suspected, but was an additional detail.