• 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: custom NSPopupButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: custom NSPopupButton


  • Subject: Re: custom NSPopupButton
  • From: John Pannell <email@hidden>
  • Date: Sun, 28 Jan 2007 20:09:18 -0700

Hi Ken-

It sounds like you are positioning this button in IB... in that case, see what response you get from initWithCoder: - I believe that the is the method called when contents of a nib file are un-archived.

HTH!

John

On Jan 28, 2007, at 4:01 PM, Ken Tozier wrote:


On Jan 28, 2007, at 5:25 PM, PGM wrote:


I'm making a floating palette which packs several popup menus in a very tight space and would like to customize them so they don't look so clunky. I don't want to lose any of the other functionality of popup buttons just change how it looks. What's the easiest way to do something like that?



If you want to pack them horizintally, NSSegmentedControl may be a solution.

They need to be vertical unfortunately.

Below is what I have so far. An NSPopupMenuButton subclass. I set the "custom class" in IB to KFlatPopUpButton but for some reason. the initWithFrame never gets called even though the popup appears in the window. There are literally hundreds of methods in NSPopupMenuButton and all of it's superclasses could someone point be where I should be doing the custom initialization?

Many thanks

Ken

@interface KFlatPopUpButton : NSPopUpButton
{
}

- (id)initWithFrame:(NSRect) frameRect;

@end

- (id)initWithFrame:(NSRect) frameRect
{
self = [super initWithFrame: frameRect];

NSBundle *bundle = [NSBundle pmxPluginBundle];
NSLog(@"bundle = %@", bundle);

NSString *imagePath = [bundle pathForResource: @"bar-normal" ofType: @"png"];
NSLog(@"imagePath = %@", imagePath);

NSImage *image = [[NSImage alloc] initWithContentsOfFile: imagePath];
NSLog(@"image = %@", image);

[[self cell] setImage: image];

return self;
}





_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
40positivespinmedia.com


This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: 
 >custom NSPopupButton (From: Ken Tozier <email@hidden>)
 >Re: custom NSPopupButton (From: PGM <email@hidden>)
 >Re: custom NSPopupButton (From: Ken Tozier <email@hidden>)

  • Prev by Date: Re: CoreData and Undo menu item title?
  • Next by Date: Re: Flipping Text
  • Previous by thread: Re: custom NSPopupButton
  • Next by thread: MenuStatusItem --
  • Index(es):
    • Date
    • Thread