TGUI  0.7.8
tgui::WidgetLoader Class Reference

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

#include <TGUI/Loading/WidgetLoader.hpp>

Static Public Member Functions

static void load (Container::Ptr parent, std::stringstream &stream)
 Load a container and its child widgets from a stream containing a widget file. More...
 
static void setLoadFunction (const std::string &type, const LoadFunction &loadFunction)
 Change the load function for a certain widget type. More...
 
static const LoadFunction & getLoadFunction (const std::string &type)
 Retrieve 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

Retrieve 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

Load 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

Change 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: