local _, core = ...; -- Namespace

local AceGUI = LibStub("AceGUI-3.0")


function core.GoldMakingUI(container)



-- Beginners Tab
local function DrawGroup1(container)
 
core.Beginners(container)

end

-- Farming Tab
local function DrawGroup2(container)

core.Farming(container)

end

-- Crafting Tab
local function DrawGroup3(container)

core.Crafting(container)

end

-- Flipping Tab
local function DrawGroup4(container)

core.Flipping(container)

end

-- Routes Tab
local function DrawGroup5(container)

core.Routes(container)

end




local function SelectGroup(container, event, group)
   container:ReleaseChildren()
   if group == "tab1" then
      DrawGroup1(container)
   elseif group == "tab2" then
      DrawGroup2(container)
   
      elseif group == "tab3" then
      DrawGroup3(container)
   
      elseif group == "tab4" then
      DrawGroup4(container)
   
      elseif group == "tab5" then
      DrawGroup5(container)
   
   end
end


local frame = AceGUI:Create("Frame")
frame:SetTitle("Gold Making Guides")
frame:SetStatusText("|cff00C78CWorthIt-Guides")
frame:SetWidth(400)
frame:SetHeight(500)
frame:SetCallback("OnClose", function(widget) AceGUI:Release(widget) end)


frame:SetLayout("Fill")



--[[ Scroll Frame 
local scrollcontainer = AceGUI:Create("SimpleGroup") 
scrollcontainer:SetFullWidth(true)
scrollcontainer:SetFullHeight(true) 
scrollcontainer:SetLayout("Fill") 

frame:AddChild(scrollcontainer)

scroll = AceGUI:Create("ScrollFrame")
scroll:SetLayout("Fill") -- probably?
scrollcontainer:AddChild(scroll)
]]--


local tab =  AceGUI:Create("TabGroup")
tab:SetLayout("Flow")
tab:SetTabs({{text="Beginners", value="tab1"}, {text="Farming", value="tab2"}, {text="Crafting", value="tab3"}, {text="Flipping", value="tab4"}, {text="Routes", value="tab5"}})
tab:SetCallback("OnGroupSelected", SelectGroup)
tab:SelectTab("tab1")

frame:AddChild(tab)











end