hi ,
i am a beginner to c++ i have made some console applications using visual studio, these always appear in a black window how can i
1. change the background color?
2. give a good look to my application program?
hi ,
i am a beginner to c++ i have made some console applications using visual studio, these always appear in a black window how can i
1. change the background color?
2. give a good look to my application program?
are you still running out of command prompt? If so I couldn't tell you. I started using GUIs (graphics user interface) in order to make color schemes. I chose SDL, which is crossplatform and allows for color schemes. I've also heard of other libraries that run straight of out DOS, but I am under the impression that these are very outdated. I'm by no means the most knowledgable on this subject, but even in my C++ class way back in high school our teacher didn't have us using any color schemes until we started using a GUI library.
but if you are still VERY new to C++ and learning the basics I wouldn't suggest stepping into a GUI right away until your variable control is solid and you have at least a basic understanding of how Classes, Structures, and arrays work.
There is no standard C++ way to colorize the console window. For Windows, you will have to use Win32 API calls. Here's an example:
Add a little Color to your Console Text - C++
Check the APIs for your system.
Environment: OS X, GCC / G++
Codes: Java, C#, C/C++
AOL IM: neandrake, Email: neandrake (at) gmail (dot) com
i have studied classes , structures, and arrays
my teacher also even told us how to use GUIs but i want to know it myself if some further study is needed kindly tell me i will try out and refer me some material if possible
You need to learn GUI programming. The "good look" is reachable by the appropriate use of a Graphical User Interface (GUI). C++, in a standard way, does not provide GUI facilities. To use them, you will need to use an external library or some operating-system specific API. For windows, there's the win32API, for instance. For cross-platform solutions, you have wxWidgets, Qt and FLTK, among others. Additionally, for games, you can use a game development library alongside with a GUI (For instance, OGRE and CEGUI, or even SDL-opengl and CEGUI, which I used in a project of mine).
For the average non-gaming application I recommend FLTK if you're beginning and don't want a lot of fuss. It is simple, straightforward and easy to understand. However, it isn't the prettiest of things, in spite of being light.
Next in my list is my favorite, Qt. It is a cross-platform solution with some incredible techniques. It is easy to use and understand, I believe. Lastly in my list is WxWidgets, which I don't know that well. When I tried it, I didn't like it, but it was my first attempt at using something other than the Win32 API, back when I still used Windows.
When moving to GUI programming, you'll probably have to learn about Threads and thread-synchronization, as well as event handling. These are concepts you should get familiarized with.