1. Handling "OnShow" frame event

    Hello,

    I created a frame template using XML code

    <Frame name="FrameTemplate" virtual="true">
    <Scripts>
    <OnShow>
    print('Hello World')
    </OnShow>
    </Scripts>
    </Frame>

    Now I can create new frames in Lua using this template

    local frame = CreateFrame("Frame", "NewFrameTemplate", UIParent, "FrameTemplate")
    frame:SetSize(100, 100)
    frame:SetPoint("CENTER")

    If I write

    frame:SetScript("OnShow", function() print('Howday?') end)

    Every time the frame is shown, 'Howday?' will appear, but no longer 'Hello World'.
    Is there a method, in the 3.3.5a client, to ensure that the script present inside the <OnShow> tag is not overwritten?

  2. Yes, use HookScript instead.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •