Thread: Subwindow to Subwindow
-
November 11th, 2023, 10:48 #1
Subwindow to Subwindow
Starting from a subwindow, I need to get access to a control in another subwindow.
If I'm not wrong, there was an utility function already prepared to do this job, but I can't find it.
Who can help me?
-
November 11th, 2023, 11:11 #2
According to the developer guide for the subwindow control, "a reference to the parent subwindow control is available from the contained windowinstance object through the parentcontrol variable." https://fantasygroundsunity.atlassia...5196/subwindow
Not knowing your exact GUI control hierarchy, you could try something like parentcontrol.window.{name of other subwindow}.subwindow to access another subwindow from within a different subwindow. If this doesn't work, you can usually work out the path needed by use of Debug statements for parentcontrol.window and other variations on that GUI path.Last edited by Trenloe; November 11th, 2023 at 11:34.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
November 11th, 2023, 11:13 #3
Last edited by Trenloe; November 11th, 2023 at 11:15.
Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
November 12th, 2023, 09:41 #4
Yep, I was using this --> parentcontrol.window.{name of other subwindow}.subwindow, but when I try to reach a control inside it seems to not work.
I think I should get to the windowinstance first, is that right?
getTopWindow(w) is the same, it gives the subwindow.
I tried this
Code:_wMyWindow = parentcontrol.window["myWindow"].subwindow; Debug.console(_wMyWindow); -- The output is --> subwindow = { name = "myWindow", x,y,w,h = 30,45,600,635 } _wMyWindow["myControlName"].getValue(); -- It doesn't work _wMyWindow.myControlName.getValue(); -- It doesn't work
-
November 12th, 2023, 10:30 #5
Write debug for the controls you're trying to access. Output _wMyWindow.myControlName to debug, for example.
Also, ensure that the subwindow and its contents has been fully created when you're trying to access it via code. You may need to specify <activate /> in the subwindow definition: https://fantasygroundsunity.atlassia...5196/subwindowPrivate Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
November 16th, 2023, 19:11 #6
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks