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

#16
Still have the same error (Visual C++ 2015 reports error C2075).


class PanelClient
{
private:
    void windowChooseKey(const std::string& textbox)
   {
        std::cout << "Here I am" << std::endl;
   }
}


later in code...


button->connect("pressed", &PanelClient::windowChooseKey, this, "txtWindowShowKey" );


When compiling error C2075
#17
Sorry, but the test code was made just for an example. In my real code I have put a breakpoint and it never stops.
I have tried to change the test with std::cout as you wrote, but I got nothing in my console (neither stops if I put a breakpoint in the function).

I am using VC2015 under windows 10 (1803)
#18
Help requests / v0.8-dev - Picture signals
15 May 2018, 16:58:19
Hello again :)
I have a problem with the picture widget. I am trying to connect it with a DoubleClicked signal, but it seems not to fire.


int Test()
{
sf::RenderWindow window;
tgui::Gui gui;

window.create(sf::VideoMode(800, 600), "test", sf::Style::Close);
window.setFramerateLimit(60);

gui.setTarget(window);

sf::Texture texture;
texture.loadFromFile("images\\tgui-logo.png");

tgui::Picture::Ptr picture = tgui::Picture::create();
picture->getRenderer()->setTexture(texture);
picture->connect("DoubleClicked", []() {printf("Pressed"); });
gui.add(picture);

while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
return 0;

gui.handleEvent(event);
}
window.clear(sf::Color(223, 223, 223));
gui.draw();
window.display();
}

return 1;
}


Am I missing something?
#19
Hello, I have not understand how to correctly pass custom parameters is signal functions.
In my case I have a class member function that has 1 parameter as input

void PanelClient::windowChooseKey(const std::string& textbox)

I connect this function to a button press

button->connect("pressed", &PanelClient::windowChooseKey, "txtWindowShowHideKey", this);

but I am not able to compile.

What's the correct way of doing this?
#20
Help requests / Re: Listbox signals
11 May 2018, 13:41:08
good  ;)
#21
Help requests / Re: Listbox signals
11 May 2018, 13:13:20
Hi again, I have a problem with the listbox, maybe I'm doing something wrong. My program crashes when I call listbox->removeAllItems() and points to ListBox.cpp line 916 (   m_items[m_hoveringItem].setColor(m_textColorCached);)

I'm using VC 2015 and shared libs:


void Test()
{
sf::RenderWindow window({ 600,600 }, "test");
tgui::Gui gui(window);
tgui::ListBox::Ptr listbox = tgui::ListBox::create();
gui.add(listbox);

listbox->addItem("uno");
listbox->addItem("due");
listbox->addItem("tre");

listbox->connect("MousePressed", [=]() { listbox->removeAllItems(); });

while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();

gui.handleEvent(event);
}

window.clear();
gui.draw();
window.display();
}
}
#22
Help requests / Re: MenuBar problem
11 May 2018, 09:12:17
Seems to work well now.
Thank you, great work!
#23
Help requests / Re: Listbox signals
10 May 2018, 16:57:02
Ok, thank, this worked perfectly!
#24
Help requests / Re: MenuBar problem
10 May 2018, 16:36:05
To not have the error you can comment the gui.add(menu) line OR gui.setFont(font);

:-\
#25
Help requests / Listbox signals
10 May 2018, 16:31:37
I have some problems going from 0.7 to 0.8 regarding the signals and in particular the old connectEx functions.
In example I had a function called when an item in a list box is selected. The function passed to the old connectEx used a parameter Callback that reported the selectedItemId.

How can I get the same with the new signal system?

Sorry for the noob question, but I have not found any tutorial...
#26
Help requests / Re: MenuBar problem
10 May 2018, 16:21:32
I'm using Visual C++ 2015 and using dynamic link.
#27
Help requests / Re: MenuBar problem
10 May 2018, 14:50:26
Here it is:


int main(int argc, char** argv)
{
sf::RenderWindow window;
sf::Font font;
tgui::Gui gui;

window.create(sf::VideoMode(800, 600), VERSION, sf::Style::Close);
window.setFramerateLimit(60);

font.loadFromFile("fonts\\segoeui.ttf");
gui.setTarget(window);
gui.setFont(font);

tgui::MenuBar::Ptr  menu = tgui::MenuBar::create();
gui.add(menu);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
return 0;

gui.handleEvent(event);
}
window.clear(sf::Color(223, 223, 223));
gui.draw();
window.display();
}

return 9;


Just comment the
gui.add(menu);

and no errors on exit
#28
Help requests / MenuBar problem
10 May 2018, 14:35:36
Hello,
I have updated SFML to 2.5.0 and TGUI 0.8 dev all compiled with source by myself.
It all works well, but I have a problem when using tgui::Menubar.

What I do is just this:
- load a font
- set this font to tgui::gui
- create a MenuBar
- add menubar to gui

then normal event processing and rendering.

All works, only when I close the program I have this error:

Failed to activate OpenGL context: Operazione completata.

An internal OpenGL call failed in Texture.cpp(117).
Expression:
   glDeleteTextures(1, &texture)
Error description:
   GL_INVALID_OPERATION
   The specified operation is not allowed in the current state.


This is not happening if I just don't add the menubar to gui.

Is there something I miss?
#29
Help requests / Re: Tabs disable
09 April 2018, 09:11:47
This is a very usefull function, thank you very much!
#30
Help requests / Re: Tabs disable
12 March 2018, 08:45:36
Thanks!