Hi Yann,

On Apr 19, 2008, at 10:51 AM, Yann Disser wrote:

Is there a way to change the spacing of the images in an IKImageBrowserView? In InterfaceBuilder?

No, the only thing you can do to impact the cell-spacing is to use setCellSize and give a non square size (a size taller than larger=> more vertical spacing, a size larger than taller => more horizontal spacing).

How can I assign a right-click menu/contextual menu to an image browser view? Connection a NSMenu with the menu-outlet in InterfaceBuilder works for all of my views except the IKImageBrowserView.

I don't know using InterfaceBuilder but programmatically I'm using the optional delegate methods :

- (void) imageBrowser:(IKImageBrowserView *) aBrowser cellWasRightClickedAtIndex:(NSUInteger) index withEvent:(NSEvent *) event
and
- (void) imageBrowser:(IKImageBrowserView *) aBrowser backgroundWasRightClickedWithEvent:(NSEvent *) event

to manage contextual menus.

For instance to add a contextual menu on a given item:

- (void) imageBrowser:(IKImageBrowserView *) aBrowser cellWasRightClickedAtIndex:(NSUInteger) index withEvent:(NSEvent *) event
{
        //contextual menu for item index
        NSMenu*                 menu;

        menu = [[NSMenu alloc] initWithTitle:@"menu"];
        [menu setAutoenablesItems:NO];
        
[menu addItemWithTitle:[NSString stringWithFormat:@"Open"] action: [...] keyEquivalent:@""]; [menu addItemWithTitle:[NSString stringWithFormat:@"Get Info"] action: [...] keyEquivalent:@""];
        
        [NSMenu popUpContextMenu:menu withEvent:event forView:aBrowser];
        
        [menu release];
}


-- Thomas.




Thanks,
Yann
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/tgoossens%40mac.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to