diff AceGUIWidget-lib-st.lua @ 9:6ccfe2249edb

Finally restore frame methods
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Fri, 27 Jan 2012 19:22:29 +0000
parents e6382ba088c3
children c2e4ad7fa458
line wrap: on
line diff
--- a/AceGUIWidget-lib-st.lua	Fri Jan 27 01:31:29 2012 +0000
+++ b/AceGUIWidget-lib-st.lua	Fri Jan 27 19:22:29 2012 +0000
@@ -22,7 +22,7 @@
 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 
+Version 4 restore original frame methods, as fortold by ancient prophecy
 -farmbuyer
 -------------------------------------------------------------------------------]]
 local Type, Version = "lib-st", 4
@@ -87,6 +87,7 @@
 
 	-- 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
@@ -151,10 +152,9 @@
 			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
 	end,
 
 	--[[