SFML community forums

General => SFML website => Topic started by: mpeg3 on February 11, 2017, 09:12:49 am

Title: Please add hasFocus() to the Events-Window tutorial
Post by: mpeg3 on February 11, 2017, 09:12:49 am
Hello

When searching about window focus, the window-events tutorial page comes up in web search engine results. Page mentions lost/gainedFocus() which is great but we also have hasFocus() and requestFocus() which is the real deal from what I read.

I believe these focus related functions should be on the tutorial page, even if it's just a single sentence, to ensure all newcomers reading about focus is aware of these two functions.

Here is an example web search showing very old stuff and NOT making clear that these new two functions exist:(https://i.imgur.com/pic8yTR.png)

I have created a pull request for this.

Thanks
Title: Re: Please add hasFocus() to the Events-Window tutorial
Post by: Hapax on February 11, 2017, 05:47:26 pm
The hasFocus() and requestFocus() methods should not be included in a tutorial about events as they are not events.
If they are to included in a tutorial, it should be the Opening and managing a SFML window (http://www.sfml-dev.org/tutorials/2.4/window-window.php) tutorial.
Title: Re: Please add hasFocus() to the Events-Window tutorial
Post by: Elias Daler on February 11, 2017, 11:24:20 pm
TIL there's a hasFocus function. :o
I remember the time when it wasn't implemented and caused some problems if the window lost focus at startup.
Title: Re: Please add hasFocus() to the Events-Window tutorial
Post by: mpeg3 on February 14, 2017, 07:25:21 pm
The hasFocus() and requestFocus() methods should not be included in a tutorial about events as they are not events.
If they are to included in a tutorial, it should be the Opening and managing a SFML window (http://www.sfml-dev.org/tutorials/2.4/window-window.php) tutorial.

I see your point but being pragmatic about it and adding a one line (even a one word hyperlink) reference will go a long way.
I am not asking about a change to the official API reference guide but to the tutorial. One word can help a lot, one word will not disturb anyone that don't need it.
Title: Re: Please add hasFocus() to the Events-Window tutorial
Post by: Hapax on February 15, 2017, 10:55:20 am
Having the methods explained in a tutorial that isn't linked to it doesn't help. Again, it should be in the window tutorial, not the events tutorial. It can be expected that people have followed the window tutorial first anyway.

TIL there's a hasFocus function. :o
I remember the time when it wasn't implemented and caused some problems if the window lost focus at startup.
I guess that must have been either resolved or ignored ;D
Title: Re: Please add hasFocus() to the Events-Window tutorial
Post by: Hiura on March 04, 2017, 09:43:16 am
I think Hapax points hold. Also, in the "Playing with the window" part of the "Opening and managing a SFML window" tutorial (http://www.sfml-dev.org/tutorials/2.4/window-window.php#playing-with-the-window), it reads
Quote
You can refer to the API documentation for a complete list of sf::Window (http://www.sfml-dev.org/documentation/2.4.0/classsf_1_1Window.php)'s functions.
because we don't want to discuss every function in the tutorial -- it is intended to give the basic understanding of the system to then be able to use the documentation efficiently.

That being said, I think it would be okay to have something like this (https://github.com/SFML/SFML-Website/commit/0363ba11e8c8857392777af85a456ec061212fbf) added to the tutorial. Would you agree?
Title: Re: Please add hasFocus() to the Events-Window tutorial
Post by: mpeg3 on August 24, 2017, 02:08:57 pm
I think Hapax points hold. Also, in the "Playing with the window" part of the "Opening and managing a SFML window" tutorial (http://www.sfml-dev.org/tutorials/2.4/window-window.php#playing-with-the-window), it reads
Quote
You can refer to the API documentation for a complete list of sf::Window (http://www.sfml-dev.org/documentation/2.4.0/classsf_1_1Window.php)'s functions.
because we don't want to discuss every function in the tutorial -- it is intended to give the basic understanding of the system to then be able to use the documentation efficiently.

That being said, I think it would be okay to have something like this (https://github.com/SFML/SFML-Website/commit/0363ba11e8c8857392777af85a456ec061212fbf) added to the tutorial. Would you agree?
Yes, I agree.