# HG changeset patch # User John@Yosemite-PC # Date 1332711811 14400 # Node ID c7330bc4a9ea27437b87771717cfe1d74e9053d5 # Parent 615346b6ee994b2e649bedbac4ecb122d85eabdf Escape button impl. Disabled for the moment diff -r 615346b6ee99 -r c7330bc4a9ea Gui.lua --- a/Gui.lua Sun Mar 25 17:43:09 2012 -0400 +++ b/Gui.lua Sun Mar 25 17:43:31 2012 -0400 @@ -62,12 +62,24 @@ end t1:SetList(tree) end +local f +local escapeButton = +{ + shown = false, + ["IsShown"] = function(self) return self.shown end, + ["Hide"] = function(self) if f then bsk.print("Release!");AceGUI:Release(f); self.shown=false end end +} function CreateGUI() + -- special registration procedure to be closable with the escape button + --escapeButton.shown = true + --_G["BSK_ESCAPEBUTTON"] = escapeButton + --table.insert(_G.UISpecialFrames, "BSK_ESCAPEBUTTON") + local admin = bsk.admin - local f = AceGUI:Create("Frame") + f = AceGUI:Create("Frame") - f:SetCallback("OnClose",function(widget) AceGUI:Release(widget) end) + f:SetCallback("OnClose",function(widget) escapeButton.shown = false; AceGUI:Release(widget) end) f:SetTitle("BSK") f:SetLayout("Flow") f:SetHeight(680)