Tab.width read/write property


Get or set the Tab width. The width starts from 0 (left side of the Tab) and increases to the right direction.

Example

local ui = require "ui" -- create a simple Window local win = ui.Window("Tab.width sample", 640, 300) local tab = ui.Tab(win, {"Item 1", "Item 2"}) local inc_btn = ui.Button(win, "Increase Tab.width", 200, 260) local dec_btn = ui.Button(win, "Decrease Tab.width", inc_btn.x+inc_btn.width+6, inc_btn.y) inc_btn.delta = 10 dec_btn.delta = -10 local function onClick(self) tab.width = tab.width + self.delta end inc_btn.onClick = onClick dec_btn.onClick = onClick -- shows the Window win:show() -- update user interface repeat ui.update() until not win.visible