View Single Post
07-19-16, 10:33 AM   #1
Benalish
A Flamescale Wyrmkin
 
Benalish's Avatar
Join Date: Dec 2012
Posts: 123
Frames and metatables

If I have a frame, and the put a metatable on this all this methods, e.g. SetBackdropColor(), are overwritten. There's a solution to overcame this problem?

Lua Code:
  1. local frm = CreateFrame("Frame")
  2.  
  3. local mt = { __index =
  4.     {
  5.         foo = function() print("bar") end
  6.     }
  7. }
  8.    
  9. setmetatable(frm, mt)
  10.  
  11. frm:SetBackdropColor(0,0.5,1)

Error message: attempt to call method 'SetBackdropColor' (a nil value)

Last edited by Benalish : 07-19-16 at 10:42 AM.
  Reply With Quote