Recent Posts

Pages: 1 ... 8 9 [10]
Feature requests / Visual Studio warnings
« Last post by Ardent Coder on 18 September 2019, 17:09:32 »
It is good to have a project compile with no errors and warnings. But sometimes third party libraries introduce warning messages into our projects and so is the case with TGUI.
I think you should build the library in Visual Studio because it provides serious warnings as well that are ought to be noticed. One of the four warnings I'm currently getting says "Dereferencing NULL pointer mOwner" inside CopiedPtr.hpp line 121, which I guess, can prove fatal during runtime!
I hope these issues will be solved in an upcoming version of this library so that the developers can build their projects without worrying about the warnings that are produced while compiling such libraries.
Help requests / Re: OOP and TGUI
« Last post by texus on 17 September 2019, 22:35:28 »
I don't do it because i don't want to complicate the code. It doesn't add much complexity, but I feel like the minimal examples should be as straightforward as possible: just a main function with the minimum required code in them. By adding classes you are adding stuff to the code that is irrelevant to the example.

I'm not against OOP for larger examples, but for the really simple examples I don't really feel that it is needed.

It might be a good idea to have at least one example with a class though, it could be useful to demonstrate how to initialize the gui in a class and how to connect member functions. These are cases that people likely face but are currently not covered in the examples.

Calling setTarget is one way to do it, but even in a class you can still use the constructor by using the initializer list:
MyFrame::MyFrame(int argc, char* argv[]) :
    window(sf::VideoMode(800, 600), "TGUI window"),
Help requests / OOP and TGUI
« Last post by Kvaz1r on 17 September 2019, 11:58:45 »
I noticed that all examples use only "all in main" style. Is there any reason why it don't write in OOP-style?
Minimal example(it took for me a while before I realize how create Gui inside class):

Code: [Select]
#include <TGUI/TGUI.hpp>

class MyFrame
    MyFrame(int argc, char* argv[]);
    void main();

    tgui::Button::Ptr m_Button;

    sf::RenderWindow window;
    tgui::Gui gui;

MyFrame::MyFrame(int argc, char* argv[])
    window.create(sf::VideoMode(800, 600), "TGUI window");
    auto panel = tgui::ScrollablePanel::create();
    m_Button = tgui::Button::create("Press");

void MyFrame::main()
    while (window.isOpen())
        sf::Event event;
        while (window.pollEvent(event))
            if (event.type == sf::Event::Closed)

            else if (event.type == sf::Event::Resized)
                window.setView(sf::View(sf::FloatRect(0.f, 0.f, static_cast<float>(event.size.width), static_cast<float>(event.size.height))));


int main(int argc, char* argv[])
    MyFrame f(argc, argv);
Feature requests / Re: Add table widget
« Last post by Kvaz1r on 16 September 2019, 19:54:03 »
great, thank you
Feature requests / Re: Add table widget
« Last post by texus on 16 September 2019, 19:49:19 »
I made setItemColor virtual now.
Feature requests / Re: Add table widget
« Last post by Kvaz1r on 16 September 2019, 19:48:11 »
Yes, you're right, it's my mistake.
Feature requests / Re: Missing .pdb files
« Last post by Ardent Coder on 16 September 2019, 19:16:19 »
Thank you
Feature requests / Re: Add table widget
« Last post by texus on 16 September 2019, 19:13:15 »
Isn't making just setItemColor virtual enough, as the other will just call that function? Or do you have something that needs to be changed in these functions as well?
Feature requests / Re: Missing .pdb files
« Last post by texus on 16 September 2019, 19:09:30 »
I'll look into it in the near future. The next TGUI build is likely to happen on a completely different PC anyway so I'll make the changes to copy the pdb files with the library then.
Feature requests / Missing .pdb files
« Last post by Ardent Coder on 16 September 2019, 14:29:36 »
The lib folder does not contain the corresponding .pdb files of the libraries. You should distribute the .pdb files along with the libraries or embed them into the libraries while building them so that the users of your library does not get a linker warning. It will also help us debug our programs better.
Pages: 1 ... 8 9 [10]