
#include "Controller.h"
#include "appkit/Panel.h"

@implementation Controller


- buttonClicked:sender
{
    int irc;
    int aNumber = 10;

    switch ([[sender selectedCell] tag]) {

    case 0:
    irc = NXRunAlertPanel( "Title goes here...",
		    "Printf style description, using percent d, %d",
		    "One", "Two", NULL, aNumber );
    if (irc > 0) {
    	[text setStringValue:"One"];
	return self;
    } else if (irc == 0) {
    	[text setStringValue:"Two"];
	return self;
    } else {
    	[text setStringValue:"???"];
    }
    return self;

    case 1:
    irc = NXRunAlertPanel("Title goes here...",
	"Some kind of explanation goes here...",
	"One", "Two", "Three");
    if (irc > 0) {
    	[text setStringValue:"One"];
	return self;
    } else if (irc == 0) {
    	[text setStringValue:"Two"];
	return self;
    } else {
    	[text setStringValue:"Three"];
    }
    return self;

    case 2:
    irc = NXRunAlertPanel("Title goes here...",
	"Some kind of explanation goes here...",
	"One", NULL, "Two");
    if (irc > 0) {
    	[text setStringValue:"One"];
	return self;
    } else if (irc == 0) {
    	[text setStringValue:"???"];
	return self;
    } else {
    	[text setStringValue:"Two"];
    }
    return self;


    case 3:
    irc = NXRunAlertPanel("Title goes here...",
	"Some kind of explanation goes here...",
	"One", NULL, NULL);
    if (irc > 0) {
    	[text setStringValue:"One"];
	return self;
    } else if (irc == 0) {
    	[text setStringValue:"???"];
	return self;
    } else {
    	[text setStringValue:"???"];
    }
    return self;


    case 4:
    irc = NXRunAlertPanel("Title goes here...",
	"Some kind of explanation goes here...",
	NULL, NULL, NULL);
    if (irc > 0) {
    	[text setStringValue:"irc > 0"];
	return self;
    } else if (irc == 0) {
    	[text setStringValue:"irc == 0"];
	return self;
    } else {
    	[text setStringValue:"irc < 0"];
    }
    return self;

    default:
    return self;
    }
}
@end
