Jump to content
twk

GetLBHeaderTextWidth function crashing VW2021

Recommended Posts

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 by twk

Share this post


Link to post

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. 

Share this post


Link to post

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.

 

Share this post


Link to post

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)

 

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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.

  • Like 1

Share this post


Link to post
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 by tbexon

Share this post


Link to post

Ahh yes, that would be me, I forgot I had even signed up as a contributor.

Share this post


Link to post

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...