How to insert CFString into LPopUpButton

How to insert CFString into LPopUpButton

Post by Neel » Wed, 10 May 2006 18:54:08


Hi there,

I am localizing my application, and searching how to put/insert
CFString in PopUpButton.
Here is the snippet of the code.

else if ( (l_popUpList = dynamic_cast<LPopupButton *>(pane) ) != NULL)
{
Str255 l_pData;
l_popUpList->GetMenuItemText(l_popUpList->GetValue(), l_pData);
MapIDToUnicode(&l_pData, &dst);
if( NULL != (cfS =
CFStringCreateWithPascalString(kCFAllocatorDefault, dst,
kCFStringEncodingUTF8)))
{
// This method does change but not each and every items inside the
popup
l_popUpList->SetCFDescriptor( cfS );
// ?????? Here want to use something like
InsertMenuItem(...)
CFRelease(cfS);
l_popUpList->Refresh();
}
}

Appreciate with your advice!

Thanks!
Neel
 
 
 

How to insert CFString into LPopUpButton

Post by Neel » Wed, 10 May 2006 19:43:06

This statement set the title for LPopUpButton,

l_popUpList->SetCFDescriptor( cfS );

but i want to set each items inside the popup button ...

Please suggest.

 
 
 

How to insert CFString into LPopUpButton

Post by David Phil » Wed, 10 May 2006 22:49:55

In article < XXXX@XXXXX.COM >,



LPopUpButton inherits from LMenuController, so you can say:

MenuRef mr = l_popUpList->GetMacMenuH();

Once you've got that, you can use:
SetMenuItemTextWithCFString(mr, i, cf), defined in Menus.h
 
 
 

How to insert CFString into LPopUpButton

Post by Neel » Thu, 11 May 2006 16:58:25

Thanks a lot for your reply.