Download:
http://pastebin.com/V2pLdrdF or pastebin get V2pLdrdF tabmulti
Functions:
newTab(functionName,tabName) - Creates a new tab
setTabName(index,name) - Changes a tab's name at index to name
getTabName(index) - Gets a tab name at index
getTabNames() - Returns a table with all the tab names in their respective locations
getTabs() - Returns a table with all the tab coroutines in their respective locations
getCurrentTab() - Returns the index of the current tab
switchTab(index) - Switches the current tab to index
moveTab(pos1,pos2) - Moves tab at pos1 to pos2
closeTab(index) - Closes tab at index
runTabs() - Runs all the tabs
runCurrentTab() - Runs the current tab and pauses the other tabs
drawTabs() - Draws the tab bar
tabClick() - Checks for clicks on the tab bar and does the respective action (Does not support tab closing or tab moving currently)
tabRun(programName,tabName) - Runs a program in a tab
tabMain is a example main function to run the api, you may use it or write your own.
How to allow your programs/functions to work in the tabs:
In your functions/programs make sure to check is it is the current tab before drawing on the screen or checking for input. The api does not handle this yet, because I can not figure out how. If you do not do this, then all the tabs will be checking for input and drawing to the screen at the same time and it wont be too pretty.
Please point out any typos/bugs/glitches you find, any feedback will be appriciated!
Edited by AssossaGPB, 27 June 2014 - 04:24 PM.