Button Set Label

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
anthonytsb5
Posts: 13
Joined: Mon May 15, 2017 11:51 am

Button Set Label

Post 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.
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Button Set Label

Post 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.
anthonytsb5
Posts: 13
Joined: Mon May 15, 2017 11:51 am

Re: Button Set Label

Post by anthonytsb5 »

I'm singing Danke Shoen to you right now.
Post Reply