View Single Post
11-28-13, 03:49 PM   #34
Uitat
A Chromatic Dragonspawn
 
Uitat's Avatar
AddOn Author - Click to view addons
Join Date: May 2011
Posts: 162
Originally Posted by Uitat View Post
Phanx, great info there, i really appreciate it, you have actually been part of my inspiration in your chat addon, sooner or later i will nest my own chat mod, but for now i like to use yours

im going to try this tomorrow and see how it goes
ok so i succeeded in making this work but it will only open then close it 1 time then no longer functions, is there some sort of event handler i should be using here???
Lua Code:
  1. local backdrop = {
  2.     bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background",
  3.     edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border",
  4.     tile = true,
  5.     tileSize = 32,
  6.     edgeSize = 20,
  7.     insets = {
  8.         left = 4,
  9.         right = 4,
  10.         top = 4,
  11.         bottom = 4,
  12.         }
  13.     }  
  14.  
  15.  
  16. function MyAddon_ShowOptionFrame()
  17. -- Does the frame already exist?
  18. if HeeloWorldFrame then
  19.     HeeloWorldFrame:Hide()  else
  20.         if not HeeloWorldFrame then
  21. -- Nope. Create it now:
  22.         local frame = CreateFrame("frame", "HeeloWorldFrame", UIParent)
  23.         HeeloWorldFrame:SetWidth(300)
  24.         HeeloWorldFrame:SetHeight(75)
  25.         HeeloWorldFrame:SetPoint("CENTER", UIParent,"CENTER", 0, 0)
  26.         HeeloWorldFrame:SetFrameStrata("BACKGROUND")
  27.         HeeloWorldFrame:SetFrameLevel(1)   
  28.         HeeloWorldFrame:SetAlpha(1)
  29.         HeeloWorldFrame:SetBackdrop(backdrop)          
  30.         end
  31.         HeeloWorldFrame:Show()  
  32.     end
  33.     -- -- By this point the frame either already existed, or was just created.
  34. end
  35.  
  36. frame = CreateFrame("Button", "OptionsFrame", TopFrame, "UIPanelButtonTemplate")
  37.     frame:SetHeight(21)
  38.     frame:SetWidth(80)
  39.     frame:SetText("Options")
  40.     frame:ClearAllPoints()
  41.     frame:SetPoint("CENTER", 0, 0)
  42.     OptionsFrame:SetScript("OnClick", function() MyAddon_ShowOptionFrame() end)
  Reply With Quote