Thread Tools Display Modes
06-04-16, 09:42 AM   #1
Folji
A Flamescale Wyrmkin
 
Folji's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 136
Mouseover visibility on a frame with children?

Hiya folks!

So here's a thing I've been fussing a bit over lately. I'd like to have a frame that starts off only partially on-screen and partially off-screen. And then when it's moused over, it pops into view and stays there until the mouse leaves the frame.

But when that frame has child frames with mouse input enabled, mousing over them seems to count as a mouse-out for the parent frame? What's the ideal way to handle such a situation? Is the only feasible option to hook the OnEnter and OnLeave scripts for each child frame present, or are there other ways to do this?
  Reply With Quote
06-04-16, 10:06 AM   #2
syncrow
A Flamescale Wyrmkin
 
syncrow's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 149
Lua Code:
  1. frame:SetScript("OnLeave", function(self, motion)
  2.     if self:IsMouseOver() then
  3.         -- OnEnter state
  4.     else
  5.         -- OnLeave state
  6.     end
  7. end)
__________________

Last edited by syncrow : 06-04-16 at 10:14 AM.
  Reply With Quote
06-04-16, 11:56 AM   #3
Folji
A Flamescale Wyrmkin
 
Folji's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 136
Oh, lovely! So :IsMouseOver() will always return true, even if there are other mouse-enabled frames on top of it? That's perfect!
  Reply With Quote
06-04-16, 06:01 PM   #4
zork
A Pyroguard Emberseer
 
zork's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 1,740
You can check rLib:CreateButtonFrameFader
https://github.com/zorker/rothui/blo...fader.lua#L112
__________________
| Simple is beautiful.
| WoWI AddOns | GitHub | Zork (WoW)

"I wonder what the non-pathetic people are doing tonight?" - Rajesh Koothrappali (The Big Bang Theory)
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » Mouseover visibility on a frame with children?

Thread Tools
Display Modes

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