• 0

    posted a message on kgPanels Offical Thread
    Quote from Andy »

    I didn't use a script for my edit box frame. If you set the panel to parent to the ChatFrameEditBox, the panel will appear and disappear when it needs to do so. I also have my panel anchored to the ChatFrameEditBox.

    Ahh, most excellent, works now. Thanks Andy.
    Posted in: General AddOns
  • 0

    posted a message on kgPanels Offical Thread
    Having some problems trying to get the same behavior with a script in kgPanels that I had in eePanels2. In eePanels2 I have a panel anchored to ChatFrameEditBox and I used the following script to show/hide the panel when the editbox appeared/disappeared:

    THIS_Hook = AceLibrary("AceAddon-2.0"):new("AceHook-2.1")
    
    function THIS_Hook:OnEditFocusGained(frame, ...)
      THIS:Show()
      THIS_Hook.hooks[frame].OnEditFocusGained()
    end
    
    function THIS_Hook:OnEditFocusLost(frame, ...)
      THIS:Hide()
      THIS_Hook.hooks[frame].OnEditFocusLost()
    end
    
    THIS:Hide()
    THIS_Hook:HookScript(ChatFrameEditBox, "OnEditFocusGained")
    THIS_Hook:HookScript(ChatFrameEditBox, "OnEditFocusLost")


    The following is what I modified and put in the OnLoad script:

    myHook = AceLibrary("AceAddon-2.0"):new("AceHook-2.1")
    
    function myHook:OnEditFocusGained(frame, ...)
      self:Show()
      myHook.hooks[frame].OnEditFocusGained()
    end
    
    function myHook:OnEditFocusLost(frame, ...)
      self:Hide()
      myHook.hooks[frame].OnEditFocusLost()
    end
    
    self:Hide()
    myHook.HookScript(ChatFrameEditBox, "OnEditFocusGained")
    myHook.HookScript(ChatFrameEditBox, "OnEditFocusLost")


    When I reload the UI, the frame doesn't even initially hide but I don't receive any errors. I must be doing something wrong with the way kgpanels handles scripts, just can't figure out what. Any ideas?

    Thanks.
    Posted in: General AddOns
  • To post a comment, please or register a new account.