TGUI  0.8-dev
tgui::WidgetLoader Class Reference

Class to load widgets from a text file. More...

#include <WidgetLoader.hpp>

Static Public Member Functions

static void load (Container::Ptr parent, std::stringstream &stream)
 Loads a container and its child widgets from a stream containing a widget file. More...
 
static void setLoadFunction (const std::string &type, const LoadFunction &loadFunction)
 Changes the load function for a certain widget type. More...
 
static const LoadFunction & getLoadFunction (const std::string &type)
 Retrieves the load function of a certain widget type. More...
 

Detailed Description

Class to load widgets from a text file.

Member Function Documentation

◆ getLoadFunction()

static const LoadFunction& tgui::WidgetLoader::getLoadFunction ( const std::string &  type)
static

Retrieves the load function of a certain widget type.

Parameters
typeType of the widget
Returns
Function called to load the widget

◆ load()

static void tgui::WidgetLoader::load ( Container::Ptr  parent,
std::stringstream &  stream 
)
static

Loads a container and its child widgets from a stream containing a widget file.

Parameters
parentThe parent container for the child widget
streamStream containing the widget file
Note
You should use the loadWidgetsFromFile or loadWidgetsFromSteam functions in Gui and Container instead of calling this function directly.

◆ setLoadFunction()

static void tgui::WidgetLoader::setLoadFunction ( const std::string &  type,
const LoadFunction &  loadFunction 
)
static

Changes the load function for a certain widget type.

Parameters
typeType of the widget
loadFunctionNew load function

The documentation for this class was generated from the following file: