View Single Post
03/07/19, 09:31 AM   #2
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by Baumkuchen3 View Post
1.
I want to remove the setted Handler within the "OnClicked" event. How can I do this. I dont know witch parameters the "function(.....) " (the 2. parameter of "button:SetHandler()" can use and how to access the button itself. "self" does not work here.

My Example function --- which will set the button handler:


Code:
function addon.InitControls(rowNumber)

 deleteButton:SetHandler("OnClicked", function(self) <-- are there other parameter available?
        
    DoSomethingt(rowNumber)

    self:RemoveHandler ("OnClicked") <-- how to remove the handler?

end)
----------------
2. How to Change the Button State in Code. I know hot to hide a control
Code:
deleteButton:SetHidden(true)
But I also want to disable a control/button.
control:SetHandler("OnClicked", nil)
buttonControl:SetEnabled(false)

https://wiki.esoui.com/Controls#ButtonControl
  Reply With Quote