View Full Version : Question about window data reference.
drahkar
January 4th, 2011, 15:49
A commonly used practice is to pass the control reference through to a global script so that you can interact with the control from those global scripts. Does that same process work for the window reference? Can I pass the window reference to the global script and then run code against it?
So far my tests say no, so I'm looking for confirmation.
Thanks!
Zeus
January 5th, 2011, 11:56
Not sure. I would have thought you could pass the fully qualified name of the window instance and its class into the Global Script and then use the Interface.findWindow() method to access it.
Moon Wizard
January 5th, 2011, 19:52
Using Interface.findWindow is a safer solution, as windows can be closed. You'll find several instances in the FG provided rulesets where a check is performed with findWindow, and actions vary depending on whether the window exists or not. (i.e. if it doesn't exist, then open the window.)
Cheers,
JPG
drahkar
January 6th, 2011, 12:53
So here is a question. What counts as a Top Level Window?
Moon Wizard
January 6th, 2011, 19:54
Anything opened with the openWindow command is a top level window. Examples are character sheets, combat tracker, module activation, library, etc.
JPG
drahkar
January 6th, 2011, 21:36
Ok, Thanks!
Bidmaron
January 8th, 2011, 08:13
Just getting back from sea and getting caught up on the week's e-mails. So, a non-top-level-window is a subwindow? That is, from the user's perspective, it is something existing within a parent window, right?
Moon Wizard
January 9th, 2011, 20:42
Here are two examples of non top-level windows off the top of my head:
* child window in a subwindow control
* child windows in a windowlist control
All of the buttons on the right side actually perform a call to Interface.findWindow and Interface.openWindow to support their functionality.
The other one that I'm unsure about are panels. A panel is a container for a window, but I don't believe that they are accessible via script when not saved. That is why all the panel implementations that need to remember a control (ChatManager and ModifierStack) use scripts to save off control pointers.
Cheers,
JPG
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.