Re: Activating tab

Neil <[email protected]> Thu, 12 Dec 2013 21:29:34 +0000
Newsgroups gmane.comp.mozilla.devel.xpfe
Message-ID <[email protected]>
YuLo wrote:

>After I can successfully add tab I want to remove it.
>
>nsCOMPtr<nsIDOMXULSelectControlElement> tabs1(do_QueryInterface(tabs));
>tabs1->GetSelectedIndex(&i);
>tabs1->RemoveItemAt(i, &tab2);
>
>I wonder what is the second parameter for in "RemoveItemAt"
>  
>
It simply returns the XUL element corresponding to the removed item. In 
the case of a <tabs> there is very little difference between using 
RemoveItemAt and removing the item directly. Note that the selected 
index becomes -1 if you remove the selected tab.

nsCOMPtr<nsIDOMXULSelectControlItemElement> oldTab;
tabs1->RemoveItemAt(i, getter_AddRefs(oldTab));

-- 
Warning: May contain traces of nuts.