private void AddPropertyTab(PropertyTab tab)
{
TabRadioToolButton rtb;
if (propertyTabs.Count == 0) {
selectedTab = tab;
rtb = new TabRadioToolButton (null);
rtb.Active = true;
firstTab = rtb;
toolbar.Insert (new SeparatorToolItem (), FirstTabIndex - 1);
}
else
rtb = new TabRadioToolButton (firstTab);
//load image from PropertyTab's bitmap
var icon = tab.GetIcon ();
if (icon != null)
rtb.Image = new Gtk.Image (icon);
else
rtb.Image = new Gtk.Image (Stock.MissingImage, IconSize.Menu);
rtb.Tab = tab;
rtb.TooltipText = tab.TabName;
rtb.Toggled += new EventHandler (toolbarClick);
toolbar.Insert (rtb, propertyTabs.Count + FirstTabIndex);
propertyTabs.Add(tab);
}