peter
New Member
Posts: 2
|
Post by peter on Feb 18, 2018 11:00:37 GMT 1
Hi Folks,
i was used to using GFA 30 years ago. Now i wonder how i cteated a simple MENU. I can creat it, but it seems so that i am not able to understand it. i can not ask for which entry was klicked and the interpreter does not understand "on menu gosub" . Could anyone please provide me a simple example ?
Regards Peter
|
|
|
Post by dragonjim on Feb 20, 2018 1:00:22 GMT 1
Hi Peter, Unlike the older versions of GFABasic (like the one I used to use on the Atari STE and the one released for 16-bit Windows), GFABASIC32 handles menus through Event procedures rather than using Menu() and On Menu Gosub. This is detailed in the Help file (see here) and a quick example of how it works is below: OpenW 1 Local m$(0 To 10), n% Data "File","Open","Save","-","Exit","","Edit","Copy","Cut","Paste","" For n% = 0 To 10 : Read m$(n%) : Next n% Menu m$() Do : Sleep : Until Win_1 Is Nothing Sub Win_1_MenuEvent(idx%) Message "You have selected Menu Item" & idx% If idx% = 4 Then Win_1.Close // Exit selected EndSub I hope this is helpful.
|
|
peter
New Member
Posts: 2
|
Post by peter on Feb 20, 2018 16:56:16 GMT 1
Thanks a lot !!! It helps !
|
|