Hi

I am currently trying to use the IKImageBrowserView and am struggling
with trying to set some of the view options. The apple docs for this
class state that the following keys are available:

        NSString * const IKImageBrowserBackgroundColorKey;
        NSString * const IKImageBrowserSelectionColorKey;
        NSString * const IKImageBrowserCellsOutlineColorKey;
        NSString * const IKImageBrowserCellsTitleAttributesKey;
        NSString * const
IKImageBrowserCellsHighlightedTitleAttributesKey;
        NSString * const IKImageBrowserCellsSubtitleAttributesKey;

So, in my code, I write something like:

        imageBrowserView.SetValueForKey(NSColor.BlackColor,
"IKImageBrowserBackgroundColorKey");

This successfully sets the background of the image browser view to
black. However, if I do:

        imageBrowserView.SetValueForKey(NSColor.RedColor,
"IKImageBrowserSelectionColoKeyr");

nothing happens. This is supposed to set the background highlight of a
selected image's title to red.

There is a minor red herring here. Note that the key name I pass in here
ends with "...SelectionColoKeyr" rather than "...SelectionColorKey" -
the "r" in "Color" is put to the end of the string. This is because this
is what the NSString const is defined as - a minor spelling mistake on
apple's part. This can be verified by doing all of this in Objective-C
and XCode. Also, spelling the key "correctly" still does not work in C#.

Also note that I can do 

    Id val =
imageBrowserView.ValueForKey("IKImageBrowserSelectionColoKeyr");
    NSColor color = val.CastTo<NSColor>();

    imageBrowserView.SetValueForKey(NSColor.RedColor,
"IKImageBrowserSelectionColoKeyr");

    Id val2 =
imageBrowserView.ValueForKey("IKImageBrowserSelectionColoKeyr");
    NSColor color2 = val2.CastTo<NSColor>();

in order to verify that the value for the specified key does change and,
in this example, color2 is indeed red. I also have trouble in setting
the "IKImageBrowserCellsHighlightedTitleAttributesKey" key.

Anyone have any ideas about this?

Thanks,
Steven



Reply via email to