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

Author Topic: Message Boxes  (Read 4558 times)

0 Members and 1 Guest are viewing this topic.

Mark

  • Guest
Message Boxes
« on: December 12, 2013, 06:40:00 pm »
Hello guys  :)
Have you ever wondered how to easily (one line of simple code) and elegantly (a nice, tiny message box with OK button and icon (windows default ones available: error, warning, info, question)) inform the user (or yourself) about an error or something else? You won't need to use enormous gloomy console/terminal or learn a way yourself how to create a portable alternative anymore! Wouldn't that be great? I know it was suggested back in 2009 but maybe 4 years have changed some minds. And hey hey hey, SDL 2.0 had introduced this function SDL_ShowSimpleMessageBox (http://wiki.libsdl.org/SDL_ShowSimpleMessageBox), so I see a demand! What do you think about it? Well, it was very useful for me to show that program couldn't find files or the levels had corrupt data and so on... I mean, they were really, really useful for me, and I think so they would for others  ;)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Message Boxes
« Reply #1 on: December 12, 2013, 06:52:42 pm »
I don't think it would fit into SFML's scope, regardless what other similar libraries do. SFML is a multimedia library, thus shouldn't provide all kinds of system functions.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: Message Boxes
« Reply #2 on: December 13, 2013, 08:25:54 am »
Quote
Well, it was very useful for me to show that program couldn't find files or the levels had corrupt data and so on... I mean, they were really, really useful for me, and I think so they would for others
Useful for sure, but too specific for the library. What about using std::cerr for reporting errors during development? I always found message boxes to be annoying for outputting debug information.

DashWave

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Message Boxes
« Reply #3 on: December 13, 2013, 06:43:14 pm »
I support the idea of adding a MessageBox function to SFML. Sure, they suck for debugging, but they are very useful for errors that should be reported to a user. For example, when you need to tell a user that a font failed to load.

Currently, one has to do:
#ifdef _WIN32
#include <windows.h>
#endif

...

#ifdef _WIN32
MessageBox(NULL, "text", "caption", MB_OK);
#endif
 

And you'd also obviously have to account for OSes other than Windows.

SFML might be a multimedia library but keep in mind there is a system module that basically consists of useful things that are painful to do in a cross-platform way. sf::Clock and sf::Thread don't exactly have much to do with multimedia.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Message Boxes
« Reply #4 on: December 13, 2013, 06:55:22 pm »
There was a recent discussions about message boxes in this thread.

To sum up, the argument was: When an application fails to load crucial resources, message boxes may be the only way to notify the user. It's not possible to output text in the window without a font, and especially on Windows there is often no console. The current alternative is a log file entry.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: Re: Message Boxes
« Reply #5 on: December 13, 2013, 08:18:09 pm »
SFML might be a multimedia library but keep in mind there is a system module that basically consists of useful things that are painful to do in a cross-platform way. sf::Clock and sf::Thread don't exactly have much to do with multimedia.
All the things you find in the system module exist because they get used by SFML internally.
The clock is a crucial one might even say the most important functionality for about anything multimedia.
The threads are usef to play sound in parallel, once SFML goes C++11, they'll most likely vanish.
Vectors get used all over the place.
etc

I guess it wouldn't be too bad to have that kind of feature, it still doesn't seem to fully fit SFML. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

eigenbom

  • Full Member
  • ***
  • Posts: 228
    • View Profile
Re: Message Boxes
« Reply #6 on: December 15, 2013, 01:14:25 am »
I agree that this would be handy. If there's a serious issue (bad video card, can't load resources, ...) then a message box is the simplest way to relate that to the user.