Toolbar request


#1
ToolbarItemComponent* Toolbar::extractToolbarItem (const int itemIndex)
{
    ToolbarItemComponent* tc = items.removeAndReturn(itemIndex);
    resized();
    return tc;
}

 


#2
ToolbarItemComponent* Toolbar::extractToolbarItem (const int itemIndex)
{
    ToolbarItemComponent* tc = 0;
    if (itemIndex < items.size())
    {
        tc = items.removeAndReturn(itemIndex);
        removeChildComponent(tc);
        resized();
    }
    return tc;
}

 


#3

Ta, will add that.


#4

 

it's because the toolbar owns its items. sometimes you want to remove something then put it back later. i do this to make a context sensitive item list.