Page 1 of 1

register dialog

Posted: Sun Dec 19, 2021 12:34 pm
by davoodice2
Hi
I found this on search in moho

function LM.GUI.SimpleDialog(title, subClass)
local d = LM.GUI.LM_SimpleDialog:new(title)
for n, v in pairs(subClass) do
d[n] = v
end
LM.GUI.SimpleDialogRegister(d)
return d
end

anybody knows what does it do?

Re: register dialog

Posted: Sun Dec 19, 2021 1:29 pm
by hayasidist
(never actually used this as such but just looking at what you've written ...)
it adds the items in subClass to the dialogue block

so if you have (e.g.)
local function foo ()
end
custom = {fubar = foo}
cusD = LM.GUI.LM_SimpleDialog:new("MyDialogue", custom)

then the cusD you get back has all the methods you'd expect (https://www.mohoscripting.com/classes/LM_SimpleDialog) along with those from custom

(If I find time in the next few days, I'll give it a more extensive workout)