/*
 * sample 4
 */
#include <stdio.h>
#include <stdlib.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 shell, rform, cform, pb, lbl;

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

	rform = MCreateRowForm(shell); 
	lbl = MCreateLabel(rform, "This Label forces the width", DEFAULT_FONT);
	MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0); 
	lbl = MCreateLabel(rform, "Small Label", DEFAULT_FONT);
	MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0); 
	lbl = MCreateLabel(rform, "Not scaleable Label", DEFAULT_FONT); 
	MObjectSetOffset(lbl, 15, -1, -1, -1);
	MObjectSetShadow(lbl, WS_SHADOW_IN, 1, 0); 
	MObjectSetResize(lbl, False, False); 

	cform = MCreateColForm(shell); 
	pb = MCreatePButton(cform, "Dummy", TIMES_L_FONT); 
	pb = MCreatePButton(cform, "Quit", TIMES_L_FONT);
	MObjectSetAttachment(pb, True, True, False, True);
	MPButtonSetCallback(pb, ExitCB, NULL);
	MShellRealize(shell);

	MMainLoop();
}
