ToolBar* MainWindow::get_toolbar(Properties& prop) { // use the main toolbar by default ToolBar* toolbar = toolbar_; const char* tool = prop.get_string("tool"); if (tool && *tool) { ToolMap::iterator i = toolMap_.find(tool); if (i == toolMap_.end()) { toolbar = manage(new ToolBar); add_toolbar(tool, *toolbar); toolMap_.insert(i, make_pair(tool, toolbar)); } else { toolbar = i->second; if (prop.get_word("separator", 0)) { toolbar->add_separator(); } } } return toolbar; }