I am not able to make sense of the usage of addTab()? when i add a tab on the screen , there is no element displayed!! Originally, I wrongly thought it would like the JPanel in java.
//! Adds tab to the environment.
/** You can use this element to group other elements. This is not used for creating tabs on tab controls,
please use IGUITabControl::addTab() for this instead.
\param rectangle is the position of the tab.
\param parent is the parent item of the element. E.g. a window. Set it to 0 to place the tab directly in the environment.
\param id is a s32 to identify the tab. */
virtual IGUITab* addTab(const core::rect<s32>& rectangle, IGUIElement* parent=0, s32 id=-1) = 0;
Then look at the source code. From IGUITabControl.h...
//! A tab, onto which other gui elements could be added.
class IGUITab : public IGUIElement
{
public:
//! constructor
IGUITab(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
: IGUIElement(EGUIET_TAB, environment, parent, id, rectangle) {}
//! destructor
virtual ~IGUITab() {};
//! Returns number of tab if in tabcontrol.
/** Can be accessed later IGUITabControl::getTab() by this number. */
virtual s32 getNumber() = 0;
//! sets if the tab should draw its background
virtual void setDrawBackground(bool draw=true) = 0;
//! sets the color of the background, if it should be drawn.
virtual void setBackgroundColor(video::SColor c) = 0;
};
A tab is just an empty container for other gui controls. If you want to make it visible, you have to tell it so by calling setDrawBackground() and maybe setBackgroundColor().