John@1: John@1: local ChangeTab = function(container, event, group) John@1: container:ReleaseChildren() John@1: if group == "tab2" then John@1: local desc = AceGUI:Create("Label") John@1: desc:SetText("This is Tab 1") John@1: desc:SetFullWidth(true) John@1: container:AddChild(desc) John@1: John@1: local button = AceGUI:Create("Button") John@1: button:SetText("Tab 1 Button") John@1: button:SetWidth(200) John@1: container:AddChild(button) John@1: elseif group == "tab1" then John@1: local item2 = {string="item2!", color = {r=1,g=0,b=0.5} } John@1: local itemList = {"Item1", item2, "Item3", "Item4"} John@1: John@1: local myMultiSelect = AceGUI:Create("MultiSelect") John@1: myMultiSelect:SetLabel("My Multi Select") John@1: myMultiSelect:SetWidth(200) John@1: myMultiSelect:SetHeight(400) John@1: myMultiSelect:SetItemList(itemList) John@1: myMultiSelect:SetMultiSelect(false) John@1: container:AddChild(myMultiSelect) John@1: end John@1: end John@1: John@1: function bsk:CreateGUI() John@1: John@1: -- Create a container frame John@1: self.frame = AceGUI:Create("Frame") John@1: self.frame:SetCallback("OnClose",function(widget) AceGUI:Release(widget) end) John@1: self.frame:SetTitle("BSK") John@1: self.frame:SetLayout("Flow") John@1: self.frame:SetHeight(700) John@1: self.frame:SetWidth(350) John@1: local tab = AceGUI:Create("TabGroup") John@1: tab:SetLayout("Flow") John@1: tab:SetTabs( John@1: { John@1: { John@1: text="Tab 1", John@1: value="tab1" John@1: }, John@1: John@1: { John@1: text="Tab 2", John@1: value="tab2" John@1: }, John@1: { John@1: text="Tab 3", John@1: value="tab3" John@1: }, John@1: { John@1: text="Tab 4", John@1: value="tab4" John@1: } John@1: } John@1: ) John@1: tab.width = "fill" John@1: tab.height = "fill" John@1: John@1: tab:SetCallback("OnGroupSelected",ChangeTab) John@1: tab:SelectTab("tab1") John@1: self.frame:AddChild(tab) John@1: John@1: -- Create a button John@1: --local btn = AceGUI:Create("Button") John@1: --btn:SetWidth(170) John@1: --btn:SetText("Button !") John@1: --btn:SetCallback("OnClick", function() print("Click!") end) John@1: -- Add the button to the container John@1: --self.frame:AddChild(btn) John@1: end John@1: John@1: