ImGui.Core:beginTabBar

From GiderosMobile

Available since: Gideros 2020.9
Class: ImGui

Description

Pushes a TabBar to the stack and starts appending to it.

(bool) = ImGui:beginTabBar(str_id [, ImGui.TabBarFlags = 0])

note: parameters between [] are optional parameters with their default values

Parameters

str_id: (string) the tabbar unique id
ImGui.TabBarFlags: (number) any of the ImGui.TabBarFlags flags, see ImGui.TabBarFlags

Return values

Returns: (bool) whether the tabbar is collapsed or expanded

Example

require "ImGui"

local imgui = ImGui.new()
stage:addChild(imgui)

function onEnterFrame(e)
	imgui:newFrame(e.deltaTime)
	if imgui:beginTabBar("TABBAR") then
		if imgui:beginTabItem("Files") then
			imgui:textColored("File is ready", 0x00ff00, 1)
			imgui:text("Amp min:") imgui:sameLine()
			imgui:text("Amp max:") imgui:sameLine()
			imgui:endTabItem()
		end
		if imgui:beginTabItem("Microphone") then
			imgui:text("xxx min:") imgui:sameLine()
			imgui:text("xxx max:") imgui:sameLine()
			imgui:endTabItem()
		end
		imgui:endTabBar()
	end
	imgui:render()
	imgui:endFrame()
end

stage:addEventListener(Event.ENTER_FRAME, onEnterFrame)




Dear ImGui