SWT composite - redraw problem

后端 未结 2 752
不思量自难忘°
不思量自难忘° 2021-02-14 05:04

I have a composite element, that initially has a Label. Now I call dispose on the it (the label) and create another label in the same container (composite elm), but I don\'t see

相关标签:
2条回答
  • 2021-02-14 05:17

    In the changeText() function, the

    testCell.redraw();

    line should be replaced by

    testCell.layout();

    Or, if you want to resize it correctly you should use

    shell.layout();.

    0 讨论(0)
  • 2021-02-14 05:17

    I would say add a selectionListener on the label.

    .addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            //Change text by Label.setText();
        }
    }
    
    0 讨论(0)
提交回复
热议问题