

Task

Display the string       Goodbye, World!       on a GUI object   (alert box, plain window, text area, etc.).



Related task

   Hello world/Text


 
#include <CtrlLib/CtrlLib.h>
// submitted by Aykayayciti (Earl Lamont Montgomery)
 
using namespace Upp;
 
class GoodbyeWorld : public TopWindow {
	MenuBar menu;
	StatusBar status;
 
	void FileMenu(Bar& bar);
	void MainMenu(Bar& bar);
	void About();	
 
public:
	typedef GoodbyeWorld CLASSNAME;
 
	GoodbyeWorld();
};
 
void GoodbyeWorld::About()
{
	PromptOK("{{1@5 [@9= This is the]::@2 [A5@0 Ultimate`+`+ Goodbye World sample}}");
}
 
void GoodbyeWorld::FileMenu(Bar& bar)
{
	bar.Add("About..", THISBACK(About));
	bar.Separator();
	bar.Add("Exit", THISBACK(Close));
}
 
void GoodbyeWorld::MainMenu(Bar& bar)
{
	menu.Add("File", THISBACK(FileMenu));
}
 
GoodbyeWorld::GoodbyeWorld()
{
	AddFrame(menu);
	AddFrame(status);
	menu.Set(THISBACK(MainMenu));
	status = "So long from the Ultimate++ !";
}
 
GUI_APP_MAIN
{
	SetLanguage(LNG_ENGLISH);
	GoodbyeWorld().Run();
}
 