#module #deffunc pm_init int,int mref _w,0 mref menus,1 wid=_w mwidth=10 dim menuitems,menus sdim menustr,128,menus,10 return #deffunc pm_additem int,str mref m,0 mref _s,33 n=menuitems.m menuitems.m++ menustr.m.n=_s return #deffunc pm_clr int mref m,0 menuitems.m=0 return #deffunc pm_popup int,int,int,int mref m,0 mref x,1 mref y,2 mref f,3 mref _stat,64 ll=mwidth mm=menuitems.m repeat menuitems.m strlen l,menustr.m.cnt if l>ll :ll=l loop ll=ll*10 bgscr wid,ll,menuitems.m*24,2,x,y cls 1 gsel wid,2 repeat menuitems.m pos 2,cnt*24 mes menustr.m.cnt loop repeat wait 1 stick k,1023 if k :continue break loop _stat=-1 repeat wait 5 getkey k,1 if k { if f==0 | (_stat>=0) :break } if f==0 { getkey k,2 if k :_stat=-1:break } ginfo 0 px=prmx-x py=prmy-y if _stat>=0 { color 192,192,192 boxf 0,_stat*24,ll,_stat+1*24 color 0 pos 2,_stat*24 mes menustr.m._stat } if px<0 | (py<0) | (px>ll) | (py>(mm*24)):_stat=-1:continue _stat=py/24 if _stat>=0 { color 0,255,192 boxf 0,_stat*24,ll,_stat+1*24 color 255,0,0 pos 2,_stat*24 mes menustr.m._stat } loop gsel wid,-1 return #global pm_init 31,5 pm_additem 0,"test1" pm_additem 0,"test2" repeat wait 1 getkey k,2 if k { ginfo 0 pm_popup 0,prmx,prmy gsel 0 mes "select:"+stat } loop stop