diff AceGUIWidget-lib-st.lua @ 47:1070a14cfee4

Updated lib-st widget from WRDW. Properly notice new generating tabs. Updated help text.
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Sat, 28 Jan 2012 18:24:22 +0000
parents 822b6ca3ef89
children fd3dd12f96ce
line wrap: on
line diff
--- a/AceGUIWidget-lib-st.lua	Sat Jan 21 01:39:44 2012 +0000
+++ b/AceGUIWidget-lib-st.lua	Sat Jan 28 18:24:22 2012 +0000
@@ -22,9 +22,10 @@
 Version 1 initial functioning implementation
 Version 2 reshuffle to follow new AceGUI widget coding style
 Version 3 add .tail_offset, defaulting to same absolute value as .head_offset
+Version 4 restore original frame methods, as fortold by ancient prophecy
 -farmbuyer
 -------------------------------------------------------------------------------]]
-local Type, Version = "lib-st", 3
+local Type, Version = "lib-st", 4
 local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
 if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
 
@@ -86,13 +87,14 @@
 
 	-- Possibly have already wrapped this ST in a previous widget, careful.
 	if st.frame.obj ~= self then
+		self.frame.customSetPoint = rawget(self.frame,"SetPoint")
 		self.frame.realSetPoint = self.frame.SetPoint
 		self.frame.SetPoint = ShiftingSetPoint
 		self.frame.SetAllPoints = ShiftingSetAllPoints
 	end
 
-	-- This needs the .frame field.  This also creates .obj inside that
-	-- field and calls a SetScript as well.
+	-- This needs the .frame field.  This also unconditionally creates .obj
+	-- inside that field and calls a SetScript on it as well.
 	return AceGUI:RegisterAsWidget(self)
 end
 
@@ -150,10 +152,10 @@
 			self.st:Hide()
 		end
 		self.st = nil
-		-- XXX should also undo the frame hooks.  would most likely be wasted
-		-- cycles.  if somebody actually wants to make an ST, include it inside
-		-- an ace container, then hide the container and continue displaying
-		-- the ST by other means, they can file a ticket
+		self.frame.realSetPoint = nil
+		self.frame.SetAllPoints = nil
+		self.frame.SetPoint = self.frame.customSetPoint
+		self.frame.customSetPoint = nil
 	end,
 
 	--[[