/*
 * sample 3
 */
#include <stdio.h>
#include <stdlib.h>

#include "mgui.h"

static int quitting = False;

void QuitCB(MOBJECT obj, void *a, void *shell)
{
	MShellUnrealize((MOBJECT )shell);
	MShellDestroy((MOBJECT )shell);
	quitting = True;
}

void MGUIMain(int argc, char **argv)
{
	MOBJECT shell, pushbutton;

	shell = MCreateShell("Message", 0);
	MCreateLabel(shell, "Hello, world", HELV_L_FONT);
	pushbutton = MCreatePButton(shell, "Ok", TIMES_L_FONT);
	MPButtonSetCallback(pushbutton, QuitCB, shell);
	MShellRealize (shell);

	MLoopWhileFlag(&quitting, False);
}
