This macro demonstrates simple openui5 panel, shown with RWebWindow.
std::shared_ptr<ROOT::RWebWindow> window;
int counter{0};
void ProcessData(unsigned connid, const std::string &arg)
{
printf("Get msg %s \n", arg.c_str());
counter++;
if (arg == "get_text") {
} else if (arg == "get_binary") {
float arr[10];
for (
int n = 0;
n < 10; ++
n)
window->SendBinary(connid, arr, sizeof(arr));
} else if (arg == "halt") {
window->TerminateROOT();
}
}
void server()
{
std::string fname = __FILE__;
auto pos = fname.find("server.cxx");
if (pos > 0)
fname.resize(pos);
else
fname.clear();
fname.append("client.html");
window->SetDefaultPage("file:" + fname);
window->SetDataCallBack(ProcessData);
window->SetGeometry(300, 500);
window->Show();
}
static std::shared_ptr< RWebWindow > Create()
Create new RWebWindow Using default RWebWindowsManager.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
- Author
- Sergey Linev
Definition in file server.cxx.