Re: Activating tab

YuLo <[email protected]> Fri, 13 Dec 2013 15:30:19 -0800 (PST)
Newsgroups gmane.comp.mozilla.devel.xpfe
Message-ID <[email protected]>
On Friday, December 13, 2013 1:29:34 AM UTC+4, Neil wrote:
> 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.

Thank you Neil,
about the second parameter, I have always it equal to NULL
after calling "RemoveItemAt".
But it doesn't matter in my case.
Thank for your note about index, now I reset it in correct value.
!!!