View Single Post
05-19-13, 01:53 AM   #355
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
OnLeave problem

Hi, I have used LitePanels in a simple way for long time ...

Now I'd like to use it trying to make something more complex, but I am having some difficulties:

Lua Code:
  1. lpanels:CreateLayout("Back2", {
  2.     {   name = "P1", anchor_to = "BOTTOM", x_off = 0, y_off = 4,
  3.         bg_alpha = 0.5, width = 460, height = 120,
  4.         border = "SOLID", border_color = "CLASS",
  5.     },
  6.    
  7.     {   name = "P2",
  8.         anchor_to="BOTTOMLEFT", anchor_from="BOTTOMRIGHT", anchor_frame = "P1",
  9.         x_off = 2, y_off = 0,
  10.         bg_alpha = 0.5, width = 115, height = 120,
  11.         border = "SOLID", border_color = "CLASS",
  12.         OnLoad  = function(self) self:SetAlpha(0) end,
  13.         OnEnter = function(self)
  14.             self:SetAlpha(1)
  15.             -- BT4Bar3:Show()
  16.         end,
  17.         OnLeave = function(self)
  18.             print( "DEBUG: The mouse is over " .. GetMouseFocus():GetName())
  19.             if GetMouseFocus():GetParent() ~= self then
  20.                 self:SetAlpha(0)
  21.             end
  22.         end,
  23.     },
  24.    
  25. } )

The problem is, as pointed out in this forum earlier, that I'd like to make P2 panel show and hide on the event Enter and Leave.
But I have filled the P2 panel with a 3x3 bar of BT4 and when I hovering over it the P2 panel disappear if I use a simple self:SetAlpha(0) condition.

Also the solution I found in this thread, as posted above, isn't working.

Any idea ? Thanks.

P.s.
This is really a great addon.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote