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

Author Topic: Choose Window Parent (e.g. to have Win2 always above Win1)  (Read 3084 times)

0 Members and 1 Guest are viewing this topic.

Tenry

  • Full Member
  • ***
  • Posts: 120
  • Experienced Programmer
    • View Profile
    • Simon-Burchert.com
Choose Window Parent (e.g. to have Win2 always above Win1)
« on: August 08, 2010, 04:03:24 pm »
What's about the feature to choose a parent of a new window? I think that could be useful if I had a main game window and a debug window, which I'd like to be always above the main window.
Please note that my previous display name was "Shy Guy".

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Choose Window Parent (e.g. to have Win2 always above Win1)
« Reply #1 on: August 08, 2010, 05:25:25 pm »
A modal window ? You can do it this way : if win1 lost the focus and win2 grab the focus then set win1 as active.
SFML / OS X developer

Spodi

  • Full Member
  • ***
  • Posts: 150
    • View Profile
    • http://www.netgore.com/
Choose Window Parent (e.g. to have Win2 always above Win1)
« Reply #2 on: August 08, 2010, 05:36:01 pm »
Sounds more like something you should look for in your programming language of choice and not SFML.

Tenry

  • Full Member
  • ***
  • Posts: 120
  • Experienced Programmer
    • View Profile
    • Simon-Burchert.com
Choose Window Parent (e.g. to have Win2 always above Win1)
« Reply #3 on: August 08, 2010, 05:49:46 pm »
Quote from: "Hiura"
A modal window ? You can do it this way : if win1 lost the focus and win2 grab the focus then set win1 as active.

But I still need the focus on win2. Maybe I want to freeze the game while focusing win2.
And in addition, I don't think so that SFML has window focus functions, or I just don't know it has.

Quote from: "Spodi"
Sounds more like something you should look for in your programming language of choice and not SFML.

It does not have to do with the programming language.
There is WinAPI for Windows and X11 for Linux doing it.
Please note that my previous display name was "Shy Guy".

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Choose Window Parent (e.g. to have Win2 always above Win1)
« Reply #4 on: August 08, 2010, 06:10:20 pm »
Quote from: "Shy Guy"
But I still need the focus on win2. Maybe I want to freeze the game while focusing win2.
And in addition, I don't think so that SFML has window focus functions, or I just don't know it has..
Yes there is : LostFocus and GainedFocus events.

But I don't think you can use them to do what you want. Maybe you can do it by creating your own window (system specific) and use SFML only for rendering.
SFML / OS X developer

nfries88

  • Newbie
  • *
  • Posts: 42
    • View Profile
Choose Window Parent (e.g. to have Win2 always above Win1)
« Reply #5 on: October 27, 2010, 09:37:46 pm »
Quote from: "Hiura"
But I don't think you can use them to do what you want. Maybe you can do it by creating your own window (system specific) and use SFML only for rendering.


This solution would either reduce portability or require him to learn how to do it on all systems supported by SFML (which requires him to play with Obj-C for Mac, which I can personally attest to not being fun).

The functionality requested is very simple to implement, available on every presently supported system, and very common practice in a variety of different applications -- web browsers, video games, media players, etc. It is not a high-level feature and would not be complicated to use. I think it fits SFML nicely.