nsnake
Classic snake game for the terminal
Loading...
Searching...
No Matches
Dialog Namespace Reference

Quick-and-dirty functions to show GUI-like dialogs on the screen. More...

Functions

void show (std::string message, bool pressAnyKey=false)
 Shows a message on the screen.
 
bool askBool (std::string question, std::string title="", bool default_value=false)
 Spawns a Dialog box asking for a yes-or-no #question.
 

Detailed Description

Quick-and-dirty functions to show GUI-like dialogs on the screen.

Function Documentation

◆ askBool()

bool Dialog::askBool ( std::string question,
std::string title = "",
bool default_value = false )

Spawns a Dialog box asking for a yes-or-no #question.

Dialog optionally has a #title and a #default_value.

Note
If the user presses 'q' to quit, it'll return false.

Definition at line 58 of file Dialog.cpp.

◆ show()

void Dialog::show ( std::string message,
bool pressAnyKey = false )

Shows a message on the screen.

Spawns a screen-centered dialog that respects multi-line strings, wrapping it's size around them.

Note
The multi-line delimiter is \n
Parameters
messageWhich string to show.
pressAnyKeyIf it should wait for pressing a single key

Definition at line 12 of file Dialog.cpp.