diff --git a/src/YabInterface.cpp b/src/YabInterface.cpp index 1ad7142..c1b7b76 100644 --- a/src/YabInterface.cpp +++ b/src/YabInterface.cpp @@ -392,7 +392,7 @@ int YabInterface::CloseWindow(const char* view) { YabView *t = (YabView*)((YabTabView*)child)->TabAt(i)->View(); RemoveView(t); - viewList->DelView(t->Name()); + viewList->DelView(t->NameForTabView()); } } if(is_kind_of(child, YabBitmapView)) @@ -409,7 +409,7 @@ int YabInterface::CloseWindow(const char* view) { YabView *t = (YabView*)((YabTabView*)subchild)->TabAt(i)->View(); RemoveView(t); - viewList->DelView(t->Name()); + viewList->DelView(t->NameForTabView()); } } if(viewList->GetView(subchild->Name())) @@ -3385,7 +3385,7 @@ void YabInterface::WindowClear(const char* window) { YabView *t = (YabView*)((YabTabView*)child)->TabAt(i)->View(); RemoveView(t); - viewList->DelView(t->Name()); + viewList->DelView(t->NameForTabView()); } } if(is_kind_of(child, YabBitmapView)) @@ -3400,7 +3400,7 @@ void YabInterface::WindowClear(const char* window) { YabView *t = (YabView*)((YabTabView*)subchild)->TabAt(i)->View(); RemoveView(t); - viewList->DelView(t->Name()); + viewList->DelView(t->NameForTabView()); } } if(viewList->GetView(subchild->Name())) @@ -3465,7 +3465,7 @@ void YabInterface::RemoveView(BView *myView) { YabView *t = (YabView*)((YabTabView*)child)->TabAt(i)->View(); RemoveView(t); - viewList->DelView(t->Name()); + viewList->DelView(t->NameForTabView()); } } if(is_kind_of(child, YabBitmapView)) @@ -3480,7 +3480,7 @@ void YabInterface::RemoveView(BView *myView) { YabView *t = (YabView*)((YabTabView*)subchild)->TabAt(i)->View(); RemoveView(t); - viewList->DelView(t->Name()); + viewList->DelView(t->NameForTabView()); } } if(viewList->GetView(subchild->Name())) diff --git a/src/YabView.cpp b/src/YabView.cpp index 1706156..43335cf 100644 --- a/src/YabView.cpp +++ b/src/YabView.cpp @@ -48,6 +48,11 @@ YabView::YabView(BRect frame, const char *name, uint32 resizingMode, uint32 flag dropZone = false; pressedKeys.SetTo(""); SetDrawingMode(B_OP_COPY); + + // BTab uses view Name() as displayed label storage, so SetLabel changes it + // this interferes with yab method of referencing views by name + // to be removed + nameWAForTabView = name; } YabView::~YabView() diff --git a/src/YabView.h b/src/YabView.h index 6976ee6..9b40028 100644 --- a/src/YabView.h +++ b/src/YabView.h @@ -27,6 +27,7 @@ class YabView : public BView virtual void MouseDown(BPoint point); virtual void KeyUp(const char *bytes, int32 numBytes); virtual void KeyDown(const char *bytes, int32 numBytes); + const char* NameForTabView() { return nameWAForTabView; } BList *drawList; int mouseMovedInfo; int mouseStateInfo; @@ -39,6 +40,8 @@ class YabView : public BView BString pressedKeys; private: int prevMouseStateInfo; + // TODO: revisit at a later time, more info in constructor + BString nameWAForTabView; }; #endif