【问题标题】:How to find the full path for finder overlay icon in icon view?如何在图标视图中找到查找器覆盖图标的完整路径?
【发布时间】:2012-11-07 09:26:07
【问题描述】:

我正在使用 simbl 插件在查找器中添加叠加图标,如下所示:finder overlay icon

问题是:我在覆盖函数中找不到正确的方法来获取文件的完整路径:IKImageBrowserCell 中的FO_drawImage,我只得到一个标题。

   - (void)FO_drawImage:(id)fp8
    {
        NSString *title = [self previewItemTitle];
        if ([[title lowercaseString] hasPrefix:@"a"])

    {
        NSImage *icon = [fp8 _nsImage];

        NSRect frame = [self imageFrame];
        NSLog(@"drawing width %.0f for name '%@' icon %@",frame.size.width,title,icon);
        [icon lockFocus];
        CGContextRef myContext = [[NSGraphicsContext currentContext] graphicsPort];
        CGContextSetRGBFillColor (myContext, 1, 0, 0, 1);
        CGContextFillEllipseInRect(myContext, CGRectMake (0, 0, 10, 10 ));
        [icon unlockFocus];
        [self FO_drawImage:[[[IKImageWrapper alloc] initWithNSImage:icon] autorelease]];

    } else {
        [self FO_drawImage:fp8];
    }
}

【问题讨论】:

  • 当我使用 IKImageWrapper 时,我的 xcode 给我信息 "(null): "_OBJC_CLASS_$_IKImageWrapper",引用自:"我想知道为什么?

标签: icons overlay finder simbl


【解决方案1】:
NSURL *item_url = [self previewItemURL];

应该在 MacOSX 10.7 上涵盖它

【讨论】:

    猜你喜欢
    • 2018-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多