The Pianist
The Pianist

Reputation: 556

Should I think about GUI at beginning of project?

I want to start a Process Manager project in C and it's suppose to have a Graphical User Interface. It's my first GUI project and I have no idea about it. After some searches I found that I should use winapi32 libraries.

My question is:

Should I write my project like a Console-based one and then I add GUI to it or I should think about GUI at beginning of my project?

Upvotes: 1

Views: 670

Answers (5)

user1319384
user1319384

Reputation:

If you want to make an user interface, you can use QTCreator or Visual Studio forms projects...

QT is an excellent way to make cross-platforms and cute interfaces... Visual Studio forms are usable only in windows platforms.

When you're working with any of these technologies you have to put "componentes" in a "window" a then code them...

Upvotes: 1

Dr.Kameleon
Dr.Kameleon

Reputation: 22820

Why write your project like a console-based one, since it's gonna end up with a GUI?

If there are any things you want to try it out first (like you don't know how to do a,b or c), sure you can implement that as a side project.


But as far as your main Project goes, that's what I'd do :

  1. Carefully plan and design

    • What is it gonna do?
    • How are you gonna do it?
    • What should the User Interface contain in order to fully accomodate what you need
  2. Coding
  3. Test and Debug.
  4. Repeat 2 & 3 until perfectly satisfied.

Hint :

  • A. I wouldn't suggest you to add your GUI to an existing console app, 'coz this will most likely lead to messy code and/or a messy UI. ;-)

  • B. Always study before trying to implement anything. You simply can't imagine how much your knowledge of what can be done influences what you can do (and most likely what you'll end up doing).

Upvotes: 1

Israel Unterman
Israel Unterman

Reputation: 13510

I would like to say that it's best to write the application as a command line application, then write a wrapper in GUI. This way you get the most flexible application with a total separation between the GUI and functionality.

But I won't say it! :-) From my experience it's very difficult to totally seperate the GUI from the application, and thus you should built it with GUI in mind. Your code must open windows, report progress, react upon GUI events, so you must be well familiar with the GUI system you use.

But you must also maintain a separation between the GUI and the functionality as much as you can. For example, make your callbacks short, and direct the funcionality to non-GUI parts of the application. If you need to report progress during long calculation, pass a callback to the calculation algorithm instead of mixing GUI progress commands within the algorithm.

You also must bear in mind that most (if not all) GUI system can do GUI commands only within the main application thread, and build the program accodingly.

So in summary - yes, think about GUI at the beginning, it will be easier this way, but also keep a good separation between the GUI and the functionality,

Upvotes: 3

katzenversteher
katzenversteher

Reputation: 810

You could design your program in a way that enables you to use both, text and graphical user interface. Offer an abstracted interface to the core functionality and use it from the text and the graphical interface.

If you want start top-down and not bottom-up you should choose whatever you prefer to start with a text or graphical interface that calls stub-versions of your interface.

Upvotes: 1

juergen d
juergen d

Reputation: 204854

Why changing the program during development? Just design it like it should be in the end.

Upvotes: 1

Related Questions