• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: IKImageBrowserView spacing and contextual menus
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IKImageBrowserView spacing and contextual menus


  • Subject: Re: IKImageBrowserView spacing and contextual menus
  • From: thomas goossens <email@hidden>
  • Date: Sat, 19 Apr 2008 14:40:09 +0200

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 (email@hidden)

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:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >IKImageBrowserView spacing and contextual menus (From: Yann Disser <email@hidden>)

  • Prev by Date: Delete NSDefaults while running
  • Next by Date: Re: Subclassing
  • Previous by thread: IKImageBrowserView spacing and contextual menus
  • Next by thread: Implementing a Slightly Unusual NSTableView
  • Index(es):
    • Date
    • Thread