Closed juedui0769 closed 1 year ago
-- 代码摘抄自下面的链接
-- https://wowpedia.fandom.com/wiki/API_CreateFrame
local btn = CreateFrame("Button", nil, UIParent, "UIPanelButtonTemplate") btn:SetPoint("CENTER") btn:SetSize(100, 40) btn:SetText("Click me") btn:SetScript("OnClick", function(self, button, down) print("Pressed", button, down and "down" or "up") end) btn:RegisterForClicks("AnyDown", "AnyUp")