public ControlExample(Composite parent) {
		initResources();
		tabFolder = new TabFolder (parent, SWT.NONE);
		tabs = createTabs();
		for (int i=0; i<tabs.length; i++) {
			TabItem item = new TabItem (tabFolder, SWT.NONE);
		    item.setText (tabs [i].getTabText ());
		    item.setControl (tabs [i].createTabFolderPage (tabFolder));
		    item.setData (tabs [i]);
		}
		
		/* Workaround: if the tab folder is wider than the screen,
		 * Mac platforms clip instead of somehow scrolling the tab items.
		 * We try to recover some width by using shorter tab names. */
		Point size = parent.computeSize(SWT.DEFAULT, SWT.DEFAULT);
		Rectangle monitorArea = parent.getMonitor().getClientArea();
		boolean isMac = SWT.getPlatform().equals("carbon") || SWT.getPlatform().equals("cocoa");
		if (size.x > monitorArea.width && isMac) {
			TabItem [] tabItems = tabFolder.getItems();
			for (int i=0; i<tabItems.length; i++) {
				tabItems[i].setText (tabs [i].getShortTabText ());
			}
		}
		startup = false;
	}