12-05-2009 12:12 AM
Hi all,
having searched extensively with probably the wrong keywords, i'm hoping someone can point me in the right direction.
My app has a tree control that gets built by reading an Ini file, the icons get populated with custom images from a directory. I'm trying to find a way to be able to interchange those icons after the executable has been built. The current way that i put the icons in the tree is simplistic. the names determine where in the tree they go... i.e. icon_1.jpg , icon_2.jpg , icon_3.jpg ... become the first, second, and third icon.
i just don't want to have to rebuild the app every time a customer wants to replace the icons.
any tips?
thanks in advance!
12-05-2009 12:42 AM
Are you referring to the item symbols?
Look under the Invoke Node for the tree control. There is a several methods associated with the custom symbol array. I've never done it, so I don't know the exact steps. But if you are able to load your pictures from your file, turn them into LabVIEW images, you should be able to use the invoke node to get and set each element of the custom symbol array.
12-07-2009 09:36 AM
Thanks Raven Fan for the reply,
I was in fact referring to the item symbols. Sorry for the confusion.
I don't have any problems loading custom images as my item symbols. My app loops over the names of all the jpegs in a directory in alphabetical order, and loads them into the tree at runtime.
What i'd like to do after the executable is built, is to swap those jpegs out so the next time the program ran, it loaded different item symbols into the tree.
I don't have any experience with dll's and LabVIEW, and am ASSuming that's the route i'm going to be told to go... Maybe i'm just not doing something right in the application builder. Is there a way to externalize the directory where the jpegs are so it doesn't get compiled into the exe?
Below is an example of what i'm trying to convey...
the blue flame would be named icon_1, the truck is icon_2, the cylinder is icon_3, etc. i'd like to allow every customer to have the ability to customize the tree symbols to their own liking, without me having to swap the icons, and rebuild the .exe
Thanks in advance!
12-07-2009 09:48 AM
I'm curious as to how you are loading the custom item symbols now. I haven't used trees, nor custom symbols, so I can't confirm how this would work.
But those property nodes should be able to do what you want. This is how I think it should work:
1. At the beginning of your program, you do whatever you need to to programmatically determine where to load the symbols from.
2. Programmatically read the files using the picture VI's and load the image data into those property nodes.
3. Continue with your program.
12-07-2009 10:10 AM
12-07-2009 10:16 AM - edited 12-07-2009 10:18 AM
12-07-2009 12:11 PM
12-08-2009 12:16 PM
I was thinking you weren't understanding my problem, but now i'm with ya.![]()
(For future reference: simpletons require extremely explicit instructions)
I put together a test project/app to play with, and it seems that i was doing something wrong between development and build regarding the paths. In this test i used a path browser control instead of a constant and it correctly loaded the item symbols from a directory outside the executable.
I'll attach the zip. (LV 8.5)
thanks for your patience.
12-08-2009 12:54 PM
12-08-2009 02:26 PM
yeah... bitten by that one before.
this one was a little fuzzier in my tunnel vision mode. After building my executable, i had this:
C:\build\MyApplication.exe\Application.vi
C:\build\MyApplication.exe\icons\
C:\build\MyApplication.exe\icons\icon_1
C:\build\MyApplication.exe\icons\icon_2
C:\build\MyApplication.exe\icons\icon_3
What i really wanted was:
C:\build\MyApplication.exe
C:\build\icons\icon_1
C:\build\icons\icon_2
C:\build\icons\icon_3
So a combination of my project settings AND path problems.