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

Author Topic: Please add hasFocus() to the Events-Window tutorial  (Read 7386 times)

0 Members and 1 Guest are viewing this topic.

mpeg3

  • Newbie
  • *
  • Posts: 13
  • gdinit@github
    • View Profile
Please add hasFocus() to the Events-Window tutorial
« 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:

I have created a pull request for this.

Thanks

Hapax

  • Hero Member
  • *****
  • Posts: 3346
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Please add hasFocus() to the Events-Window tutorial
« Reply #1 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 tutorial.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Elias Daler

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
    • Blog
    • Email
Re: Please add hasFocus() to the Events-Window tutorial
« Reply #2 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.
Tomb Painter, Re:creation dev (abandoned, doing other things) | edw.is | @EliasDaler

mpeg3

  • Newbie
  • *
  • Posts: 13
  • gdinit@github
    • View Profile
Re: Please add hasFocus() to the Events-Window tutorial
« Reply #3 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 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.

Hapax

  • Hero Member
  • *****
  • Posts: 3346
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Please add hasFocus() to the Events-Window tutorial
« Reply #4 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
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Please add hasFocus() to the Events-Window tutorial
« Reply #5 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, it reads
Quote
You can refer to the API documentation for a complete list of sf::Window'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 added to the tutorial. Would you agree?
SFML / OS X developer

mpeg3

  • Newbie
  • *
  • Posts: 13
  • gdinit@github
    • View Profile
Re: Please add hasFocus() to the Events-Window tutorial
« Reply #6 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, it reads
Quote
You can refer to the API documentation for a complete list of sf::Window'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 added to the tutorial. Would you agree?
Yes, I agree.