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

#1
Hello,

I'm trying to code something where you can drag an object and drop it on a listbox, and it does something depending on the item index where the object is dropped.

Problem is, the signal ListBox::MouseReleased doesn't work if the start of your click is not in the list box.

I thought maybe it needed to be focused, so I made a MouseEntered signal for the list box and bound  it to focusing this listbox, but it's still doesn't work.

If anyone has an idea, thank you for your help !
#2
Hello, I'd like to ask you a few questions about tooltips, because my game can't stop crashing since I implemented these.

I have X buttons implemented automatically, and 1 childWindow that I want to appear as a tooltip. But of course for each button I want to update the informations in the childwindow.

So I created a childwindow named "child_game_city_construction_tooltip".

Then I put it as a tooltip in my buttons when I create them :
Code (cpp) Select
...
button->setToolTip(xgui.get<tgui::ChildWindow>("child_game_city_construction_tooltip"));
...


But first problem : If I put my childwindow on setVisible(false), the tooltip nevers shows up. If I put it on true, then the childwindow becomes visible outside its "tooltip mission", until I go on a button that uses it.

Then, I want to update its information :
Code (cpp) Select
if(signalName == "MouseEntered") {
...
            // MAJ ToolTip
            if(s.find("construct_bati") != std::string::npos) {
                xgui.get<tgui::ChildWindow>("child_game_city_construction_tooltip")->setTitle(game.GetBatiFromType(cb).nom);
            }
        }


This code works the first Time I enter a button. But then when I go on another button, it crashes.

It seems that a widget couldn't work as a tooltip for several buttons, or something like that ?

Thank you very much for your help !
#3
Hello, I have 2 questions about chatboxes :

1 - Is there any way to change the line spacing ? With the font I use, the line spacing between 2 lines is 0 and the line spacing between two rows of the same line is huge (see attachments)

2 - Is there any way to select text in the chat box in order to copy / paste ?

(Bonus question) How do you remove chatbox background ? With theme only ?


Thanks !
#4
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 !