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 - Alpgh367

#1
Hi,
While trying to set the size and position of a button with TGUI I am receiving an access violation error. I am using Visual Studio 2015 community, I downloaded the precompiled library, and I am linking dynamically. This is the code that is causing the error:
#include "Sidebar.h"
#include "App.h"

std::shared_ptr<tgui::Button> Sidebar::homeButton()
{
tgui::Button::Ptr button = tgui::Button::create("Home");
button->setPosition(500, 200);
button->setSize(200, 200);
App app;
app.gui.add(button, "homeButton");

return button;
}


The code runs with no errors without the setPosition and setSize, leading me to believe that they are the ones causing the issue. Any help is highly appreciated, thanks!