01-18-2023 03:03 AM - edited 01-18-2023 03:07 AM
I want to make a button with a custom icon. I've made one succesfully (see attached) but when I click on the part of the button where the image is, the button doesn't toggle.
I know it can work, since the built-in "silver" button pallette has buttons with icons that toggle when you click anywhere. I want to have it like that, but with the NXG or System button pallette.
How can I do this?
01-18-2023 03:50 AM
01-18-2023 04:04 AM
I've tried this but the image shows as a black square on the button:
I've tried other icons that do seem to work however, maybe my image has some problems. Thank you for the reply!
01-18-2023 08:30 AM
You have to load the image into clipboard using LabVIEW menu function:
menubar => Edit => Import Picture to Clipboard
01-18-2023 12:33 PM
So first off, in order to be able to add pictures for each button state (there are 6 total button states on a System Boolean), you need to click the little wrench icon to change to Customize Mode. One by one, you will have to select the active Picture Item and assign a picture to it. Going from left to right, top to bottom, IIRC the states are as follows: off, on, on-off transition, off-on transition, mouse un-hover, mouse hover. Using these, you can make the control more visually interactive by doing something such as "lighting up the lightbulb" when the user clicks it, or adding a hover effect by making the "hover image" background color a few shades darker/lighter.
There are a couple caveats with this: the main one is that the image scales with the button when you make it larger, which can lead to very skewed/pixelated images if you change the size a bunch. The other somewhat related one, is that the image does in fact scale with the button as opposed to not scaling, as is the case on the default Silver Booleans that have images on them.
One other tidbit, if you start your custom control with one of those default Silver Booleans with an image in them, you can make a custom button of that "type", that has both a non-scaling image and associated text. But in that case you lose the "hover" picture items. If there's a way to add a non-scaling image to a custom System Boolean, I'd love to know how.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
01-18-2023 01:11 PM
> If there's a way to add a non-scaling image to a custom System Boolean, I'd love to know how.
If you import the image as a decal, the decal can be set to non-scaling.
01-18-2023 01:24 PM
@zou wrote:
> If there's a way to add a non-scaling image to a custom System Boolean, I'd love to know how.
If you import the image as a decal, the decal can be set to non-scaling.
Good to know. That almost works the way I wish it did. The only thing is, the decal image doesn't stay vertically centered the way the Silver Booleans' decal images do. Or at least, in LV17 I can't figure out how to make the decal image behave that way.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
01-18-2023 01:37 PM
Add enableSecretPopups to labview.ini
Then you will get a lot of new settings.
01-18-2023 01:40 PM
The "missing" system controls are examples:
Take a look this page for customize controls:
01-18-2023 01:49 PM
@zou wrote:
Add enableSecretPopups to labview.ini
Then you will get a lot of new settings.
Wow you weren't lying about there being a lot of extra options. 10x Kudos for this token that I had never come across until now.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.