Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - sors

#1
Hello, tell me please how i can set automatic position ToolTip on Button.
In this time i have a ToolTip crawling out from window.
#2
Help requests / 0.8 Button ToolTips
30 September 2018, 15:50:07
Hi, why does this code give an error ?
    tgui::Button::Ptr button{tgui::Button::create("MyButton")};
    button->getToolTip()->setText("Hello world");

Quoteerror: 'tgui::Widget::Ptr {aka class std::shared_ptr<tgui::Widget>}' has no member named 'setText'|
#3
Help requests / 0.8 Many Buttons on Grid
29 September 2018, 13:52:33
Hi, I create the table like this:
Quotegrid = tgui::Grid::create();
            for(int i = 0; i < 100; ++i)
                {
                    auto h = tgui::HorizontalLayout::create({ tgui::bindWidth(scrollablePanel), tgui::bindHeight(scrollablePanel) / 10 });
                    auto b = tgui::Button::create("Button");
                    h->add(tgui::Label::create("Label"));
                    h->add(tgui::Label::create("Label"));
                    h->add(tgui::Label::create("Label"));
                    h->add(tgui::Label::create("Label"));
                    h->add(b);
                    grid->addWidget(h, i, 0);
                }
how to find out which button in the table was pressed?
#4
Help requests / High memory consumption
09 September 2018, 17:55:03
Hi, I keep my gui in a txt file.
Load my gui:
tgui::Gui gui;
gui.loadWidgetsFromFile("MyTxtFile.txt")

my "MyTxtFile.txt":
///Top Panel
Panel."TopLeftPanel" {
    Position = (0, 0);
    Size = (385, 80);
    Visible = true;

    Renderer {
        BackgroundColor = Transparent;
    }

    Picture {
//Size = (500, 500);
Renderer {
texture = "data/gui/tiles/panels/LeftTopPanel.png";
transparenttexture = false;
}
    }
}

Panel."TopPanel" {
    Position = ("parent.width * 0.5 - 125", "0");
    Size = (270, 140);
    Visible = true;

    Renderer {
        BackgroundColor = Transparent;
    }

    Picture {
//Size = (500, 500);
Renderer {
texture = "data/gui/tiles/panels/TopPanel.png";
transparenttexture = false;
}
    }

    Label."Time" {
        AutoSize = true;
        Position = ("parent.width * 0.5 - 25", 10);
Text = "11:23";
        TextSize = 23;
   
        Renderer {
            BackgroundColor = Transparent;
            BorderColor = Black;
            Borders = (0, 0, 0, 0);
            Padding = (0, 0, 0, 0);
            TextColor = #BEBEBE;
        }
}

    Label."Date" {
        AutoSize = true;
        Position = ("parent.width * 0.5 - 35", 35);
Text = "01.01.1950";
        TextSize = 15;
   
        Renderer {
            BackgroundColor = Transparent;
            BorderColor = Black;
            Borders = (0, 0, 0, 0);
            Padding = (0, 0, 0, 0);
            TextColor = #BEBEBE;
        }
}

    Label."GameSpeed" {
        AutoSize = true;
        Position = ("parent.width * 0.5 - 5", 55);
Text = "1x";
        TextSize = 15;
   
        Renderer {
            BackgroundColor = Transparent;
            BorderColor = Black;
            Borders = (0, 0, 0, 0);
            Padding = (0, 0, 0, 0);
            TextColor = #BEBEBE;
        }
}
}

///MiniMap
Panel."MiniMap" {
    Position = ("parent.width - 300", "0");
    Size = (300, 300);
    Visible = true;

    Renderer {
        BackgroundColor = Transparent;
    }

    Picture {
//Size = (500, 500);
Renderer {
texture = "data/gui/tiles/panels/MiniMap.png";
transparenttexture = false;
}
    }

Canvas."MiniMapCanvas" {
Position = (44, 9);
Size = (250, 250);
}
}

Button."Bastion" {
    Position = (16, parent.height - 80);
    Size = (64, 64);
    Text = "";
    TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/ui.png" Part(0, 192, 64, 64);
texturedown = "data/gui/tiles/ui.png" Part(0, 256, 64, 64);
texturefocused =  "data/gui/tiles/ui.png" Part(0, 192, 64, 64);
texturehover = "data/gui/tiles/ui.png" Part(0, 320, 64, 64);
}
}

Button."Manager" {
    Position = (96, parent.height - 80);
    Size = (64, 64);
    Text = "";
    TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/ui.png" Part(64, 192, 64, 64);
texturedown = "data/gui/tiles/ui.png" Part(64, 256, 64, 64);
texturefocused =  "data/gui/tiles/ui.png" Part(64, 192, 64, 64);
texturehover = "data/gui/tiles/ui.png" Part(64, 320, 64, 64);
}
}

Button."Walls" {
    Position = (176, parent.height - 80);
    Size = (64, 64);
    Text = "";
    TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/ui.png" Part(128, 192, 64, 64);
texturedown = "data/gui/tiles/ui.png" Part(128, 256, 64, 64);
texturefocused =  "data/gui/tiles/ui.png" Part(128, 192, 64, 64);
texturehover = "data/gui/tiles/ui.png" Part(128, 320, 64, 64);
}
}

Button."Floor" {
    Position = (256, parent.height - 80);
    Size = (64, 64);
    Text = "";
    TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/ui.png" Part(192, 192, 64, 64);
texturedown = "data/gui/tiles/ui.png" Part(192, 256, 64, 64);
texturefocused =  "data/gui/tiles/ui.png" Part(192, 192, 64, 64);
texturehover = "data/gui/tiles/ui.png" Part(192, 320, 64, 64);
}
}

Button."Objects" {
    Position = (336, parent.height - 80);
    Size = (64, 64);
    Text = "";
    TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/ui.png" Part(256, 192, 64, 64);
texturedown = "data/gui/tiles/ui.png" Part(256, 256, 64, 64);
texturefocused =  "data/gui/tiles/ui.png" Part(256, 192, 64, 64);
texturehover = "data/gui/tiles/ui.png" Part(256, 320, 64, 64);
}
}

Button."Zones" {
    Position = (416, parent.height - 80);
    Size = (64, 64);
    Text = "";
    TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/ui.png" Part(320, 192, 64, 64);
texturedown = "data/gui/tiles/ui.png" Part(320, 256, 64, 64);
texturefocused =  "data/gui/tiles/ui.png" Part(320, 192, 64, 64);
texturehover = "data/gui/tiles/ui.png" Part(320, 320, 64, 64);
}
}

///ZonesPanel
ScrollablePanel."ZonesPanel" {
    ContentSize = (0, 0);
    Position = (0, parent.height - 528);
    Size = (280, 448);
Visible = false;

    Renderer {
        BackgroundColor = Transparent;
scrollbar {
texturearrowup = "data/gui/tiles/panels/ZonesPanel.png" Part(300, 0, 20, 20);
texturearrowuphover = "data/gui/tiles/panels/ZonesPanel.png" Part(320, 0, 20, 20);

texturearrowdown = "data/gui/tiles/panels/ZonesPanel.png" Part(300, 468, 20, 20);
texturearrowdownhover = "data/gui/tiles/panels/ZonesPanel.png" Part(320, 468, 20, 20);

texturethumb = "data/gui/tiles/panels/ZonesPanel.png" Part(340, 0, 20, 60) Middle(0, 20, 20, 20);
texturethumbhover = "data/gui/tiles/panels/ZonesPanel.png" Part(360, 0, 20, 60) Middle(0, 20, 20, 20);

texturetrack = "data/gui/tiles/panels/ZonesPanel.png" Part(300, 20, 20, 448);
texturetrackhover = "data/gui/tiles/panels/ZonesPanel.png" Part(320, 20, 20, 448);
}
    }

    Picture {
//Size = (500, 500);
Renderer {
texture = "data/gui/tiles/panels/ZonesPanel.png" Part(0, 0, 280, 800);
transparenttexture = false;
}
    }

    Button."Delete" {
        Position = (0, 0);
        Size = (64, 64);
        Text = "";
        TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 0, 64, 64);
texturedown = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 64, 64, 64);
texturefocused =  "data/gui/tiles/panels/ZonesPanel.png" Part(384, 0, 64, 64);
texturehover = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 128, 64, 64);
}
    }

    Label."WarehouseGroup" {
        AutoSize = true;
        Position = (16, 80);
Text = "WarehouseGroup";
        TextSize = 15;
   
        Renderer {
            BackgroundColor = Transparent;
            BorderColor = Black;
            Borders = (0, 0, 0, 0);
            Padding = (0, 0, 0, 0);
            TextColor = #BEBEBE;
        }
}

    Button."Dump" {
        Position = (0, 96);
        Size = (64, 64);
        Text = "";
        TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 192, 64, 64);
texturedown = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 256, 64, 64);
texturefocused =  "data/gui/tiles/panels/ZonesPanel.png" Part(384, 192, 64, 64);
texturehover = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 320, 64, 64);
}

    }

    Button."Warehouse" {
        Position = (64, 96);
        Size = (64, 64);
        Text = "";
        TextSize = 20;
   
Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/panels/ZonesPanel.png" Part(448, 192, 64, 64);
texturedown = "data/gui/tiles/panels/ZonesPanel.png" Part(448, 256, 64, 64);
texturefocused =  "data/gui/tiles/panels/ZonesPanel.png" Part(448, 192, 64, 64);
texturehover = "data/gui/tiles/panels/ZonesPanel.png" Part(448, 320, 64, 64);
}
    }

    Button."Barn" {
        Position = (128, 96);
        Size = (64, 64);
        Text = "";
        TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/panels/ZonesPanel.png" Part(512, 192, 64, 64);
texturedown = "data/gui/tiles/panels/ZonesPanel.png" Part(512, 256, 64, 64);
texturefocused =  "data/gui/tiles/panels/ZonesPanel.png" Part(512, 192, 64, 64);
texturehover = "data/gui/tiles/panels/ZonesPanel.png" Part(512, 320, 64, 64);
}

    }

    Button."Armory" {
        Position = (192, 96);
        Size = (64, 64);
        Text = "";
        TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/panels/ZonesPanel.png" Part(576, 192, 64, 64);
texturedown = "data/gui/tiles/panels/ZonesPanel.png" Part(576, 256, 64, 64);
texturefocused =  "data/gui/tiles/panels/ZonesPanel.png" Part(576, 192, 64, 64);
texturehover = "data/gui/tiles/panels/ZonesPanel.png" Part(576, 320, 64, 64);
}
   
    }

    Label."MiningGroup" {
        AutoSize = true;
        Position = (16, 176);
Text = "MiningGroup";
        TextSize = 15;
   
        Renderer {
            BackgroundColor = Transparent;
            BorderColor = Black;
            Borders = (0, 0, 0, 0);
            Padding = (0, 0, 0, 0);
            TextColor = #BEBEBE;
        }
}

    Button."Forestry" {
        Position = (0, 192);
        Size = (64, 64);
        Text = "";
        TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 384, 64, 64);
texturedown = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 448, 64, 64);
texturefocused =  "data/gui/tiles/panels/ZonesPanel.png" Part(384, 384, 64, 64);
texturehover = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 512, 64, 64);
}

    }

    Button."Quarry" {
        Position = (64, 192);
        Size = (64, 64);
        Text = "";
        TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/panels/ZonesPanel.png" Part(448, 384, 64, 64);
texturedown = "data/gui/tiles/panels/ZonesPanel.png" Part(448, 448, 64, 64);
texturefocused =  "data/gui/tiles/panels/ZonesPanel.png" Part(448, 384, 64, 64);
texturehover = "data/gui/tiles/panels/ZonesPanel.png" Part(448, 512, 64, 64);
}

    }

    Button."Energy" {
        Position = (128, 192);
        Size = (64, 64);
        Text = "";
        TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/panels/ZonesPanel.png" Part(512, 384, 64, 64);
texturedown = "data/gui/tiles/panels/ZonesPanel.png" Part(512, 448, 64, 64);
texturefocused =  "data/gui/tiles/panels/ZonesPanel.png" Part(512, 384, 64, 64);
texturehover = "data/gui/tiles/panels/ZonesPanel.png" Part(512, 512, 64, 64);
}
   
    }

    Button."Engineering" {
        Position = (192, 192);
        Size = (64, 64);
        Text = "";
        TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/panels/ZonesPanel.png" Part(576, 384, 64, 64);
texturedown = "data/gui/tiles/panels/ZonesPanel.png" Part(576, 448, 64, 64);
texturefocused =  "data/gui/tiles/panels/ZonesPanel.png" Part(576, 384, 64, 64);
texturehover = "data/gui/tiles/panels/ZonesPanel.png" Part(576, 512, 64, 64);
}
   
    }

    Button."MeatFarm" {
        Position = (0, 256);
        Size = (64, 64);
        Text = "";
        TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 576, 64, 64);
texturedown = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 640, 64, 64);
texturefocused = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 576, 64, 64);
texturehover = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 704, 64, 64);
}

    }

    Button."VegetableFarm" {
        Position = (64, 256);
        Size = (64, 64);
        Text = "";
        TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/panels/ZonesPanel.png" Part(448, 576, 64, 64);
texturedown = "data/gui/tiles/panels/ZonesPanel.png" Part(448, 640, 64, 64);
texturefocused = "data/gui/tiles/panels/ZonesPanel.png" Part(448, 576, 64, 64);
texturehover = "data/gui/tiles/panels/ZonesPanel.png" Part(448, 704, 64, 64);
}
   
    }

    Button."FruitFarm" {
        Position = (128, 256);
        Size = (64, 64);
        Text = "";
        TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/panels/ZonesPanel.png" Part(512, 576, 64, 64);
texturedown = "data/gui/tiles/panels/ZonesPanel.png" Part(512, 640, 64, 64);
texturefocused = "data/gui/tiles/panels/ZonesPanel.png" Part(512, 576, 64, 64);
texturehover = "data/gui/tiles/panels/ZonesPanel.png" Part(512, 704, 64, 64);
}

    }

    Label."MilitaryGroup" {
        AutoSize = true;
        Position = (16, 336);
Text = "MilitaryGroup";
        TextSize = 15;
   
        Renderer {
            BackgroundColor = Transparent;
            BorderColor = Black;
            Borders = (0, 0, 0, 0);
            Padding = (0, 0, 0, 0);
            TextColor = #BEBEBE;
        }
}

    Button."Barracks" {
        Position = (0, 352);
        Size = (64, 64);
        Text = "";
        TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 768, 64, 64);
texturedown = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 832, 64, 64);
texturefocused = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 768, 64, 64);
texturehover = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 896, 64, 64);
}
   
    }

    Label."RecreationGroup" {
        AutoSize = true;
        Position = (16, 432);
Text = "RecreationGroup";
        TextSize = 15;
   
        Renderer {
            BackgroundColor = Transparent;
            BorderColor = Black;
            Borders = (0, 0, 0, 0);
            Padding = (0, 0, 0, 0);
            TextColor = #BEBEBE;
        }
}

    Button."Bedroom" {
        Position = (0, 448);
        Size = (64, 64);
        Text = "";
        TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 960, 64, 64);
texturedown = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 1024, 64, 64);
texturefocused = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 960, 64, 64);
texturehover = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 1088, 64, 64);
}

    }

    Label."HospitalGroup" {
        AutoSize = true;
        Position = (16, 528);
Text = "HospitalGroup";
        TextSize = 15;
   
        Renderer {
            BackgroundColor = Transparent;
            BorderColor = Black;
            Borders = (0, 0, 0, 0);
            Padding = (0, 0, 0, 0);
            TextColor = #BEBEBE;
        }
}

    Button."Hospital" {
        Position = (0, 544);
        Size = (64, 64);
        Text = "";
        TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 1152, 64, 64);
texturedown = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 1216, 64, 64);
texturefocused = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 1152, 64, 64);
texturehover = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 1280, 64, 64);
}

    }

    Label."MarketGroup" {
        AutoSize = true;
        Position = (16, 624);
Text = "MarketGroup";
        TextSize = 15;
   
        Renderer {
            BackgroundColor = Transparent;
            BorderColor = Black;
            Borders = (0, 0, 0, 0);
            Padding = (0, 0, 0, 0);
            TextColor = #BEBEBE;
        }
}

    Button."Market" {
        Position = (0, 640);
        Size = (64, 64);
        Text = "";
        TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 1344, 64, 64);
texturedown = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 1408, 64, 64);
texturefocused = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 1344, 64, 64);
texturehover = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 1472, 64, 64);
}

    }

    Label."CanteenGroup" {
        AutoSize = true;
        Position = (16, 720);
Text = "MarketGroup";
        TextSize = 15;
   
        Renderer {
            BackgroundColor = Transparent;
            BorderColor = Black;
            Borders = (0, 0, 0, 0);
            Padding = (0, 0, 0, 0);
            TextColor = #BEBEBE;
        }
}

    Button."Canteen" {
        Position = (0, 736);
        Size = (64, 64);
        Text = "";
        TextSize = 20;

Renderer {
textcolor = rgb(190, 190, 190);
textcolorhover = rgb(250, 250, 250);

texture = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 1536, 64, 64);
texturedown = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 1600, 64, 64);
texturefocused = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 1536, 64, 64);
texturehover = "data/gui/tiles/panels/ZonesPanel.png" Part(384, 1664, 64, 64);
}
   
    }
}

when rendering the interface is spent approximately 1 GB ?

I noticed that if I delete
ScrollablePanel."ZonesPanel"
in "MyTxtFile.txt" then the memory is consumed much less, why so ?
#5
Help requests / ScrollablePanel 0.8 arrow texture
02 September 2018, 16:54:27
Hi, please tell me how to change the texture ScrollablePanel arrow
My ScrollablePanel in txt:
QuoteScrollablePanel."MyScrollablePanel" {
    ContentSize = (0, 0);
    Position = (0, parent.height - 528);
    Size = (280, 448);

    Renderer {
        BackgroundColor = Transparent;
    }
}
#6
Help requests / Scrollbar and Panel
02 September 2018, 13:34:10
Hi, I want to do that Scrollbar moving my Panel:
Quotescrollbar_ZonesPanel->connect("ValueChanged ", [&]()
                                        {
                                            int scrolbarValue = scrollbar_ZonesPanel->getValue();
                                            scrolbarValue = (scrolbarValue * 8 ) ? scrolbarValue * 8:8;

                                            for(auto& widget : panel_ZonesPanel->getWidgets())
                                                {
                                                    if(widget->getWidgetType() != "Scrollbar")
                                                        {
                                                            if(previousScrolbarValue < scrollbar_ZonesPanel->getValue())
                                                                {
                                                                    widget->setPosition(widget->getPosition().x, widget->getPosition().y - scrolbarValue);
                                                                }
                                                            else
                                                                {
                                                                    widget->setPosition(widget->getPosition().x, widget->getPosition().y + scrolbarValue);
                                                                }
                                                        }
                                                }
                                            previousScrolbarValue = scrollbar_ZonesPanel->getValue();
                                        });
This code works, but the problem is that in them it omits the panel, but on top in the original position is not, why?
#7
Hi,sorry for my bad english)

I had a problem loading widget.
For example, let it be this:
gui.txt
Panel."info" {
    Position: (0, 668);
    Size: (500, 300);
    Visible: false;

    Renderer {
        BackgroundColor: #967832;
        BorderColor: Black;
        Borders: (0, 0, 0, 0);
    }

    ProgressBar."info_health" {
        Maximum: 100;
        Minimum: 0;
        Position: (10, 40);
        Size: (200, 20);
        TextSize: 12;
        Value: 50;
   
        Renderer {
            BackImage: "data/GUI/theme/theme.png" Part(180, 64, 90, 40) Middle(20, 0, 50, 40);
            BorderColor: Black;
            Borders: (0, 0, 0, 0);
            FrontImage: "data/GUI/theme/theme.png" Part(180, 108, 90, 32) Middle(16, 0, 50, 32);
            TextColorBack: #BEBEBE;
            TextColorFront: #FAFAFA;
        }
    }
}


my code:
gui.loadWidgetsFromFile("gui.txt");
gui_panelInfo = gui.get<tgui::Panel>("info");
tgui::ProgressBar::Ptr  gui_ProgressBarHP;

tgui::ProgressBar::Ptr  gui_ProgressBarHP;
gui_ProgressBarHP = gui.get<tgui::ProgressBar>("info_health");

and everything seems to be OK, but when I write
gui.loadWidgetsFromFile("gui.txt");
gui_panelInfo = gui.get<tgui::Panel>("info");
tgui::ProgressBar::Ptr  gui_ProgressBarHP;

tgui::ProgressBar::Ptr  gui_ProgressBarHP;
gui_ProgressBarHP = gui.get<tgui::ProgressBar>("info_health");
gui_ProgressBarHP->setValue(50);

my app is crash, why ?