CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: OOP with GUI

  1. #1
    Join Date
    Feb 2009
    Posts
    2

    OOP with GUI

    How do I organize a program with at least a GUI, an AI, and a driver file? I need to design a checkers program. I really just need to know how to organize it so its OOP(meaning what extends what, and how do I pass the updated board if the human player clicks it to the AI, and whatnot)

    Thanks!

  2. #2
    Join Date
    Jan 2008
    Location
    India
    Posts
    408

    Re: OOP with GUI

    This question is too vague to be answered.

    http://www.codeguru.com/forum/announcement.php?f=5&a=6
    Rate the posts which you find useful

  3. #3
    dlorde is offline Elite Member Power Poster
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,163

    Re: OOP with GUI

    You might try searching for the MVC (Model, View, Controller) pattern. The View would be the GUI itself, the model would be the data concerning the board grid and piece values and positions, and the controller would co-ordinate activities, getting moves from player or AI, applying them to the model, and optionally refreshing the view from the model (this could be automatic if the view is listening to or observing changes in the model).

    There can be MVC patterns at various levels, from application level down to individual GUI components - for example, Swing uses MVC for GUI components.

    All truths are easy to understand once they are discovered; the point is to discover them...
    G. Galilie
    Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.

  4. #4
    Join Date
    Feb 2009
    Posts
    2

    Re: OOP with GUI

    MVC answered my question. Thanks much. Thank you MOD-in-training ajbharani, but your 'assistance' was not required.

  5. #5
    Join Date
    Sep 2006
    Location
    Eastern, NC, USA
    Posts
    907

    Re: OOP with GUI

    Though ajbharani has a valid point: the more specific the question, the greater the chances of getting a specific and helpful answer. YMMV.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured