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]