twk Posted January 13, 2021 Share Posted January 13, 2021 (edited) vs.GetLBHeaderTextWidth(className, allowForSortIcon) The function above is crashing my VW 2021. Anyone else can confirm before I try a reinstall/bug submission? It gets pixel width for specified string (param:className for some reason??) for use with Dialog ListBrowsers.. Cheers, Tui Edited January 13, 2021 by twk Quote Link to comment
JBenghiat Posted January 13, 2021 Share Posted January 13, 2021 Generally: - VectorScript should never crash the application, even when used improperly, so always report a bug - Unless you modified the application folder (which you shouldn’t do), re-installing the same version won’t resolve any issues. Creating a new user folder can resolve some issues, though. The only thing to check is that you’re passing in a valid string. I believe this command also predates Unicode support, so check that you’re not using any special characters. Quote Link to comment
twk Posted January 13, 2021 Author Share Posted January 13, 2021 Yep, all simple strings in my testing, I shall submit a bug. Do you use ListBrowsers in your plugins @JBenghiat? Have you ported to 2021 yet? All my plugins work and the only ones crashing were the ones with this function in them. Commenting it out solved the issue, but there wasn't anyother way for me to get a proper width value for setting column widths from text strings. I've had to resort to hard coding guessed string lengths for now. Quote Link to comment
JBenghiat Posted January 14, 2021 Share Posted January 14, 2021 I don't use the function — I set column widths based on expected data and the overall width of the dialog. That said, this command doesn't actually rely on list browsers, other than that the pixels are probably calculated based on the LB fonts. Running this command as a standalone script works just fine, so something else might be at play. (SP2) val = vs.GetLBHeaderTextWidth('Some Text', False) vs.Message(val) Quote Link to comment
twk Posted January 14, 2021 Author Share Posted January 14, 2021 Interesting, crashes on me every time, even as a standalone script as you've shown. Are you on Mac? It must be a Windows specific thing. Quote Link to comment
JBenghiat Posted January 14, 2021 Share Posted January 14, 2021 Yes, I'm on the Mac. It could very well be OS specific, even graphics card driver specific, as VW is retrieving the number of display pixels for the string. Quote Link to comment
_c_ Posted January 15, 2021 Share Posted January 15, 2021 Ciao @twk, you got me curious, I can confirm that GetLBHeaderTextWidth doesn't crash on Mac under VW 2021. I have no access to win at the moment. 1 Quote Link to comment
tbexon Posted January 19, 2021 Share Posted January 19, 2021 (edited) val = vs.GetLBHeaderTextWidth('Some Text', False) vs.Message(val) I just tried this on win10 in VW 2021 SP2 (574483) 64 bit and it crashed my VW straight away. Edited January 19, 2021 by tbexon Quote Link to comment
_c_ Posted January 19, 2021 Share Posted January 19, 2021 @twk I added a remark on dev, it is important for people to know it. https://developer.vectorworks.net/index.php/VS:GetLBHeaderTextWidth Is it you the user Tui? I credited to that user. 1 Quote Link to comment
twk Posted January 19, 2021 Author Share Posted January 19, 2021 Ahh yes, that would be me, I forgot I had even signed up as a contributor. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.