다이나믹 팝업 리스트

/* 리스트 아이템 이름 */
P_U8 listitemname[ i ];

/* 팝업에 포함될 아이템의 스트링 리스트 */
P_U8 *gItemList;

/* nlistitem 숫자 만큼 메모리를 할당하고 이름을 설정한다. */
void CreatePopupList( U8 nlistitem )
{
   int i;

   gItemList = Lmalloc( sizeof(P_U8) * nlistitem );
   for( i=0 ; i<nlistitem ; i++ )
   {
     gItemList[i] = Lmalloc( strlen( listitemname[ i ] ) + 1 );
     strcpy( gItemList[i], listitemname[ i ] );
   }
}

/* 할당된 메모리를 해제 한다. */
void DestroyPopupList( U8 nlistitem )
{
   int i;

   for( i=0 ; i<nlistitem ; i++ )
   {
     Lfree( gItemList[i] );
   }
   Lfree( gItemList );
}


Copyright © 1998-2006 PDAProgramming.com All rights reserved.