How to make interface?

This is a discussion on How to make interface? within the C Programming forums, part of the General Programming Boards category; I have written a program in c. It requires user to input parameters and the program does the searching(genetic algorithm) ...

  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    6

    How to make interface?

    I have written a program in c. It requires user to input parameters and the program does the searching(genetic algorithm) and displays the complex results(complex boolean expressions). Is there any way to make a useful friendly interface with button to click and icons to display, instead of displaying in DOS.

    For example, in java i can use GUI to make the interface, how about in C?

    Thank you very much

  2. #2
    Registered User
    Join Date
    Nov 2003
    Posts
    46
    Are you using Windows XP, Mac OS X, Linux?

    I just learned how to make a simple GUI on a Mac with the Interface Builder. It was very easy to create fields and buttons.

    I do some genetic algorithm stuff too. I don't have the user asked to enter parameters like mutation rate or population size as the program runs. Instead I make a text file called "run1.txt" or something like that. In this file I keep all the parameters listed by name and their value. The program reads this text file and sets all the genetic algorithm parameters. The reason I do it this way is so I can set up a bunch of runs with different parameter files (ie "run1.txt", "run2.txt",...) and go away for a while. When I come back all the runs are finished. I also get a record of what results came from what parameters.

    -Peter
    Last edited by petermichaux; 12-12-2003 at 10:14 PM.

  3. #3
    Registered User
    Join Date
    Nov 2003
    Posts
    6
    I am using Windows XP.

    basically i want the interface to do this:
    After the user inputting parameter, click on SEARCH button and the program does the searching algorithm.

  4. #4
    Registered User
    Join Date
    Nov 2003
    Posts
    46
    I think MS Visual C++ has a interface builder. That might even be what "visual" stands for in the name. I never have figured out this visual basic, visual C++ naming system. Anyway, I think the guy at the desk next to me used it to make a GUI.

    I'd imagine building a GUI without some sort of interface building software would be very time consuming.

  5. #5
    Registered User
    Join Date
    Nov 2003
    Posts
    6
    Does anyone know any good interface builder for c programs?

  6. #6
    Registered User
    Join Date
    Jul 2003
    Posts
    450
    Unfortunately for GUI's in windows you most likely want to use the Win32API which requires some learning on your part. Except for dialog resources there really isn't any drag and drop form designer.(VC++6.0)

  7. #7
    Registered User
    Join Date
    Nov 2003
    Posts
    6
    Originally posted by curlious
    Unfortunately for GUI's in windows you most likely want to use the Win32API which requires some learning on your part. Except for dialog resources there really isn't any drag and drop form designer.(VC++6.0)
    Unfortunately i can only use Windows OS.

    What about Visual C++? Would it do the job without much modification of my C program?
    Do you know any materials or websites for Win32API? cos i don't have a clue what it is all about.

  8. #8
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,451
    You can use the win32 GUI for C programs just as you can for C++ programs.
    http://sunlightd.virtualave.net/Windows/GUI/Intro.html
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  9. #9
    Wannabe Coding God
    Join Date
    Mar 2003
    Posts
    259
    Originally posted by petermichaux

    I just learned how to make a simple GUI on a Mac with the Interface Builder. It was very easy to create fields and buttons.
    I've tryed to figure out how to attach code to your interface (not using objectiv C) but so far all my efforts have failed me...could you perhaps explain it to me?
    They say that if you play a Windows Install CD backwords, you hear satanic messages. That's nothing; play it forward and it installs Windows.

  10. #10
    Registered User
    Join Date
    Nov 2003
    Posts
    46
    I followed the instructions in the CurrencyCalculator tutorial exactly. I don't know much/anything beyond that. On my computer the tutorial starts with

    file:///Developer/Documentation/Cocoa/Conceptual/ObjCTutorial/index.html

    You probably have this file too. If not search on the Apple Developer site and I'm sure it will be there somewhere.

    Peter
    Last edited by petermichaux; 12-13-2003 at 10:46 AM.

  11. #11
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Would it be possible to use VB to create the interface and use a C program to do the work?

  12. #12
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,649
    Genetic algorithms are fun!
    Here's a UI for one I did back in school for finding the longest "snake" in an 8 dimensional hypercube.

    It allows you to dynamically change the Fitness, Selection, Mutation, and Mate functions at run time.

    gg
    Attached Images Attached Images  

  13. #13
    Wannabe Coding God
    Join Date
    Mar 2003
    Posts
    259
    Originally posted by petermichaux
    I followed the instructions in the CurrencyCalculator tutorial exactly. I don't know much/anything beyond that. On my computer the tutorial starts with

    file:///Developer/Documentation/Cocoa/Conceptual/ObjCTutorial/index.html

    You probably have this file too. If not search on the Apple Developer site and I'm sure it will be there somewhere.

    Peter
    yeah I do but that is only if you use objectiv C and I don't feel like using it, and also I try to make carbon applications instad since they it will run under both classic and OS X
    They say that if you play a Windows Install CD backwords, you hear satanic messages. That's nothing; play it forward and it installs Windows.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. trying to make a KenGen ( for a game tool )
    By lonewolfy in forum C# Programming
    Replies: 4
    Last Post: 03-28-2007, 08:23 AM
  2. Win32 Common Controls in C++, how do i make and use them?
    By C+noob in forum Windows Programming
    Replies: 6
    Last Post: 01-09-2006, 10:53 AM
  3. want to make this small program...
    By psycho88 in forum C++ Programming
    Replies: 8
    Last Post: 11-30-2005, 01:05 AM
  4. 'functions' in make?
    By mart_man00 in forum C Programming
    Replies: 1
    Last Post: 06-21-2003, 02:16 PM
  5. Replies: 6
    Last Post: 04-20-2002, 06:35 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21