Thread: General GUI question in C

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    10

    Cool General GUI question in C

    Hello everyone;

    I'm trying to find some general information on how to program a GUI (for a game) in C similar to the ones you can easily program in Java. I'm mostly interested in backgrounds, buttons, text areas, menu bars and such.

    Can anyone give me an idea where to go find out how to do this?

    Thanks.
    "If at first you do succeed try not to look astonished!" -- anon

  2. #2
    Registered User
    Join Date
    Oct 2001
    Posts
    81
    if at first you don't succede redefine success

  3. #3
    Sayeh
    Guest
    A GUI is significant, but not difficult if


    a) you understand how they work, and
    b) you build them piece by piece.


    GUIs are cumulative, the more building blocks you build, the easier becomes the complicated stuff.

    The building block of any GUI is your graphic primitive algorithms-

    curve
    line
    text

    Once you have these, using any graphic engine, or custom drawing engine, you can build the rest.

    A button is a series of 4 lines-- a rectangle or square. It has text in the center.

    Couple this with an algorithm that watches for events (like mouse down, mouse up), and you can start building a GUI. In most GUIs, these are called 'controls'.

    If you want menus, right a 'manager' that only has routines to manage menus. One for controls, one for windows and dialogs, etc. Carefully design them so they rely on your drawing manager, which you might call 'Draw', etc.

    enjoy.

  4. #4
    Sayeh
    Guest

    spelling

    Forgive my error in the last note-- I meant 'write', not 'right' (sheesh)... Fingers were thinking technically while the mind was thinking conceptually.

    (grin)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. General question
    By saudi-vip in forum C Programming
    Replies: 11
    Last Post: 10-10-2008, 04:46 PM
  2. GUI for gome question
    By Whiteghost in forum C++ Programming
    Replies: 3
    Last Post: 07-14-2008, 06:26 PM
  3. Windows Gui Question
    By Kyrin in forum Windows Programming
    Replies: 7
    Last Post: 05-21-2006, 07:28 PM
  4. GUI App Question ??
    By aumfc in forum Windows Programming
    Replies: 9
    Last Post: 10-17-2002, 02:56 AM
  5. general question regarding a function parameter
    By mlupo in forum C Programming
    Replies: 7
    Last Post: 10-13-2002, 07:32 PM