View Single Post
03-03-22, 10:25 AM   #2
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Code:
local button = CreateFrame("Button", nil, UIParent, "UIPanelButtonTemplate")
button:SetSize(100,20)
button:SetPoint("CENTER")
button:RegisterForClicks("AnyUp")
button:SetText("Start")
button:SetScript("OnClick", function(self,btn)
  if self:GetText()=="Start" then
    self:SetText("Stop")
  else
    self:SetText("Start")
  end
end)
button:SetMovable(true)
button:RegisterForDrag("LeftButton")
button:SetScript("OnDragStart", button.StartMoving)
button:SetScript("OnDragStop", button.StopMovingOrSizing)
button:SetScript("OnHide", button.StopMovingOrSizing)
button:Show()
This should make a minimal button for testing but your error mentions line 641, meaning there's a ton of code you're not showing.

The most probable cause is that fs does not exist inside StopStart because it is defined as a local in another scope.

Last edited by Dridzt : 03-05-22 at 04:21 AM.
  Reply With Quote