Hi everybody,
is it possible to a add a ‘+’ button to a tabsheet to add new tabe like it is used for example in firefox to open a new tab?
Thanks for your help
Hi everybody,
is it possible to a add a ‘+’ button to a tabsheet to add new tabe like it is used for example in firefox to open a new tab?
Thanks for your help
Hi,
sure, I can think of a couple of ways to do that. First option would be something like follows:
The second option would be to use a button instead of a tabsheet. Wrap the button and the tabsheet with an AbsoluteLayout so you can place it over the tabsheet where you want. Add new tabs in the button’s click handler and use styles to make the button look like what you want.
Hope these are enough to get you started,
Olli
Hello,
I’ve faced another problem when try change selected tab caption - nothing changing.
getTabSheet().getSelectedTab().setCaption(“NEW”);
Please assist.
Thanks
Or if it possible can you please provide example how to add button to tab sheet ?
Thanks
Use tabSheet.getTab with the index of the tab instead of getSelectedTab() - the latter returns the contents of the selected tab (because of historical reasons).
This helped. Another question how can I check that “+” tab clicked?
e.g. if click on caption “new” renamed from “+”, in code in if statement check on “+” that has “+” caption.
Please assist.
Thanks
You could store a reference to the “+” tab when you create it and check that it equals the one you want, maybe?
-Olli
I resolved problem, when I get tab like this, it get actual tab and it works ok.
getTabSheet().getTab(getTabSheet().getTabPosition(getTabSheet().getTab(getTabSheet().getSelectedTab())))
Thanks
Looks good ![]()