TabbedComponent problem


#1

I tested it with the JuceDemo

just add more then 8 tabs to a tabbed component, and it will crash

This crashes when viewing the widgets demo

DemoTabbedComponent()
        : TabbedComponent (TabbedButtonBar::TabsAtTop)
    {
        addTab ("sliders",       getRandomBrightColour(), createSlidersPage(),      true);
        addTab ("toolbars",      getRandomBrightColour(), new ToolbarDemoComp(),    true);
        addTab ("buttons",       getRandomBrightColour(), new ButtonsPage (this),   true);
        addTab ("radio buttons", getRandomBrightColour(), createRadioButtonPage(),  true);
        addTab ("misc widgets",  getRandomBrightColour(), createMiscPage(),         true);
		addTab ("misc widgets",  getRandomBrightColour(), createMiscPage(),         true);
		addTab ("misc widgets",  getRandomBrightColour(), createMiscPage(),         true);
		addTab ("misc widgets",  getRandomBrightColour(), createMiscPage(),         true);
		addTab ("misc widgets",  getRandomBrightColour(), createMiscPage(),         true);
		addTab ("misc widgets",  getRandomBrightColour(), createMiscPage(),         true);
    }

This does not

DemoTabbedComponent()
        : TabbedComponent (TabbedButtonBar::TabsAtTop)
    {
        addTab ("sliders",       getRandomBrightColour(), createSlidersPage(),      true);
        addTab ("toolbars",      getRandomBrightColour(), new ToolbarDemoComp(),    true);
        addTab ("buttons",       getRandomBrightColour(), new ButtonsPage (this),   true);
        addTab ("radio buttons", getRandomBrightColour(), createRadioButtonPage(),  true);
        addTab ("misc widgets",  getRandomBrightColour(), createMiscPage(),         true);
		addTab ("misc widgets",  getRandomBrightColour(), createMiscPage(),         true);
		addTab ("misc widgets",  getRandomBrightColour(), createMiscPage(),         true);
		addTab ("misc widgets",  getRandomBrightColour(), createMiscPage(),         true);
		//addTab ("misc widgets",  getRandomBrightColour(), createMiscPage(),         true);
		//addTab ("misc widgets",  getRandomBrightColour(), createMiscPage(),         true);
    }

sidenote, i re-fetched the whole git repo and i tried the old jucer, release build crashes, debug build throws some exceptions and runs, but if you add more then 8 components to edit it crashes like the demo.


#2

Ouch! Thanks, that was a very subtle bug! Will get a fix checked in shortly…