Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How to block window resize ?  (Read 5063 times)

0 Members and 1 Guest are viewing this topic.

Elfayer

  • Newbie
  • *
  • Posts: 42
    • View Profile
How to block window resize ?
« on: March 15, 2013, 04:50:23 pm »
Hi,
I'm trying to block the resize of the window and by the way, if possible remove the maximize button of the window.

How can I do that?

That is not working:

Quote
window.create(sf::VideoMode(x, y), "SFML window", sf::Style::Resize, 0);

Thanks in advance.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: How to block window resize ?
« Reply #1 on: March 15, 2013, 04:58:16 pm »
Do not use the  sf::Style::Resize flag if you do not want resize ::)
Laurent Gomila - SFML developer

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10819
    • View Profile
    • development blog
    • Email
Re: How to block window resize ?
« Reply #2 on: March 15, 2013, 05:01:25 pm »
window.create(sf::VideoMode(x, y), "SFML window", sf::Style::Resize, 0);
I don't understand why people seem to think, that setting something specifically will remove it? ???
You're not the first one asking this, but it might be interesting to hear why you thought it would prevent resizing by setting the resize property?
Maybe Laurent can make it clearer in the documentation/tutorial (or haven't you taken a look those?).

Btw. for posting code, don't use the quote tag, but use the code=cpp tag. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

G.

  • Hero Member
  • *****
  • Posts: 1592
    • View Profile
Re: How to block window resize ?
« Reply #3 on: March 15, 2013, 05:01:31 pm »
A simple google search on "sfml prevent resize window" yields multiple relevant results.  ;)

Elfayer

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: How to block window resize ?
« Reply #4 on: March 15, 2013, 05:06:31 pm »
window.create(sf::VideoMode(x, y), "SFML window", sf::Style::Resize, 0);
I don't understand why people seem to think, that setting something specifically will remove it? ???
You're not the first one asking this, but it might be interesting to hear why you thought it would prevent resizing by setting the resize property?
Maybe Laurent can make it clearer in the documentation/tutorial (or haven't you taken a look those?).

Btw. for posting code, don't use the quote tag, but use the code=cpp tag. ;)

Because of this post : http://en.sfml-dev.org/forums/index.php?topic=5359.0
 ;D

So, what can I do to prevent it?
« Last Edit: March 15, 2013, 05:17:38 pm by Elfayer »

Gobbles

  • Full Member
  • ***
  • Posts: 132
    • View Profile
    • Email
Re: How to block window resize ?
« Reply #5 on: March 17, 2013, 04:11:27 am »
sf::Style::Close seemed to work fine for me, only allows the use of the close button and the minimize button, no border adjusting either.

I would of posted the code, however still figuring out these tag items, my apologies  ;D

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: How to block window resize ?
« Reply #6 on: March 17, 2013, 11:40:57 am »
Maybe Laurent can make it clearer in the documentation/tutorial (or haven't you taken a look those?).
I don't think that helps for people who prefer reading posts with "^_^" and other "cool" slang instead of the API documentation. But at least Elfayer has searched the forum, which is already much better than a lot of other people. But he should also have looked at the documentation, before the forum...
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10819
    • View Profile
    • development blog
    • Email
AW: How to block window resize ?
« Reply #7 on: March 17, 2013, 12:03:48 pm »
Hehe, I hear you. ;)
I was mainly curious because he wasn't the first person to get it wrong, so I thought maybe it's not clear enough. :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Atifhossain

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: How to block window resize ?
« Reply #8 on: March 17, 2013, 12:38:27 pm »
Code: [Select]

sf::RenderWindow App ( sf::VideoMode (500,500) , "SFML App" , sf::Style::Close) ;


That's all I do. ;)