Community
Participate
Working Groups
When setting 'setVisible(true)' on a Toolbar inside a setRedraw, toolbar is never shown Below the snippet, clicking on button will show the label, but not the toolbar. Removing setRedraw false/true on toolbar, toolbar will show correctly Display display = Display.getDefault(); Shell s = new Shell(display); s.setBounds(0, 0, 600, 400); Label lbl1 = new Label(s, SWT.NONE); lbl1.setText("label text"); lbl1.setBounds(20, 20, 200, 30); lbl1.setVisible(false); ToolBar toolbar1 = new ToolBar(s, SWT.NONE); ToolItem toolItem = new ToolItem(toolbar1, SWT.PUSH); toolItem.setText("toolbar text"); toolbar1.setBounds(300, 20, 200, 30); toolbar1.setVisible(false); Button b1 = new Button(s, SWT.PUSH); b1.setText("doit"); b1.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { lbl1.setRedraw(false); lbl1.setVisible(true); lbl1.setRedraw(true); toolbar1.setRedraw(false); toolbar1.setVisible(true); toolbar1.setRedraw(true); } }); b1.setBounds(20, 60, 200, 30); s.open(); for( ;; ) { if( display.isDisposed() || s.isDisposed() ) return; if( !display.readAndDispatch() ) display.sleep(); }