/*************************** Example 15 ***************************/
#include "EZ.h"

void  rbuttonCallback(EZ_Widget *btn, void *data)
{
  char *ptr = (char *)EZ_GetWidgetPtrData(btn);
  EZ_SetDefaultLabelFont(ptr); 
}

main(int ac, char **av)
{
  EZ_Widget *frame, *frame1, *menubar, *tmp, *mbtn;
  
  frame = EZ_CreateWidget(EZ_WIDGET_FRAME, NULL,
                          EZ_WIDTH, 400, EZ_HEIGHT, 200, 0);

  menubar = EZ_CreateWidget(EZ_WIDGET_FRAME, frame,
                            EZ_X, 0, EZ_Y, 0, 
		            EZ_WIDTH, 400, EZ_HEIGHT, 26,
		            EZ_BORDER_TYPE, EZ_BORDER_UP,
                            EZ_BORDER_WIDTH, 2, 0);
  mbtn = EZ_CreateWidget(EZ_WIDGET_MENU_BUTTON, menubar,
                         EZ_LABEL_STRING, "MenuButton 1",
                         EZ_X, 5, EZ_Y, 3, EZ_HEIGHT, 20, EZ_WIDTH, 90, 0);
  tmp = EZ_CreateSimpleMenu("|||||");
  EZ_SetMenuButtonMenu(mbtn, tmp);
  mbtn = EZ_CreateWidget(EZ_WIDGET_MENU_BUTTON, menubar,
                         EZ_LABEL_STRING, "MenuButton 2",
                         EZ_X, 100, EZ_Y, 3, EZ_HEIGHT, 20, EZ_WIDTH, 90, 0);
  tmp = EZ_CreateSimpleMenu("Menu 2 %t|||||");
  EZ_SetMenuButtonMenu(mbtn, tmp);
  mbtn = EZ_CreateWidget(EZ_WIDGET_MENU_BUTTON, menubar,
                         EZ_LABEL_STRING, "MenuButton 3",
                         EZ_X, 195, EZ_Y, 3, EZ_HEIGHT, 20, EZ_WIDTH, 90, 0);
  tmp = EZ_CreateSimpleMenu("Menu 3 %t|||||");
  EZ_SetMenuButtonMenu(mbtn, tmp);

  /* put something there */
  frame1 = EZ_CreateWidget(EZ_WIDGET_FRAME,frame, 
                           EZ_X,100, EZ_Y, 100, 0, EZ_WIDTH, 200,
		           EZ_HEIGHT, 200, 0);
  tmp = EZ_CreateWidget(EZ_WIDGET_RADIO_BUTTON, frame1,
                        EZ_LABEL_STRING, "Normal Font",
                        EZ_RADIO_BUTTON_GROUP, 0,
                        EZ_RADIO_BUTTON_VALUE, 0, 
                        EZ_CLIENT_PTR_DATA, "-Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*",
		        EZ_CALLBACK, rbuttonCallback, NULL,
                        0);
  tmp = EZ_CreateWidget(EZ_WIDGET_RADIO_BUTTON, frame1,
                        EZ_LABEL_STRING, "Large Font",
                        EZ_RADIO_BUTTON_GROUP, 0,
                        EZ_RADIO_BUTTON_VALUE, 1, 
                        EZ_CLIENT_PTR_DATA, "-Adobe-Helvetica-Bold-R-Normal--*-180-*-*-*-*-*-*",
		        EZ_CALLBACK, rbuttonCallback, NULL,
                        0);
  EZ_DisplayWidget(frame);
  EZ_EventMainLoop();
}
/*************************** Example 15 ***************************/
