hello everybody
i'm using Lubuntu 13.04, Code::Blocks 12.11, GCC, and G++
so, i'm creating a little application based on SFML. it hides the console for default.
but i'd like to pop up the console in some special cases (mainly for error output). is there any way to show up the console only in some specific situations?
or any other way to expose to the user that an error ocurred? i tought about message box, but is there any library to that, other than full GUI libs?
thanks in advance!
note: i don't want sfml to handle that, as if an error with sfml itself occurs, i'll have nothing to show the error to the user
note2: i want a way to just show the error, not to handle it. i already know how to use try/catch :)
thanks again!
or any other way to expose to the user that an error ocurred? i tought about message box, but is there any library to that, other than full GUI libs?
Your using SFML which is a graphics library which can create windows and draw stuff to them ;p. You don't need another library to display a popup error message.
It's just like creating any other window in SFML though you will need a way to pass the errors into the new window so you can display the error and any error text you wish to display about that particular error. Creating the popup window would be the easy part, devising a error management system is a bit trickier.
> That's a lame workaround as it doesn't let you run from the debugger.
open a console
execute your debugger
run the program
> I don't know how to do that with C::B.
I found that to be default behaviour
Also, under Settings->Environment
Terminal to launch console programs: xterm -T $TITLE -e
You don't need another library to display a popup error message
actually i want something to output errors exactly for when SFML doesn't work. for example, if someone delete a font from the application folder, then SFML won't be able to load it and then will not output any text (and SFML don't have any default fonts; plus it can't access system fonts)
open a console, then run your program.
there's no point in running something from terminal if i want the terminal itself to be hidden by default...
i'm trying to make a simple graphical application to the end-user. so, no need for terminal (and most people don't even know how to use it)
i just wanted it to appear when some error occur, to show what the error is.
actually i want something to output errors exactly for when SFML doesn't work. for example, if someone delete a font from the application folder, then SFML won't be able to load it and then will not output any text (and SFML don't have any default fonts; plus it can't access system fonts)
That would be a runtime error that can be handled by your resource manager.
1 2
if (!resource->loadFromFile(filename))
throw std::runtime_error("ResourceHolder::load - Failed to load " + filename);