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

Threaded View

  1. #1
    Join Date
    Nov 2011
    Posts
    46

    connecting GUI to program

    So I have my GUI far along enough to start incorporating my program, but I am hesitant to start because I want to be careful to do it in an effective and easy to manage way.

    The code so far for the GUI alone is about 2100 lines, and I estimate it will be about 8000-10000 lines long when the program is complete. The code for the actual program (without GUI), is about 6000 lines long so far, and will probably get up to about 10,000 when I've added most of what I intend.

    Is it a good idea to have the GUI portion, or at least some of it in a separate source file? If you were to do this, how would you? Obviously you can only have one main function. Would you have a file just for the main function, a header file with all the necessary includes and global variables, and put different portions of the rest in separate files.

    Concerning the GUI; In my main function, if you click a button, a function connected to that button is called. Inside that function, I may have code to hide many other buttons while this button is selected; Also to manage effects which help you see visually which button is selected. My program so far has like 70 different GUI objects which all get modified, hidden, shown, etc in different circumstances, and multiple menus.

    My question; what's the most reasonable way to do this? Right now all my buttons, and their associated objects are all global. Is this reasonable? Is there an exception to the globals are bad rule in cases like this?
    Last edited by wl3; February 3rd, 2012 at 08:28 PM.

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