getSize() always returns Point{0,0} on Button in GridLayout [message #452256] |
Wed, 16 March 2005 04:27 |
Eclipse User |
|
|
|
Originally posted by: Blum_Thomas.nospam.web.de
Hi,
from the main-method I call the method "initButtons" with constants
colCount and rowCount:
private static void initButtons(){
buttons = new Button[colCount][rowCount];
for (int i=0; i<=colCount-1; i++)
for (int j=0; j<=rowCount-1; j++){
final int col = i;
final int row = j;
buttons[i][j] = new Button(shell, SWT.PUSH);
buttons[i][j].setLayoutData(new
GridData(GridData.HORIZONTAL_ALIGN_FILL |
GridData.VERTICAL_ALIGN_FILL |
GridData.GRAB_HORIZONTAL |
GridData.GRAB_VERTICAL));
buttons[i][j].setText(buttons[i][j].getSize().toString());
buttons[i][j].addSelectionListener(new SelectionAdapter(){
public void widgetSelected(SelectionEvent e){
handleButtonClick(col, row);
};
});
}
The buttons are always showing "Point{0,0}" but they are in fact much
bigger (about 250x130).
Can anybody tell me how to get the real size of the buttons?
Regards
Thomas Blum
--
Erstellt mit Operas revolutionärem E-Mail-Modul: http://www.opera.com/m2/
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03866 seconds