Thanks,
very precise as usual.
very precise as usual.
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
void ChangeColor(int val)
{
std::cout << val << std::endl;
}
int main()
{
sf::RenderWindow window(sf::VideoMode(SCREEN_W, SCREEN_H), "Aircraft configurator", sf::Style::Close);
window.setIcon(icon_image.width, icon_image.height, icon_image.pixel_data);
// init gui
tgui::Gui gui;
gui.setTarget(window);
tgui::ComboBox::Ptr combo = tgui::ComboBox::create();
combo->setPosition(100, 100);
combo->addItem("One");
combo->addItem("Two");
combo->connect("ItemSelected", ChangeColor);
gui.add(combo);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
switch (event.type)
{
case sf::Event::Closed: window.close(); break;
}
gui.handleEvent(event);
}
window.clear(sf::Color::White);
gui.draw();
window.display();
}
return 0;
}
auto menu = tgui::MenuBar::create();
menu->getRenderer()->setTextColorDisabled(sf::Color(229*1, 131*0, 4*0));
if (event.key.code == sf::Keyboard::A)
gui.get<tgui::MenuBar>("MenuBar")->setEnabled(false);
else if (event.key.code == sf::Keyboard::S)
gui.get<tgui::MenuBar>("MenuBar")->setEnabled(true);