Thread: colours

  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    41

    Arrow colours

    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?

  2. #2
    Bored Programmer
    Join Date
    Jul 2009
    Location
    Tomball, TX
    Posts
    428
    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.

  3. #3
    30 Helens Agree neandrake's Avatar
    Join Date
    Jan 2002
    Posts
    640
    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

  4. #4
    Registered User
    Join Date
    Sep 2010
    Posts
    41
    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

  5. #5
    Registered User
    Join Date
    Mar 2008
    Location
    Coimbra, Portugal
    Posts
    85
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Ncurses colours without allocating colour pairs?
    By kzar in forum C Programming
    Replies: 12
    Last Post: 04-17-2005, 11:55 AM
  2. Colours in DOS box
    By denizengt in forum Tech Board
    Replies: 1
    Last Post: 09-10-2003, 06:53 AM
  3. Changing Text/Background colours for window controls ...
    By Shag in forum Windows Programming
    Replies: 1
    Last Post: 11-16-2002, 11:57 AM
  4. problem with 256 colours and ellipse
    By denny in forum C Programming
    Replies: 2
    Last Post: 04-22-2002, 12:31 AM
  5. Colours?
    By Fountain in forum C++ Programming
    Replies: 7
    Last Post: 01-29-2002, 03:41 PM