Jump to content

GetLBHeaderTextWidth function crashing VW2021


twk

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
Link to comment

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. 

Link to comment

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.

 

Link to comment

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)

 

Link to comment

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.

×
×
  • Create New...