Activating tab

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Activating tab

YuLo
I wondering how can I activate tab in c++ XPCOM of my xulrunner application.
I can add tab using DOM interface.
As far as I see DOM interface have no means to activate tab.
Is there any other way?
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: Activating tab

Neil-4
YuLo wrote:

>I wondering how can I activate tab in c++ XPCOM of my xulrunner application.
>I can add tab using DOM interface.
>As far as I see DOM interface have no means to activate tab.
>Is there any other way?
>  
>
The <xul:tabs> element implements the nsIDOMXULSelectControlElement
interface which you can use to alter the selected tab.

--
Warning: May contain traces of nuts.
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: Activating tab

YuLo
On Thursday, December 12, 2013 1:01:10 AM UTC+4, Neil wrote:

> YuLo wrote:
>
>
>
> >I wondering how can I activate tab in c++ XPCOM of my xulrunner application.
>
> >I can add tab using DOM interface.
>
> >As far as I see DOM interface have no means to activate tab.
>
> >Is there any other way?
>
> >  
>
> >
>
> The <xul:tabs> element implements the nsIDOMXULSelectControlElement
>
> interface which you can use to alter the selected tab.
>
>
>
> --
>
> Warning: May contain traces of nuts.

Thank you, Nail again, and very much!
It works!
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: Activating tab

YuLo
On Thursday, December 12, 2013 7:51:06 PM UTC+4, YuLo wrote:

> On Thursday, December 12, 2013 1:01:10 AM UTC+4, Neil wrote:
>
> > YuLo wrote:
>
> >
>
> >
>
> >
>
> > >I wondering how can I activate tab in c++ XPCOM of my xulrunner application.
>
> >
>
> > >I can add tab using DOM interface.
>
> >
>
> > >As far as I see DOM interface have no means to activate tab.
>
> >
>
> > >Is there any other way?
>
> >
>
> > >  
>
> >
>
> > >
>
> >
>
> > The <xul:tabs> element implements the nsIDOMXULSelectControlElement
>
> >
>
> > interface which you can use to alter the selected tab.
>
> >
>
> >
>
> >
>
> > --
>
> >
>
> > Warning: May contain traces of nuts.
>
>
>
> Thank you, Nail again, and very much!
>
> It works!

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"
Should I remove the tab in DOM by myself?
I have a tree in tab, should I delete tree object by myself?

 
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: Activating tab

Neil-4
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.
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul
Reply | Threaded
Open this post in threaded view
|

Re: Activating tab

YuLo
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.
!!!
_______________________________________________
dev-tech-xul mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xul