mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-29 06:12:18 -06:00
reference: WebHelloWorld, a basic Turtle-based 'hello world' GUI example is added.
git-svn-id: svn://ultimatepp.org/upp/trunk@14946 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
ffe0602754
commit
fa3f982284
2 changed files with 55 additions and 0 deletions
42
reference/WebHelloWorld/WebHelloWorld.cpp
Normal file
42
reference/WebHelloWorld/WebHelloWorld.cpp
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#ifdef flagTURTLEGUI
|
||||
#include <Turtle/Turtle.h>
|
||||
#else
|
||||
#include <CtrlLib/CtrlLib.h>
|
||||
#endif
|
||||
|
||||
// Try connecting to "localhost:8888" via your web browser.
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
void AppMainLoop()
|
||||
{
|
||||
PromptOK("Hello, world!");
|
||||
}
|
||||
|
||||
#ifdef flagTURTLEGUI
|
||||
|
||||
CONSOLE_APP_MAIN
|
||||
{
|
||||
|
||||
#ifdef _DEBUG
|
||||
TurtleServer::DebugMode();
|
||||
#endif
|
||||
|
||||
// MemoryLimitKb(100000000); // Can aid preventing DDoS attacks.
|
||||
|
||||
TurtleServer guiserver;
|
||||
guiserver.Host("localhost");
|
||||
guiserver.Port(8888);
|
||||
guiserver.MaxConnections(100);
|
||||
RunTurtleGui(guiserver, AppMainLoop);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
AppMainLoop();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue