Community
Participate
Working Groups
- run the snippet below to see that changing item height (larger) in the initial MeasureItem callback is working - now uncomment the "event.height = 6;" line and note that the item heights are now their normal 14 pixels (at least according to the EraseItem callback), not 6 as was requested - on osx they become the requested smaller-than-default size public static void main(String[] args) { final Display display = new Display(); Shell shell = new Shell(display); shell.setBounds(10,10,200,200); final Table table = new Table(shell, SWT.NONE); table.setBounds(10,10,150,100); new TableItem(table, SWT.NONE).setText("item 1"); new TableItem(table, SWT.NONE).setText("item 2"); table.addListener(SWT.MeasureItem, new Listener() { public void handleEvent(Event event) { event.height = 30; //event.height = 6; } }); table.addListener(SWT.EraseItem, new Listener() { public void handleEvent(Event event) { System.out.println("Erase " + event.getBounds()); } }); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
(In reply to comment #0) > - run the snippet below to see that changing item height (larger) in the > initial MeasureItem callback is working > - now uncomment the "event.height = 6;" line and note that the item heights are > now their normal 14 pixels (at least according to the EraseItem callback), not > 6 as was requested > - on osx they become the requested smaller-than-default size > > public static void main(String[] args) { > final Display display = new Display(); > Shell shell = new Shell(display); > shell.setBounds(10,10,200,200); > final Table table = new Table(shell, SWT.NONE); > table.setBounds(10,10,150,100); > new TableItem(table, SWT.NONE).setText("item 1"); > new TableItem(table, SWT.NONE).setText("item 2"); > table.addListener(SWT.MeasureItem, new Listener() { > public void handleEvent(Event event) { > event.height = 30; > //event.height = 6; > } > }); > table.addListener(SWT.EraseItem, new Listener() { > public void handleEvent(Event event) { > System.out.println("Erase " + event.getBounds()); > } > }); > shell.open(); > while (!shell.isDisposed()) { > if (!display.readAndDispatch()) display.sleep(); > } > display.dispose(); > } > Hi, i've the same problem as you and see that a first limition in the table class : the method that is requested by this event do : if (event.height > getItemHeight ()) setItemHeight (event.height); So normal that item don't grow :(. On windows i try it with only setItemHeight (event.height); and it work. Think that this limition come from other os. regards
*** This bug has been marked as a duplicate of 154341 ***