Professional Web Applications Themes

How to show hidden file/folder in NSOpenPanel ? - Mac Programming

How to show hidden file/folder in NSOpenPanel ? (BBedit does it!)...

  1. #1

    Default How to show hidden file/folder in NSOpenPanel ?

    How to show hidden file/folder in NSOpenPanel ?

    (BBedit does it!)
    Alain Guest

  2. #2

    Default Re: How to show hidden file/folder in NSOpenPanel ?

    Alain Birtz <ca> wrote:
     

    I think this is covered in the delegate methods for NSSavePanel...? m.

    --
    matt neuburg, phd = com, http://www.tidbits.com/matt/
    AppleScript: The Definitive Guide
    http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt
    Read TidBITS! It's free and smart. http://www.tidbits.com
    matt Guest

  3. #3

    Default Re: How to show hidden file/folder in NSOpenPanel ?

    Alain Birtz wrote: 

    Check the docs for NSSavePanel (NSOpenPanel's superclass). There's a
    description for -
    panel:shouldShowFilename:, which you should implement in the OpenPanel's delegate.

    -jcr
    John Guest

  4. #4

    Default Re: How to show hidden file/folder in NSOpenPanel ?

    With this code

    -(BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename
    {
    return YES;
    }

    the NSOpenPanel show all file/dir as usual.
    Other hidden file/dir (like .DS_Store or .Trashes) are not show.

    It seem that shouldShowFilename is used only to not show some of the
    file/dir that are show as usual.

    Do I miss someting ?

    In article <idiom.com>, "John C. Randolph"
    <idiom.com> wrote:
     
    >
    > Check the docs for NSSavePanel (NSOpenPanel's superclass). There's a
    > description for -
    > panel:shouldShowFilename:, which you should implement in the OpenPanel's[/ref]
    delegate. 
    Alain Guest

  5. #5

    Default Re: How to show hidden file/folder in NSOpenPanel ?

    Alain Birtz wrote: 

    No, but I did. You'll need to set AppleShowAllFiles to YES in the
    shared user defaults. Sometime early in your program's execution, do this:

    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:"AppleShowAllFiles"];

    Sorry about that.. I have it turned on globally on my system, so I'd
    forgotten about it.

    -jcr
    John Guest

  6. #6

    Default Re: How to show hidden file/folder in NSOpenPanel ?

    I set the call

    [[NSUserDefaults standardUserDefaults] setBool:YES
    forKey:"AppleShowAllFiles"];

    in "- (id)init" (tested also in "- (void)awakeFromNib") of MenuController but
    without success. "filename" in

    -(BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename

    do not report any hidden file (just the usual one).

    I also try in Terminal the command

    defaults write com.apple.finder AppleShowAllFiles TRUE

    The Finder window show hidden file but the NSSavePanel still report
    only non-hidden file...



    In article <idiom.com>, "John C. Randolph"
    <idiom.com> wrote:
     
    >
    > No, but I did. You'll need to set AppleShowAllFiles to YES in the
    > shared user defaults. Sometime early in your program's execution, do this:
    >
    > [[NSUserDefaults standardUserDefaults] setBool:YES[/ref]
    forKey:"AppleShowAllFiles"]; 
    Alain Guest

  7. #7

    Default Re: How to show hidden file/folder in NSOpenPanel ?

    In article <168.1.3>, Alain Birtz
    <ca> wrote:
     

    -(id)init probably isn't getting called. The place to do this kind of
    global initialization is in an +initialize CLASS method. This will be
    called when the class is first loaded. This only needs to be done once
    so I typically do it in my application delegate class. You will want
    to test for whether this has already been done "just in case":

    + (void)initialize
    {
    static BOOL initialized = NO;
    if(!initialized)
    {
    // This is where you set up your user defaults in case there
    // is no preferences file; you could set up AppleShowAllFiles
    // and write it to the user defaults as you have been trying
    // do do but could also call the more typical setInitialValues:
    // In any case finish with:
    initialized = YES;
    }
    }

    See the doentation for NSObject's +initialize and NSUserDefaults
    -setInitialValues methods.

    Spence

    --
    James P. Spencer
    Rochester, MN

    "Badges?? We don't need no stinkin badges!"
    James Guest

  8. #8

    Default Re: How to show hidden file/folder in NSOpenPanel ?

    Alain Birtz wrote: 

    Sorry, it looks like this behavior has changed from Jaguar to Panther.
    I'll ask around, and see what I come up with.

    -jcr
    John Guest

  9. #9

    Default Re: How to show hidden file/folder in NSOpenPanel ?

    OK. I will wait your answer.

    Thank a lot.


    In article <idiom.com>, "John C. Randolph"
    <idiom.com> wrote:
     [/ref]
    MenuController but 
    >
    > Sorry, it looks like this behavior has changed from Jaguar to Panther.
    > I'll ask around, and see what I come up with.
    >
    > -jcr[/ref]
    Alain Guest

Similar Threads

  1. Replies: 0
    Last Post: January 30th, 10:27 AM
  2. How to show hidden surfaces using 3D effect
    By jaime_ash@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 2
    Last Post: April 10th, 01:33 AM
  3. Hidden Tools don't show in ImageReady 3
    By Eric Purkalitis in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 1
    Last Post: August 27th, 12:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139