SFML community forums

Help => General => Topic started by: Elfayer on March 15, 2013, 04:50:23 pm

Title: How to block window resize ?
Post by: Elfayer 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.
Title: Re: How to block window resize ?
Post by: Laurent on March 15, 2013, 04:58:16 pm
Do not use the  sf::Style::Resize flag if you do not want resize ::)
Title: Re: How to block window resize ?
Post by: eXpl0it3r 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. ;)
Title: Re: How to block window resize ?
Post by: G. on March 15, 2013, 05:01:31 pm
A simple google search on "sfml prevent resize window" yields multiple relevant results.  ;)
Title: Re: How to block window resize ?
Post by: Elfayer 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?
Title: Re: How to block window resize ?
Post by: Gobbles 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
Title: Re: How to block window resize ?
Post by: Nexus 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...
Title: AW: How to block window resize ?
Post by: eXpl0it3r 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. :)
Title: Re: How to block window resize ?
Post by: Atifhossain 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. ;)