SFML community forums

Help => Window => Topic started by: BMB on December 19, 2011, 03:36:21 pm

Title: Closing a window
Post by: BMB on December 19, 2011, 03:36:21 pm
Why is it that a window created with SFML cannot be closed with the X button in its title bar? And how can I catch this click to make it close?
I am using SFML2 and Windows XP, if it makes a difference.
Title: Closing a window
Post by: Oneiros on December 19, 2011, 03:45:44 pm
http://www.sfml-dev.org/documentation/2.0/
Quote from: "http://www.sfml-dev.org/documentation/2.0/"
Code: [Select]

         // Process events
         sf::Event event;
         while (window.PollEvent(event))
         {
             // Close window : exit
             if (event.Type == sf::Event::Closed)
                 window.Close();
         }
Title: Closing a window
Post by: BMB on December 19, 2011, 04:22:37 pm
Quote from: "Oneiros"
http://www.sfml-dev.org/documentation/2.0/
Quote from: "http://www.sfml-dev.org/documentation/2.0/"
Code: [Select]

         // Process events
         sf::Event event;
         while (window.PollEvent(event))
         {
             // Close window : exit
             if (event.Type == sf::Event::Closed)
                 window.Close();
         }

Thank you. I must of missed it.