• 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
problems populating a pop-up menu on a window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problems populating a pop-up menu on a window


  • Subject: problems populating a pop-up menu on a window
  • From: email@hidden
  • Date: Tue, 3 Feb 2004 03:04:00 EST

Someone game me a line (see code) to insert but it doesn't work, I also need
a way to set the selected item to "ActiveDevice".

In the header file "IBOutlet id populate;" is asigned and corresponds to the
pop-up menu.

------------------------------------------

#define kAppCFStr CFSTR("com.LogiK.XSKeyEMU")
#define kKeyCFStr CFSTR("DeviceList")

- (void) Dump_DeviceList
{
CFArrayRef prefCFArrayRef = CFPreferencesCopyAppValue(kKeyCFStr,
kAppCFStr);
CFIndex countDeviceList,index;

if (NULL == prefCFArrayRef)
return;

countDeviceList = CFArrayGetCount(prefCFArrayRef);

printf("\nThe Device list is:\n");
for (index = 0;index < countDeviceList;index++)
{
CFArrayRef pairCFArrayRef;
CFStringRef myCFString;
char* myStrPtr;

pairCFArrayRef = CFArrayGetValueAtIndex(prefCFArrayRef,index);
if (NULL == pairCFArrayRef) break;

/* 0 is name, 1 is file, 2 is serial */
myCFString = CFArrayGetValueAtIndex(pairCFArrayRef,0);
myStrPtr = Copy_CFStringRefToCString(myCFString);

// Some one gave me this.
[ populate addItemWithTitle:(NSString *)myCFString atIndex:(int
)index];
// unfortunately it doesn't work

printf("\t%ld\t\"%s\"\n",index,myStrPtr);// print device list to
console
DisposePtr(DevNameStrPtr);

}
CFRelease(prefCFArrayRef);
return;
}

------------------------------------------

Well I know this doesn't work and I have been able to locate any code that
does work so does anyone have code that works?

Dale
_______________________________________________
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.

  • Prev by Date: Re: Building Frameworks in Java
  • Next by Date: PROBLEMS POPULATING A POP-UP MENU IN A WINDOW
  • Previous by thread: Re: Building Frameworks in Java
  • Next by thread: PROBLEMS POPULATING A POP-UP MENU IN A WINDOW
  • Index(es):
    • Date
    • Thread