LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between SetTableColumnAttribute and setting attributes in .uir

Hello,

 

I was successfully setting the column width of a table using the function SetTableColumnAttribute and the attribute ATTR_COLUMN_WIDTH.  However, when I tried running the GUI on a co-workers wide-screen monitor, the other GUI controls stretched appropriately but the table did not.  I was able to resolve this problem by deleting the code to programmatically set the column width and instead I set the column width in the .uir by setting "Use Explicit Size" for each column. 

 

My questions are: what's the difference between setting the column width to an explicit size in the .uir and setting the column width to an explicit size programmatically?  Why do they behave differently on different monitors?  Thank you for your help!

0 Kudos
Message 1 of 3
(3,043 Views)

Christine,

 

There is a slight difference in that the only time that the programmatic modification of the ATTR_COLUMN_WIDTH takes affect is when the column is set to  'Use Explicit Size'.  You can test this by outputting the width of the column to your front panel using ATTR_COLUMN_ACTUAL_WIDTH while cycling between size modes.  So in this case I believe the difference is in the implementation of the code versus in the GUI.  However, if you set the size mode (either programmatically using ATTR_SIZE_MODE or in the .uir) to Use Explicit Size then I believe you will see the same behavior whether you go through the GUI or assign a width programmatically.  Good luck with your project and happy programming!

 

Regards,

Trey C.

0 Kudos
Message 2 of 3
(3,018 Views)

In addition to Trey suggestions, it is to be noted that every automatic adjustment of object dimensions is applied when a panel is resized any way and no further. That is, if you set column width after you change panel dimensions, then no automatic adjustment will be performed based on different panel dimensions. On the other hand if you set table column with before changing panel dimensions then you should see the table adjusted as well as others control on the panel.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 3 of 3
(3,009 Views)