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

Messages - r4gTime

#16
My debugger tells me it's a SIGSEGV (Segmentation Fault), when the app come to :  group->add(button1, "button");

I have absolutely no idea of what this means :/
#17
Thanks for your answer !

My tgui object is member of my class Application :
Code (cpp) Select
class Application
{
    public:
        Application();

        sf::RenderWindow window;

        tgui::Gui tgui; // GUI

    protected:

    private:

};


So it's created in my main when I create an instance of Application :
Code (cpp) Select

int main()
{
    Application app;

    Mainmenu(&app);

    return 0;
}


Is that bad ? If I initialize it in the constructor then it will be deleted after I call it ?
#18
Hello,

I have a very simple problem but I couldn't find the solution by myself or on this forum...

Adding any widget to my group makes my application crash.

I have a classe named Application, it has a tgui object called tgui.
When I create Application, I try to do this :
Code (cpp) Select
Application::Application()
{
    // Some code

    // Graphical User Interface
    Application::tgui.setTarget(Application::window); // setting my tgui object on my window object
    try
    {
        auto button1 = tgui::Button::create();
        auto group = tgui::Group::create();

        group->add(button1, "button"); // CRASH

    }
    catch (const tgui::Exception& e)
    {
        std::cerr << "TGUI Exception: " << e.what() << std::endl;
    }
}


I don't have any answer from cerr, and I don't understand why this would crash ?

Thank you for your help !