Thread: Control type
-
November 4th, 2022, 10:17 #1
Control type
Using getControls () I get a table whose elements look something like this:
Code:{#1 = subwindow = { name = s'header', x,y,w,h = 15,23,520,0 }, #2 = genericcontrol = { name = s'contentframe', x,y,w,h = 0,0,0,0}, ... }
I need to know if it's a subwindow, a genericcontrol or whatever. Not the name, but the type.
-
November 4th, 2022, 15:51 #2
Use the LUA type function - this has been "Extended to cover FG Lua object types" as mentioned here: https://fantasygroundsunity.atlassia...ic-Lua-Changes
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 4th, 2022, 22:23 #3
I think I'm doing something wrong
Code:for _, c in pairs(self.getControls()) do Debug.console("TYPE ===",c, c.type, _); end;
Code:s'TYPE ===' | subwindow = { name = s'header', x,y,w,h = 15,23,460,0 } | fn | #1
-
November 4th, 2022, 22:28 #4
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,668
The information displayed for custom FG data types are not actual Lua tables that you can query (even if the output mimics the output of tables).
Code:for k, c in pairs(self.getControls()) do Debug.console("TYPE ===", c, type(c), k); end;
JPG
-
November 4th, 2022, 22:31 #5
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks