Posted by vx on Fri, 27 Aug 2010 05:58:39
I have a SimpleHTML frame, I can set text in it (TestHTML:SetText(
"<html><body><p align=\"CENTER\">html text</p></body></html>");), but how I can get text from this frame?
p.s. "TestHTML:GetText();" not working. I get error "attempt to call method 'GetText' (a nil value)".
Posted by jnwhiteh on Fri, 27 Aug 2010 11:14:24
You don't. You're the one who set it so you should have access to it. If you absolutely need to track it from external sources, you can securehook the SetText method and track it yourself. Pseudocode:
local frameText = "" hooksecurefunc(TestHTML, "SetText", function(self, txt) frameText = txt end) function TestHTML:GetText() return frameText end
Then you can call
TestHTML:GetText(). As indicated on the widget page, the GetText method isn't defined for the
Posted by vx on Fri, 27 Aug 2010 17:28:11
it works perfectly. you really helped me greatly. very thanks x)