/*
 * sample 15
 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "mgui.h"

void ExitCB(MOBJECT obj, void *a, void *b)
{
	obj = MObjectShell(obj);
	MShellUnrealize(obj);
	MShellDestroy(obj);
	MGUITerm();
	exit(0);
}

void MGUIMain(int argc, char **argv)
{
	MOBJECT pbutton, shell, edit, list;

	shell = MCreateShell("Sample 15", 0);

	MCreateLabel(shell, "Static Fonts", LARGE_FONT);

	edit = MCreateOptionEdit(shell, "", 16, 16, 6, DEFAULT_FONT);
	MObjectSetUnsensitive(edit);
	list = MOptionEditGetList(edit);
	MSListAddItem(list, "DEFAULT_FONT", 0L);
	MSListAddItem(list, "MEDIUM_FONT", 0L);
	MSListAddItem(list, "LARGE_FONT", 0L);
	MSListAddItem(list, "HELV_N_FONT", 0L);
	MSListAddItem(list, "HELV_L_FONT", 0L);
	MSListAddItem(list, "TIMES_N_FONT", 0L);
	MSListAddItem(list, "TIMES_L_FONT", 0L);

	pbutton = MCreatePButton(shell, "Close", TIMES_L_FONT);
	MPButtonSetCallback(pbutton, ExitCB, NULL);

	MShellRealize(shell);
        MMainLoop();
}

