• 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
First item disappears in toolbarItem menu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

First item disappears in toolbarItem menu


  • Subject: First item disappears in toolbarItem menu
  • From: Ivan Myrvold <email@hidden>
  • Date: Tue, 3 Feb 2004 12:18:05 +0100

I can not get my first item to appear in a toolbar item menu I have.
Here is the code in the itemForIdentifier method:

} else if ([itemIdent isEqual: RTV0710ToolbarItemIdentifier]) {
NSPopUpButton *noSelPopUp = [[[NSPopUpButton alloc]
initWithFrame:NSMakeRect(0.0,0.0,40.0,40.0) pullsDown:YES]
autorelease];

[[noSelPopUp cell] setBezelStyle:NSNoBorder];
[[noSelPopUp cell] setArrowPosition:NSPopUpArrowAtBottom];
[[noSelPopUp cell] setPreferredEdge:NSMaxYEdge];
[self setFolketrygdenToolbarPopup:noSelPopUp];

[[noSelPopUp cell] setUsesItemFromMenu:NO];
NSMenuItem *item = [[NSMenuItem allocWithZone:[self zone]]
initWithTitle:@"" action:NULL keyEquivalent:@""];
[item setImage:[NSImage imageNamed: @"rtv"]];
[item setOnStateImage:nil];
[item setMixedStateImage:nil];
[[noSelPopUp cell] setMenuItem:item];
[item release];
[[[noSelPopUp menu] menuRepresentation] setHorizontalEdgePadding:0.0];

[toolbarItem setLabel: @"07.10"];
[toolbarItem setPaletteLabel: @"07.10"];

[toolbarItem setToolTip: @"Lag ny 07.10 Sxknad"];
[toolbarItem setView:noSelPopUp];
[toolbarItem setMinSize:NSMakeSize(NSWidth([noSelPopUp frame]),
NSHeight([noSelPopUp frame]))];
[toolbarItem setMaxSize:NSMakeSize(NSWidth([noSelPopUp frame]),
NSHeight([noSelPopUp frame]))];

[toolbarItem setTarget: self];
[toolbarItem setAction: @selector(show0710:)];

When I add items to this popup toolbar item (with [popup
addItemsWithTitles:[NSArray arrayWithObjects:@"one", @"two",
@"three"]])

only the second items and third is showing up, the first item is not
there. I know it is stored in the popup, because if I tries a [popup
itemTitles], all three of them will be displayed in an NSLog. Do anyone
have an idea of why this happens?

Ivan
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: First item disappears in toolbarItem menu
      • From: Herr Witten <email@hidden>
  • Prev by Date: Re: Help, ugly compositing...
  • Next by Date: Finding windows from Cocoa ?
  • Previous by thread: Rendezvous registered servicenames list [DNS SRV (RFC 2782) Service Names]
  • Next by thread: Re: First item disappears in toolbarItem menu
  • Index(es):
    • Date
    • Thread