#include "graphapp.h"
checkbox ham, mushrooms, olives, capsicum;
void place_order(button b)
{
printf("Toppings:\n");
if (ischecked(ham)) printf(" Ham\n");
if (ischecked(mushrooms)) printf(" Mushrooms\n");
if (ischecked(olives)) printf(" Olives\n");
if (ischecked(capsicum)) printf(" Capsicum\n");
exitapp();
}
void main(void)
{
window w;
rect r;
w = newwindow("Pizza", rect(0,0,200,180), StandardWindow);
r = rect(10,10,100,25);
ham = newcheckbox("Ham", r, NULL); r.y += 30;
mushrooms = newcheckbox("Mushrooms", r, NULL); r.y += 30;
olives = newcheckbox("Olives", r, NULL); r.y += 30;
capsicum = newcheckbox("Capsicum", r, NULL); r.y += 30;
newbutton("Order Pizza", r, place_order);
show(w);
mainloop();
}