Jim Kring Posted November 30, 2008 Report Share Posted November 30, 2008 [cross posted to ni.com] The file dialog allows specifying multiple types (that can be selected by the user) by passing the dialog primitive a semicolon delimited list of patterns. For example, you can allow the user to choose TXT or INI file types by passing a pattern of "*.txt;*.ini" to the file dialog primitive, as shown below: However, when this is run on Mac OS X, neither of the specified file types is selectable by the user, as shown below: I have tested this on LabVIEW 8.2 and 8.6 for Mac -- both have the same problem. Here is an example that can be used to test the bug: Download File:post-17-1227995063.zip The help documentation for the File Dialog primitive states that this should work on all platforms -- there is no exception for Mac: QUOTE pattern (all files) Restricts the files displayed in the dialog box to those whose name matches pattern (all files). pattern (all files) does not restrict the directories displayed. The pattern matching in this function is similar to the matching used in matching wildcards in Windows and Linux file names. If you specify characters other than the question mark character (?) or the asterisk character (*), the function displays only files or directories that contain those characters. You can use the question mark character (?) to match any single character. You can use the asterisk character (*) to match any sequence of one or more characters. For example, a pattern (all files) of *.vi;test*.llb returns matches for any file with a .vi extension and any file whose file name begins with test and has a .llb extension. To match multiple patterns, use a semicolon ( ; ) to separate the patterns. White space, such as blanks, tabs, and carriage returns, are taken literally. Avoid using white spaces unless they are part of the extension pattern. For example, if you use *.html;*.doc, the dialog box displays all files that end with .html and .doc. If you use *.html; *.doc, the dialog box displays only files that end with .html. Does anyone know a work-around or if I'm doing something wrong? Quote Link to comment
Tomi Maila Posted November 30, 2008 Report Share Posted November 30, 2008 Sounds like a bug to me. For a work-around, I don't have a mac to test but... We can assume that there is an OS primitive dialog that LabVIEW calls. So try to figure out what the dialog in question is. It may be tk_getSaveFile or something similar. Now check the manual page for the identified OS primitive, how you should pass it the file pattern list and try to mimic it in your LabVIEW file pattern input. I don't know if this helps at all but maybe gives you a little hope. Quote Link to comment
Jim Kring Posted December 2, 2008 Author Report Share Posted December 2, 2008 QUOTE (Tomi Maila @ Nov 29 2008, 03:24 PM) Sounds like a bug to me. For a work-around, I don't have a mac to test but...We can assume that there is an OS primitive dialog that LabVIEW calls. So try to figure out what the dialog in question is. It may be http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/mann/tk_getSaveFile.ntcl.html' rel='nofollow' target="_blank">tk_getSaveFile or something similar. Now check the manual page for the identified OS primitive, how you should pass it the file pattern list and try to mimic it in your LabVIEW file pattern input. I don't know if this helps at all but maybe gives you a little hope. Hi Tomi, Thanks for the suggestion. I guess a work around might be to create our own native file dialog using Carbon Framework API calls. -Jim Quote Link to comment
Jim Kring Posted December 3, 2008 Author Report Share Posted December 3, 2008 Confirmed by NI and CAR # assigned. [CAR 818352] Status: Fix planned for next major LabVIEW release (post 8.6 ==> 8.7 or 9.0?) Quote Link to comment
Phillip Brooks Posted December 3, 2008 Report Share Posted December 3, 2008 QUOTE (Jim Kring @ Nov 29 2008, 04:32 PM) Out of curiosity, is the "::" path constant input to the Build Path function a Mac specific value? LabVIEW for Windows automatically replaces "::" with "C:\:" Quote Link to comment
Jim Kring Posted December 3, 2008 Author Report Share Posted December 3, 2008 QUOTE (Phillip Brooks @ Dec 2 2008, 10:07 AM) Out of curiosity, is the "::" path constant input to the Build Path function a Mac specific value? LabVIEW for Windows automatically replaces "::" with "C:\:" The relative path of "::" on Mac is equivalent to ".." (parent directory) on Windows and Linux. I tested opening the vi (Test File Patterns.vi) on LabVIEW 8.2.1, 8.5.1 and 8.6 in Windows and it works fine for me: http://lavag.org/old_files/monthly_12_2008/post-17-1228245191.png' target="_blank"> Quote Link to comment
Jim Kring Posted December 4, 2008 Author Report Share Posted December 4, 2008 Correction ==> CAR # 111447 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.