10-08-2024 05:22 AM
I am trying to generate a Palette containing a bunch of elements for User Interfaces. This palette contains all the .ctl files but some of my elements are stored in .png files. Theorically it is as simple as drag-and-drop the png into the Front Panel of the UIs and it will appear as a decoration. What I am trying to do is instead of searching for this png files every time, having a palette that already contains this png elements.
Option 1. Is there a way of adding a .png to the Controls Palette?
Option 2. Converting all of the .png to .ctl by creating one control for each one of the elements. For this I tried to automate adding the .png as a decoration in the front panel - as simple as the drag and drop, but programmatically. I am stuck on this point where i need to create a new decoration out of a .png programatically, but no information have I found about this topic.
What I'm requesting is to get any feedback on how to resolve the problem with either option 1 or 2.
10-08-2024 10:50 AM
If the png is a VI Snippet, it is a VI appended to the end of the png. You can simply split the file by search for the VI "header": RSRC. A VI can have more than one RSRC.
10-09-2024 04:08 AM
Without digging too much into it, here are a couple of options for option 2:
Note that in both cases, you will have a control in the end, which will have a corresponding terminal in the BD.
Another option would be to build your own floating palette and drag from there (probably using the copy and paste method). This is a bit trickier because deciding when to open and show the palette and handling the dragging can probably a pain (another partially transparent window?).