LoveUnix » 编程开发 & Rational » 通用菜单程序
让LU留住您的每

一天 让LU博客留住您的每一天
2006-1-18 15:50 jackadandy
附件下载不了啊???

2006-1-25 15:17 tdx_rong
下了,3ks

2006-3-31 11:38 wusolo
搂主的hello world代码有问题,修改一下就不会出现TF_Hello()错误了


[code]

#include "gmenu.h"
#include "gmenu.c"
#include "gcommon.h"
#include "gcommon.c"
#include "gcdk.h"

static int TF_Hello();

static FUNCS functable[] = {
   {  1, 'F', TF_Hello,NULL  },
   {  0, '@', NULL, NULL  }
};

static ITEM mi[] = {
{ 1, "1 Selection1"   },                        
{ 1, "2 Selection2"   },
{ 1, "3 Selection3"   },
{ 0 }
};

static int
TF_Hello()
{
   mvprintw(LINES-1, 0, "Hello world!");  
   return 1;
}

extern int
main()
{
   int  rtn,i;
   
   win_initial();
   
   rtn = popup_menu_byitems(mi, 0, 0, 3, 1);

   if ((i=Get_Func_Ord(functable,rtn))>= 0 )
   {
       (*functable[i].pfunc)();
   }
   
   win_end();
}

[/code]

页: 1 2 [3]
查看完整版本: 通用菜单程序


Powered by Discuz! Archiver 5.5.0  © 2001-2006 Comsenz Inc.