[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Re: Button in a table

I figured out a solution -- switching from addSelectionListener() to addListener(SWT.Selection,...).

Don't understand yet why these are different.

Anyone know?

Doug

Doug Pearson wrote:

I'd like to insert a button in a table.

Here's the code I'm using:

    m_Button = new Button(table, SWT.PUSH) ;
    m_Button.setText(first) ;

m_Button.addSelectionListener(new SelectionAdapter() {
public void widgetSelection(SelectionEvent e) {
// Do something here
} } ) ;
TableEditor editor = new TableEditor (table);
editor.grabHorizontal = true;
editor.setEditor(m_Button, item, 1);


The button appears perfectly in the table but I just can't get the selection event to fire.

Am I doing something dumb?  Is there another way to do this?

Doug