I have been trying to link an Ace multilineeditbox to ForAllIndentsAndPurposes.
That Link is done by passing the editbox into FAIAP and then FAIAP adds itself to some of the text boxes methods. WeakAuras has done this so I know it can be done.
WeakAuras loads FAIAP after the WOWACE libs and then calls
IndentationLib:enable(premacrobox.editBox, nil, 2)
I'm trying the same thing and I get the below stack trace.
If I call premacrobox.editBox:GetMaxBytes() I get a value back. I can also call SetMaxBytes but once the object is passed for FAIAP all the methods become nil.
I probably can't answer your specific question since I've never done anything with AceGUI, but in general, if you want help with your code, you need to post your entire, actual code. For a multi-file addon, just posting the file where the error is occuring is usually enough. However, don't just post the 3 lines surrounding the one throwing the error, because the root cause is often somewhere else.
IndentationLib:enable(sequencebox.editBox, SyntaxColors, TAB_WIDTH) <-- is exactly how WeakAuras hook this function.
function GSSE:drawstandardwindow(container)
local sequencebox = AceGUI:Create("MultiLineEditBox")
sequencebox:SetLabel("Sequence")
sequencebox:SetNumLines(20)
sequencebox:DisableButton(true)
sequencebox:SetFullWidth(true)
sequencebox:SetText(sequenceboxtext:GetText())
-- sequencebox.editBox:SetMaxBytes(0)
-- sequencebox.editBox:SetMaxLetters(0)
--[B]IndentationLib:enable(sequencebox.editBox, SyntaxColors, TAB_WIDTH)[/B]
container:AddChild(sequencebox)
local updbutton = AceGUI:Create("Button")
updbutton:SetText("Create / Edit")
updbutton:SetWidth(200)
updbutton:SetCallback("OnClick", function() GSSE:updateSequence(currentSequence) end)
container:AddChild(updbutton)
sequenceboxtext = sequencebox
end
Enable function on FAIAP
function lib.enable(editbox, colorTable, tabWidth)
if not editboxSetText then
editboxSetText = editbox.SetText
editboxGetText = editbox.GetText
end
local modified
if editbox.faiap_colorTable ~= colorTable then
editbox.faiap_colorTable = colorTable
modified = true
end
if editbox.faiap_tabWidth ~= tabWidth then
editbox.faiap_tabWidth = tabWidth
modified = true
end
if enabled[editbox] then
if modified then
lib.indentEditbox(editbox)
end
return
end
-- Editbox is possibly hooked, but disabled
enabled[editbox] = true
editbox.oldMaxBytes = editbox:GetMaxBytes() -- Fails with a nil here on GetMaxBytes()
editbox.oldMaxLetters = editbox:GetMaxLetters() -- Fails with a nil here on GetMaxLetters()
editbox:SetMaxBytes(0) -- Fails with a nil here on SetMaxBytes()
editbox:SetMaxLetters(0) -- Fails with a nil here on SetMaxLetters()
editbox.GetText = newGetText
editbox.SetText = newSetText
hookHandler(editbox, "OnTextChanged", textChangedHook) -- These hook lines also fail with enclosed methods being nil
hookHandler(editbox, "OnTabPressed", tabPressedHook)
hookHandler(editbox, "OnUpdate", onUpdateHook)
lib.indentEditbox(editbox)
end
Now this works for every other application and example I can find. WeakAuras 2 uses this in their ACEGUI addon. I and they are running the same Ace Versions and FAIAP versions.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I have been trying to link an Ace multilineeditbox to ForAllIndentsAndPurposes.
That Link is done by passing the editbox into FAIAP and then FAIAP adds itself to some of the text boxes methods. WeakAuras has done this so I know it can be done.
WeakAuras loads FAIAP after the WOWACE libs and then calls
IndentationLib:enable(premacrobox.editBox, nil, 2)
I'm trying the same thing and I get the below stack trace.
If I call premacrobox.editBox:GetMaxBytes() I get a value back. I can also call SetMaxBytes but once the object is passed for FAIAP all the methods become nil.
IndentationLib:enable(sequencebox.editBox, SyntaxColors, TAB_WIDTH) <-- is exactly how WeakAuras hook this function.
Enable function on FAIAP
Now this works for every other application and example I can find. WeakAuras 2 uses this in their ACEGUI addon. I and they are running the same Ace Versions and FAIAP versions.