register dialog

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
davoodice2
Posts: 381
Joined: Tue Jun 15, 2021 1:14 pm

register dialog

Post 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?
خیام اگر ز باده مستی خوش باش
با ماهرخی اگر نشستی خوش باش
چون عاقبت کار جهان نیستی است
انگار که نیستی چو هستی خوش باش
User avatar
hayasidist
Posts: 3526
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: register dialog

Post 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)
Post Reply