#include <stdio.h>
#include <string.h>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Output.H>

Fl_Output *sayHiBye;

void pressed(Fl_Widget *widget, void *v){
	printf("Pressed\n");
	const char *currentValue=sayHiBye->value();
	if(strcmp(currentValue,"Hi")==0)sayHiBye->value("Bye");
	else sayHiBye->value("Hi");
}

int main(int argc, char **argv) {
	Fl_Window *window = new Fl_Window(300,180);
	Fl_Button *pressMe = new Fl_Button(20,40,130,100,"Press Me!");
	pressMe->when(FL_WHEN_RELEASE); // Actually this is the default. I don't need to set it.
	pressMe->callback(pressed,NULL);

	sayHiBye=new Fl_Output(200,40,50,100,"Label:");
	sayHiBye->value("Hi");

	window->end();
	window->show(argc, argv);
	return Fl::run();
}

