title: Why SFML rectangle textbox is not being formed and how to fix it?
body: <p>I was making a program in SFML and C++, which like other program have a rectangle shaped box under which text is being filled but it does not even show a rectangle box. My code is:</p>
  <pre><code>int main()
  {
      sf::RenderWindow window({ 640 ,480}, &quot;Window&quot;);
  
      std::string input_text;
      sf::Font font;
      font.loadFromFile(&quot;arial.ttf&quot;);
      sf::Text text(&quot;&quot;, font);
  
      sf::Clock clock;
      sf::RectangleShape rectangle(sf::Vector2f(120, 50));
      rectangle.setSize(sf::Vector2f(100, 100));
      rectangle.setFillColor(sf::Color(150, 50, 250));
      rectangle.setOutlineThickness(10);
      rectangle.setOutlineColor(sf::Color(250, 150, 100));
      window.draw(rectangle);
      while (window.isOpen())
      {
          sf::Event event;
          while (window.pollEvent(event))
          {
              if (event.type == sf::Event::Closed)
                  window.close();
              else if (event.type == sf::Event::TextEntered) {
                  if (std::isprint(event.text.unicode))
                      input_text += event.text.unicode;
              }
              else if (event.type == sf::Event::KeyPressed) {
                  if (event.key.code == sf::Keyboard::BackSpace) {
                      if (!input_text.empty())
                          input_text.pop_back();
                  }
                  if (event.key.code == sf::Keyboard::Return) {
                      std::string text1 = text.getString().toAnsiString();
                      std::cout &lt;&lt; text1 &lt;&lt; std::endl;
                  }
              }
          }
  
          static sf::Time text_effect_time;
          static bool show_cursor;
  
          text_effect_time += clock.restart();
  
          if (text_effect_time &gt;= sf::seconds(0.5f))
          {
              show_cursor = !show_cursor;
              text_effect_time = sf::Time::Zero;
          }
  
          text.setString(input_text + (show_cursor ? '_' : ' '));
  
          window.clear();
          window.draw(text);
          window.display();
      }
  }
  </code></pre>
  <p>I learnt how to make rectangle shape from SFML webpage. I tried to put it under the <code>while (window.isOpen())</code> and even outside but it doesn't appear to work. What is the issue and how can I fix it? And can text move to next line when it comes out of box?</p>