Thread Tools Display Modes
05-17-09, 09:30 AM   #1
tsadok
An Aku'mai Servant
 
tsadok's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 32
Disabling a container frame

Is there any way of straightforwardly disabling mouse interaction with a frame and its children? It would be nice if my addon had a 'hide' option where the main frame was showing at a low alpha, and was invisible to the mouse and keyboard. If people saw something that interested them they could press the "Show()" keybinding. is this possible, or would I have to unregister every button?
  Reply With Quote
05-17-09, 10:37 AM   #2
kraftman
A Theradrim Guardian
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 63
Code:
local function ForChildren(frame)
   frame:EnableMouse(false)
   for i = 1, select("#", frame:GetChildren()) do
      ForChildren(select(i, frame:GetChildren()))
   end
end
ForChildren(MyFrameName)
will disable the mouse for the frame and all of its children. Bear in mind that if you do the reverse, setting it to true, you may accidentaly enable the mouse for frames you don't want to.
  Reply With Quote
05-17-09, 09:27 PM   #3
tsadok
An Aku'mai Servant
 
tsadok's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 32
Thank you, you are very clever
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Disabling a container frame


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off