Manual submenu creation with LAMCreateControl
Having a bit of trouble getting this to work. From the LAM wiki:
Quote:
So, here is what I tried: Code:
for entry, widgetData in ipairs(panelData) do Visiting the panel in question I do get a list of debug printouts for the correct widget types from the submenu's controls. The submenu itself is created, there are no LUA errors, however it will not expand and all the widgets appear to get scrunched together on top of instead of within the submenu widget: I also tried local lastSubWidget = GetControl(widgetData.reference) and adding reference = "UniqueSubmenuName", to the submenu in question, with the exact same results (should reference same control as 'widget' in this context). Seems to be I am just anchoring these sub-widgets wrongly, but how to do so correctly? NOTE: Why even have the sub-loop? Because, if I just leave the "if widgetData.controls ~= nil then" block out completely, LAM does not create the widgets for the submenu contained within widgetData.control. Could it be a possible LAM bug with submenu widgets called from LAMCreateControl? I think it is more like I just need to change some subtle syntax. O.o |
I am working on just hooking widget.label:SetHandler("OnMouseUp" and manually re-sizing and re-populating the panel, and hiding/showing the sub-menu widgets accordingly using table lookups. Seems like it could work at least.
|
Managed to work around this issue with a custom framework. Might be a better way though. Still this is relatively clean and painless and allows copy-paste adding of submenus without additional code. The only minor hassle is getting the height value for the expanded menu.
Code:
local subWidgets = { -- the names here are from the reference = "" field on the submenu widget |
All times are GMT -6. The time now is 07:29 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI