Hi,
I try to use Tabs with Spec and i would like to remove a tab from the TabManagerModel but it doesn't work.
TabManagerModel has a method named #removeTab: which call directly its adapter but the MorphicTabManagerAdapter hasn't the method #removeTab: ...
I looked at the TabManager class and its the same, no method to remove a tab.
A small example I would like to do :
|tab tabMgr|
tab := TabModel new
label: 'fooTab';
model:
(DynamicComposableModel new
layout: SpecLayout composed;
yourself).
tabMgr := TabManagerModel new
addTab: tab;
yourself.
DynamicComposableModel new
assign: tabMgr to: #tabs;
layout:
(SpecLayout composed
add: #tabs;
yourself);
openWithSpec.
tabMgr removeTab: tab.
"or"
tabMgr removeTabNumber: 1.
The only solution (or rather a hack) i found it's to add an extension like that:
MorphicTabManagerAdapter >> removeTab: aTab
aTab widget widget delete.
anyone have a clue to do that nicer?
And other mistery, why the tabBar is removed when the last tab is closed ?
TabBar >> removeTab: aTab
...
selectionHistory size = 1
ifTrue: [ ^ self delete ].
...
If someone can enlighten me.
Regards,
Glenn Cavarlé