Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Good site for C tutorials esp. GUIs?

  • 21-04-2005 2:48pm
    #1
    Closed Accounts Posts: 680 ✭✭✭


    Exactly as it says up top. I have to develop a GUI in C(just c, not ++) and i've never written anything in it before. Anybody got a good tutorial site that can help out?


Comments

  • Closed Accounts Posts: 7,230 ✭✭✭scojones


    Move this thread to the programming board.


  • Registered Users, Registered Users 2 Posts: 2,002 ✭✭✭bringitdown


    http://www.cs.cf.ac.uk/Dave/C/CE.html - C programming ... great site.

    GUI's in C: what platform? Why C? There are 'easier' languages to develop GUI's in than C. If it must be C GTK is a great toolkit.

    http://www.gtk.org/tutorial/ - GTK - Gimp Toolkit (GUI Widgets) Tutorials.


  • Closed Accounts Posts: 680 ✭✭✭Amaru


    I have to program in C because its part of a project i'm doing. The language has to be procedural, so i figured C was the easiest to program in out of the few choices there are.


  • Registered Users, Registered Users 2 Posts: 4,003 ✭✭✭rsynnott


    What OS and GUI toolkit do you want to use? GTK is probably a good bet if you're on Linux or Windows.


  • Closed Accounts Posts: 680 ✭✭✭Amaru


    Well i only really know windows, so thats probably what i'm going with. And do i definitely have to use a toolkit? I'd actually prefer to hard code it, because i have to write a report on using the language. Is that a lot harder than using a toolkit(obviously it'll be harder, but is it a major hassle to program GUIs in C?)?


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,002 ✭✭✭bringitdown


    Hard - code?

    You don't seem to know what you are doing tbh... to get a simple window to display you will have to use some sort of API or toolkit, simple as.


  • Closed Accounts Posts: 680 ✭✭✭Amaru


    You don't seem to know what you are doing tbh

    That should have been obvious from the start! Its pretty much why i need a tutorial! And yeah hard code, as in build the code for the GUI yourself, instead of having a program write it for you while you basically just draw what you want(the same way as Dreamweaver would do for you instead of hard coding in HTML). Like in Java you can just write the code for the GUI, or you can get a program that'll do it for you. You're saying its different in C?


  • Registered Users, Registered Users 2 Posts: 2,002 ✭✭✭bringitdown


    Okay that is a little clearer, try the GTK then, you don't 'draw' the GUI you code it - calling the toolkit API to create a window for example.

    e.g.
     button = gtk_button_new_with_label ("Hello World"); 
    

    That creates a new button object with the text Hello World:
    http://www.gtk.org/tutorial/ch-gettingstarted.html#SEC-HELLOWORLD

    It is all code baby no drawing at all.

    /edit:
    Java has a built in GUI toolkit called Swing which is more or less the standard. C has no equivalent. So there are many 'vendors' / 'publishers' of toolkits and APIs that allow you to do it.


  • Registered Users, Registered Users 2 Posts: 4,003 ✭✭✭rsynnott


    Amaru wrote:
    That should have been obvious from the start! Its pretty much why i need a tutorial! And yeah hard code, as in build the code for the GUI yourself, instead of having a program write it for you while you basically just draw what you want(the same way as Dreamweaver would do for you instead of hard coding in HTML). Like in Java you can just write the code for the GUI, or you can get a program that'll do it for you. You're saying its different in C?

    It's different in that Java is a language with a large library collection, including AWT and SWING which do GUI (you can, incidentally, have a JRE that lacks those, and conversely you can have those and still use a third party toolkit like SWT). C is a language with only a small set of libraries as standard. That means that to do GUI stuff, or networking, or nuclear power plant control, or whatever, you have to use external toolkits. GTK is one of many such toolkits for doing GUI.

    Incidentally, if you don't know C, then this is not the best way to learn it. Do you know any language?
    Rob


  • Registered Users, Registered Users 2 Posts: 2,098 ✭✭✭aaf


    Slightly off topic but I'm selling a few programming books on this thread


  • Advertisement
  • Closed Accounts Posts: 680 ✭✭✭Amaru


    rsynnott wrote:
    Incidentally, if you don't know C, then this is not the best way to learn it. Do you know any language?
    Rob

    I know Java, and basic C++, but thats it. I don't really need to learn the language, just develop this GUI in it for my project, and then i'll more than likely never need to use it again, as i can't think why i'd need to(instead of C++).

    Just to be sure, GTK is definitely C and not C++ yeah?


  • Registered Users, Registered Users 2 Posts: 4,003 ✭✭✭rsynnott


    Amaru wrote:
    I know Java, and basic C++, but thats it. I don't really need to learn the language, just develop this GUI in it for my project, and then i'll more than likely never need to use it again, as i can't think why i'd need to(instead of C++).

    Just to be sure, GTK is definitely C and not C++ yeah?

    Erm, why not use Java? Surely when they say procedural they just want the PROGRAM to be procedural.

    You might well have cause to use C again. It's standard for driver development for Linux, for a lot of UNIX app development, and a lot of game development (including Playstation).

    Yep, GTK++ is C. There's a C++ binding (ironically called GTK-- IIRC)


  • Closed Accounts Posts: 680 ✭✭✭Amaru


    rsynnott wrote:
    Erm, why not use Java? Surely when they say procedural they just want the PROGRAM to be procedural.

    I don't follow?


Advertisement