#include "graphapp.h"
radiobutton tomato, barbeque;
void place_order(button b)
{
printf("Sauce:\n");
if (ischecked(tomato)) printf(" Tomato\n");
if (ischecked(barbeque)) printf(" Barbeque\n");
exitapp();
}
void choose(radiobutton sauce)
{
if (sauce == tomato) printf("Tomato sauce chosen\n");
else if (sauce == barbeque) printf("BBQ sauce chosen\n");
}
void main(void)
{
window w;
rect r;
w = newwindow("Pizza", rect(0,0,200,180), StandardWindow);
r = rect(10,10,100,25);
tomato = newradiobutton("Tomato", r, choose); r.y += 30;
barbeque = newradiobutton("BBQ", r, choose); r.y += 30;
check(tomato);
newbutton("Order Pizza", r, place_order);
show(w);
mainloop();
}