Ticket #13731: TabView_RemoveTab.cpp

File TabView_RemoveTab.cpp, 696 bytes (added by jalopeura, 2 years ago)

Simple program to reproduce the bug

Line 
1#include <Application.h>
2#include <Window.h>
3#include <TabView.h>
4#include <stdio.h>
5
6int main() {
7 new BApplication("application/x-vnd.TabView_RemoveTab.test");
8 BWindow* window = new BWindow(BRect(50,50,550,550), "TabView_RemoveTab", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE, 0);
9 BTabView* view = new BTabView(BRect(5,5,495,495), "View");
10
11 view->AddTab(new BView(BRect(0,0,100,100), "One", 0, 0));
12 view->AddTab(new BView(BRect(0,0,100,100), "Two", 0, 0));
13 view->AddTab(new BView(BRect(0,0,100,100), "Three", 0, 0));
14
15 printf("focus tab: %d\n", view->FocusTab());
16 view->RemoveTab(0);
17 printf("focus tab: %d\n", view->FocusTab());
18
19 window->AddChild(view);
20 window->Show();
21 be_app->Run();
22}