Page 1 of 1

Button Set Label

Posted: Sat Jul 22, 2017 1:22 am
by anthonytsb5
I'm working in Moho 12.2 and trying to change labels on an existing button to let people know if they have been assigned values or not. In a nut shell, I am using:

function OG_Camera_Manager:HandleMessage(moho, view, msg)
if (msg == self.BUTTON1) then
LM_BUTTON.BUTTON1:SetLabel("xxxx")
end
end

The result is an error: attempt to index global 'LM_BUTTON' (a nil value).

Any help would be appreciated.

Sorry to be a newb.

Re: Button Set Label

Posted: Sat Jul 22, 2017 2:18 am
by synthsin75
LM_BUTTON is called using LM.GUI.Button(), so you'd need to assign that to a variable like:

local BUTTON1 = LM.GUI.Button()

Then you can use the LM_BUTTON methods on BUTTON1.

Re: Button Set Label

Posted: Mon Jul 24, 2017 12:30 am
by anthonytsb5
I'm singing Danke Shoen to you right now.