• 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
NSToolbar and NSPopUpButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSToolbar and NSPopUpButton


  • Subject: NSToolbar and NSPopUpButton
  • From: "Terence G4 Mac" <email@hidden>
  • Date: Thu, 05 Dec 2002 03:01:12 +0000

Hi all,

I know this has been discussed before, and I have checked the archives.

However, I was unable to find an answer there and now my head really hurts ;)

I've got a popup in a toolbar, using the Toolbar sample as a model. That part works -- it shows up and responds to events. If I select an item, my selector is called and I can even determine which item got selected. So, that's all fine.

What I'm trying to do though, is populate this popup with my own content and that's where this is breaking down for me.

Inside the controller's awakeFromNib, I do...

[popUp setTitle:@"Pics"];
[popUp removeAllItems];
NSString *file;
NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager]
enumeratorAtPath:[[NSString stringWithString:@"~/Pictures"] stringByStandardizingPath]];
while (file = [enumerator nextObject]) {
if ([[file pathExtension] isEqualToString:@"jpg"])
[popUp addItemWithTitle:file];//[ringtones addObject: [file copy]];
}

When the app loads, though, all I've got are "Item1, Item2, and Item3" in the list -- none of my content. And, yes, the addItemWithTitle is definitely being called at least once -- I made sure of that.

I'm guessing this is just something I don't understand yet and I've failed to associate the popup with a menu correctly, perhaps? I don't know...

Can anyone provide the aspirin here? :)

Any help would be very much appreciated.

Terence




_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
_______________________________________________
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: NSToolbar and NSPopUpButton
      • From: j o a r <email@hidden>
  • Prev by Date: Interface Builder 2.3 - Show Info doesn't work, can't open the info panel
  • Next by Date: Re: help with copy: method
  • Previous by thread: NSButton highlight - ignore
  • Next by thread: Re: NSToolbar and NSPopUpButton
  • Index(es):
    • Date
    • Thread