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

#1
Help requests / Re: Bug in MessageBox
12 February 2015, 13:29:31
I pulled the latest dev version and it's working now. I see that you had other modification of fonts in MsgBox code. That was probably the problem. Thanks, Texus.  ;)
#2
Help requests / Re: Bug in MessageBox
12 February 2015, 12:08:44
I set the font properly, my other gui elements (button, label, editbox) work as expected. And I also don't get any message in terminal.

However I found that in MessageBox's labels (the string to show or labels of Yes, No buttons) has m_string with the proper string but in m_text is an empty m_string (type of sf::String) member. I think that's why I can't see any text, but don't know why it's empty.

Just to be clear: in my example
exitMsg->m_label.data.m_string.m_string = "Are you sure you want to quit?", but
exitMsg->m_label.data.m_text.m_string.m_string = "".
I think the second one is needed by the graphical representation.

Any advice?
#3
Help requests / Bug in MessageBox
11 February 2015, 22:38:19
Hi Texus,

First I'd like to thank you for this amazing library. It helped me a lot that I didn't have to write my own gui logic for SFML.

Though I think I found a bug in MessageBox. In the cpp file on lines 65 and 195 when a button is clicked you send a "ButtonClicked" signal. However in the constructor (and according to the API documentation) you look for the "ButtonPressed" signal. And so if I click on the button it can't find the "ButtonClicked" signal and stops with an assert. I modified the code locally and it works for me. Could you please fix it in your dev version? Thanks in advance.

I also have another issue with messagebox (however don't know the reason). I'm setting my messagebox like this:

tgui::MessageBox::Ptr exitMsg = tgui::MessageBox::create("Gui/Black.conf");
exitMsg->setText(sf::String("Are you sure you want to quit?"));
exitMsg->addButton(sf::String("Yes"));
exitMsg->addButton(sf::String("No"));


When the messagebox appears I can't see any text neither in the window nor on the buttons, just the blank placeholders. Is there anything else I should set? Either for sf::String or for the MessageBox?

Oh and I'm using Windows 7 with MinGW 4.8.