alecjcook Posted October 14, 2015 Report Share Posted October 14, 2015 Hi. I was to drag a file from the finder onto a 'listbox' type object in a LabVIEW vi. I then want the object to display the complete path of a file. I can make a "Path" type object do this, but i do not seem able to do the same with a listbox. Does anyone know if this is possible? Code Attached. Drag'n'Drop-Listbox.vi Many thanks, Alec Quote Link to comment
hooovahh Posted October 14, 2015 Report Share Posted October 14, 2015 What is a "finder". Do you mean you are dragging and dropping from the Windows explorer window? If so someone posted an example on LAVA that uses some windows messaging library. https://lavag.org/topic/14540-drop-into-a-tree-from-other-program/#entry87760 Another trick I've seen is that the path control allows you to drop files on it, so you might be able to get a path control and make it transparent, and put it over your listbox. Quote Link to comment
alecjcook Posted October 14, 2015 Author Report Share Posted October 14, 2015 (edited) What is a "finder". Do you mean you are dragging and dropping from the Windows explorer window? If so someone posted an example on LAVA that uses some windows messaging library. https://lavag.org/topic/14540-drop-into-a-tree-from-other-program/#entry87760 Another trick I've seen is that the path control allows you to drop files on it, so you might be able to get a path control and make it transparent, and put it over your listbox. Whats A FINDER! Dang, you kids. (The finder is what windows explorer used to be called on the Apple Macintosh, LabVIEW also comes on Macintosh, In-fact, it was there first, Microsoft were late to the party... As usual! ... ). Yes, I do mean Explorer, think i had a relapse. Will check out the link, thanks. OK, so what you are saying is that you just can't. LabVIEW does not support dragging from the desktop and dropping on it... Hmmm, rubbish. Edited October 14, 2015 by alecjcook Quote Link to comment
hooovahh Posted October 14, 2015 Report Share Posted October 14, 2015 Whats A FINDER! Dang, you kids. (The finder is what windows explorer used to be called on the Apple Macintosh, LabVIEW also comes on Macintosh, In-fact, it was there first, Microsoft were late to the party... As usual! ... ). Yes, I do mean Explorer, think i had a relapse. Will check out the link, thanks. OK, so what you are saying is that you just can't. LabVIEW does not support dragging from the desktop and dropping on it... Hmmm, rubbish. So I'm a bit confused, are you on Windows or Mac, cause you say you mean Explorer, but then said Finder which "is what windows explorer used to be called". I believe Windows Explorer used to be called File Manager in the Windows 3.x days. And what do you mean by "Dang you kids", there could be people of any age that just have never used a Mac. I didn't say LabVIEW doesn't support drag and drop, I'm saying there are options for doing drag and drop from an Explorer, but none are clean, other than onto a path control. I've seen several neat examples, like this one with dragging an image on a tab. The source isn't available but I wouldn't be surprised if a path control just isn't on top of the image since you don't interact with the image. I believe LabVIEW doesn't have a unified way of doing this because it is cross platform, and you could be using any number of shells for any OS and supporting all of them would be a pain. I like the idea, but I have yet to need this feature. Quote Link to comment
ShaunR Posted October 14, 2015 Report Share Posted October 14, 2015 And what do you mean by "Dang you kids", there could be people of any age that just have never used a Mac. Easy tiger. He was just being jocular with an expression.. 1 Quote Link to comment
hooovahh Posted October 14, 2015 Report Share Posted October 14, 2015 Easy tiger. He was just being jocular with an expression.. I didn't mean anything by it and didn't really take offense, sorry if it came across as hostile. (BTW I am one of those dang kids ) (but I also haven't used a Mac for more than 5 minutes in my life) Quote Link to comment
alecjcook Posted October 14, 2015 Author Report Share Posted October 14, 2015 So I'm a bit confused, are you on Windows or Mac, cause you say you mean Explorer, but then said Finder which "is what windows explorer used to be called". I believe Windows Explorer used to be called File Manager in the Windows 3.x days. And what do you mean by "Dang you kids", there could be people of any age that just have never used a Mac. I didn't say LabVIEW doesn't support drag and drop, I'm saying there are options for doing drag and drop from an Explorer, but none are clean, other than onto a path control. I've seen several neat examples, like this one with dragging an image on a tab. The source isn't available but I wouldn't be surprised if a path control just isn't on top of the image since you don't interact with the image. I believe LabVIEW doesn't have a unified way of doing this because it is cross platform, and you could be using any number of shells for any OS and supporting all of them would be a pain. I like the idea, but I have yet to need this feature. LabVIEW might support the dragging from explorer and dropping on a 'Path' control, but it does NOT support the dragging from explorer and dropping on a 'List Box'. * "Dang You Kids" is supposed to be a light harder jove. I am british so it's not even a thing i'd say in real life. If I repeated some of the sarcasm us brits use, you really would take it the wrong way Quote Link to comment
ShaunR Posted October 14, 2015 Report Share Posted October 14, 2015 If I repeated some of the sarcasm us brits use, you really would take it the wrong way It doesn't stop me so I expect people in here are acclimatised I didn't mean anything by it and didn't really take offense, sorry if it came across as hostile. (BTW I am one of those dang kids ) (but I also haven't used a Mac for more than 5 minutes in my life) Guess how many toolkits Mac users buy? Guess how many queries I have had for installing any of my toolkits on Mac? : Quote Link to comment
QueueYueue Posted October 14, 2015 Report Share Posted October 14, 2015 LabVIEW might support the dragging from explorer and dropping on a 'Path' control, but it does NOT support the dragging from explorer and dropping on a 'List Box'. It's possible to use the path control to do what you want, but it's a little hack-ey. You end up making the path control transparent, then only making it visible when the mouse is outside the VI's front panel. See http://digital.ni.com/public.nsf/allkb/81D867F8C6A1376D86257347001BE936 1 Quote Link to comment
hooovahh Posted October 14, 2015 Report Share Posted October 14, 2015 Oh that's not that too hacky, thanks for the link a quick search didn't find that one. I was wondering how you would hide or shot based on mouse movement. I guess the trick is that the Mouse Enter event isn't when dragging from explorer, until you release the mouse button. Quote Link to comment
ThomasGutzler Posted October 15, 2015 Report Share Posted October 15, 2015 It's possible to use the path control to do what you want, but it's a little hack-ey. You end up making the path control transparent, then only making it visible when the mouse is outside the VI's front panel. See http://digital.ni.com/public.nsf/allkb/81D867F8C6A1376D86257347001BE936 And when you want it to accept dropping of multiple files you enter the next level in the world of pain Quote Link to comment
Yair Posted October 15, 2015 Report Share Posted October 15, 2015 acclimatiszed FTFY. Brits... 1 Quote Link to comment
ShaunR Posted October 15, 2015 Report Share Posted October 15, 2015 FTFY. Brits... Your impression of Brits is rather coloured when you can't even spell 50. Quote Link to comment
hooovahh Posted October 15, 2015 Report Share Posted October 15, 2015 Your impression of Brits is rather coloured when you can't even spell 50. (but seriously I realize there are spelling differences between us) Quote Link to comment
Yair Posted October 15, 2015 Report Share Posted October 15, 2015 Your impression of Brits is rather coloured when you can't even spell 50 FTFY. FTFY 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.