With the core Action! Library window routines complete, I moved to converting the menu routine, and the first gadget. The menu routine converted is MenuV(), which is a vertical stacked menu. The first gadget to be converted is GAlert() which simply displays a message in a window and waits for a keypress.
As a reminder the actual library source code is being withheld until the conversion is completed. Here is the source for the sample program which demonstrates calling the routines. The command line used to compile is noted in the header comment:
// ------------------------------------------------------------
// Program: menuv.c
// Desc...: A8 Library Menu and Alert Test
// Author.: Ripdubski
// Date...: 202208
// Notes..: cl65 -v [-O] -t atarixl menuv.c -o menuv.xex
// ------------------------------------------------------------
// Pull in include files
#include <stdio.h>
#include <conio.h>
#include <unistd.h>
#include <string.h>
#include <atari.h>
// Converted Action! library files
// Redacted until full conversion complete.
#include "a8defines.h"
#include "a8defwin.h"
#include "a8libmisc.c"
#include "a8libstr.c"
#include "a8libwin.c"
#include "a8libgadg.c"
#include "a8libmenu.c"
// ------------------------------------------------------------
// Func...: void main(void)
// Desc...: Main routine
// ------------------------------------------------------------
void main(void)
{
// Variables
byte bW1, bW2, bC, bD;
unsigned char *pcM[7] = { " Alert ", " Progress ", " Buttons ", " Checkboxes ", " Radio Button ", " Quit " };
// Setup screen
WInit();
WBack(14);
// Open windows
bW1 = WOpen(0, 0, 40, 3, WON);
WPrint(bW1, WPCNT, 1, WOFF, "CC65 A8 Menu Test");
bW2 = WOpen(12, 6, 16, 10, WOFF);
WOrn(bW2, WPTOP, WPCNT, "Menu");
// Set done to false
bD = FALSE;
// Loop until done (Quit selected)
while (! bD)
{
// Call menu
bC = MenuV(bW2, 1, 2, WON, 1, 6, pcM);
// Process choice
switch (bC)
{
// For each option, show an alert using the GAlert gadget.
case 1: GAlert("Alert! menu option 1 selected!");
break;
case 2: GAlert("Alert! menu option 2 selected!");
break;
case 3: GAlert("Alert! menu option 3 selected!");
break;
case 4: GAlert("Alert! menu option 4 selected!");
break;
case 5: GAlert("Alert! menu option 5 selected!");
break;
// Quit option, set exit to true
case 6: bD = TRUE;
break;
}
}
// Wait for a keypress
while (! kbhit()) { };
// Close windows
WClose(bW2);
WClose(bW1);
// Exit
return;
}
Screenshot of the MenuV() function being used:

Screenshot of the GAlert() gadget being used:
