Community
Participate
Working Groups
On Linux, TableColumn#getWidth() sometimes incorrectly returns 0. OS*: Linux paules 2.6.16.53-0.16-smp #1 SMP Tue Oct 2 16:57:49 UTC 2007 x86_64 x86_64 x86_64 GNU/Linux *Note, running in 32-bit compatibility mode. However, symptoms are reproducible on 32-bit architectures. Eclipse SDK: Version: 3.4.0 Build id: I20080330-1350 JRE: java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build pxi32dev-20070201 (SR4))IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Linux x86-32 j9vmxi3223-20070201 (JIT enabled) J9VM - 20070131_11312_lHdSMR JIT - 20070109_1805ifx1_r8 GC - 200701_09) JCL - 20070126 Steps to reproduce: 1) Run the enclosed TableTest.java. 2) Click the Add button. 3) Select Tab2. 4) Select Tab1. 5) Click the Add button. 4) Note the following output: Column1 width: 100 Column1 width: 100 Column2 width: 100 Column1 width: 100 Column2 width: 100 Column1 width: 0 Column2 width: 0 Column3 width: 100 The first two columns return a zero width.
Created attachment 95945 [details] TableTest.java
Praveen to investigate.
Is there any update on this defect?
We are working on this right now. When a new column is added to the Table, correct width values will be retrieved only after the size allocation happens. However, in the specified scenario, when the TabItem is switched after pressing ADD button, size allocation does not occur and hence values for table column are incorrectly returned by GTK. We are working for determining the solution for this problem and we will get back to you then. Thanks.
Created attachment 129444 [details] Proposed patch If a new table column is added when the table is not visible, then the table is not allocated/resized immediately. Due to this, querying the width at this time results in incorrect value from GTK. Code had been modified to make sure that the table columns are always resized (when the table is invisible) after a new table column is added. I have unit tested the code changes with the provided sample. Bogdan, please suggest if I miss anything in the code change. Thanks !
Created attachment 129446 [details] Test case Test case (slightly modified from the attached snippet) for testing the code changes. Add/Display buttons are added to add the table column when the table is visible. This proves that currently(with code change) there is no difference if a table column is added when the table is visible or invisible. Table is hooked up with the Resize event to make sure whether they are caught at the right time. I verified they are working fine with the new code changes.
Patch released to HEAD. Thanks! Fixed in HEAD > 20090331
Verified in TPTP-4.6.0RC5-200906160940. Closing.