You are not logged in.

#1 2009-10-03 13:13:24

stefanwilkens
Member
From: Enschede, the Netherlands
Registered: 2008-12-10
Posts: 624

GTK Programming: C or C++

Through something of a community race project between myself and some friends, we have set ourselves a goal. This being to learn a set of multi platform GUI programming skills. The end result will be an assignment given to us by a professor at my university.

I've chosen to go with GTK, due to my love for gnome.

Now knowling fairly little about C / C++ and GTK, I will be starting from base. Though I'm capable of the basics such as bash, visual .net and the likes, I expect I'll have to start from scratch here.

Now from what I know, GTK is C... But has bindings for C++. Which should I become proficient in before I move on with GTK tutorials?


Arch i686 on Phenom X4 | GTX760

Offline

#2 2009-10-03 13:20:13

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,410
Website

Re: GTK Programming: C or C++

I have not done a lot of GTK programming, but I prefer the C++ bindings.

Offline

#3 2009-10-03 13:24:19

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: GTK Programming: C or C++

You could as well go for C and Gtk for the beginning. That way the learning curve is not so steep.

Once you've mastered this step it is fairly easy to advance to GtkMM (provided you feel provicient enough in C++ then). It will ease object-oriented programming the GUI a lot.


To know or not to know ...
... the questions remain forever.

Offline

#4 2009-10-03 13:49:02

Lich
Member
Registered: 2009-09-13
Posts: 437

Re: GTK Programming: C or C++

Yep, definatly C + GTK. If the language was not imposed, the fastest way to do GTK would still be Python though smile


Archlinux | ratpoison + evilwm | urxvtc | tmux

Offline

#5 2009-10-03 15:00:58

stefanwilkens
Member
From: Enschede, the Netherlands
Registered: 2008-12-10
Posts: 624

Re: GTK Programming: C or C++

so it seems to come down to user preference smile

I will be ordering:
http://en.wikipedia.org/wiki/The_C_Prog … %28book%29

thanks for the clarification guys.


Arch i686 on Phenom X4 | GTX760

Offline

#6 2009-10-03 15:51:23

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: GTK Programming: C or C++

You can always look into wxWidgets. Then you not only have GTK2 on any platform that supports wxGTK, you can also have native Windows and Mac controls.

Offline

#7 2009-10-03 16:01:59

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: GTK Programming: C or C++

K&R is the proper way to start learning C. big_smile

Next step will be to become proficient with a suiting development environment. You can go on for a while using an editor of your choice and the hints from e.g. the GTK+ 2.0 Tutorial. But once your applications become more complex you will definitely need more advanced tools.

At least you should have cursory look at info make, info autoconf, and there esp. this chapter info "(autoconf)The GNU Build System".

Or you go on and use a dedicated IDE like e.g. Anjuta from the beginning. (Studying those autotools docs would help nontheless.)


To know or not to know ...
... the questions remain forever.

Offline

#8 2009-10-03 16:02:36

Themaister
Member
From: Trondheim, Norway
Registered: 2008-07-21
Posts: 652
Website

Re: GTK Programming: C or C++

I tried wxWidgets, but had serious problems finding good tutorials that I could spin off from. Any ideas?

C + GTK seems very "clean" and simple. At least the simple Hello World and basic packing of widgets simply made more sense with C-style programming tongue

Last edited by Themaister (2009-10-03 16:04:31)

Offline

#9 2009-10-03 19:15:35

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: GTK Programming: C or C++

Themaister wrote:

I tried wxWidgets, but had serious problems finding good tutorials that I could spin off from. Any ideas?

There's a bunch of programs that use wxGTK in the repos. I'd just take a look at the source for those to see what others have done.

Offline

#10 2009-10-03 19:18:58

Anikom15
Banned
From: United States
Registered: 2009-04-30
Posts: 836
Website

Re: GTK Programming: C or C++

What about SDL?


Personally, I'd rather be back in Hobbiton.

Offline

#11 2009-10-03 19:46:03

scj
Member
From: Sweden
Registered: 2007-09-23
Posts: 158

Re: GTK Programming: C or C++

Anikom15 wrote:

What about SDL?

That would cover the G, not the UI.

Offline

#12 2009-10-05 20:10:35

SiC
Member
From: Liverpool, England
Registered: 2008-01-10
Posts: 430

Re: GTK Programming: C or C++

What about Python? Python has good GTK bindings, and it's quite a nice language, a lot of people on these forums seem to like it,... Just a thought.

Offline

#13 2009-10-06 02:07:51

dalingrin
Member
Registered: 2009-03-18
Posts: 128

Re: GTK Programming: C or C++

stefanwilkens wrote:

Through something of a community race project between myself and some friends, we have set ourselves a goal. This being to learn a set of multi platform GUI programming skills. The end result will be an assignment given to us by a professor at my university.

I've chosen to go with GTK, due to my love for gnome.

Now knowling fairly little about C / C++ and GTK, I will be starting from base. Though I'm capable of the basics such as bash, visual .net and the likes, I expect I'll have to start from scratch here.

Now from what I know, GTK is C... But has bindings for C++. Which should I become proficient in before I move on with GTK tutorials?

This is definitely personal preference.

For me, I prefer using C++ for gui programming but, I started out with with object-oriented programming early on. If you don't have much object-oriented programming experience I suggest start out with C and GTK. Though, unless you specifically want to learn a "lower" level language, I would suggest Python and PyGTK. After that it will probably be easier to learn something lower level.
I'll warn you, if you are coming form bash and visual basic then C/C++ will be quite a shock. Python will be a good intermediary.

Offline

#14 2009-10-06 06:35:40

davehome
Member
From: Canada
Registered: 2009-10-06
Posts: 1
Website

Re: GTK Programming: C or C++

I've played with Vala a little bit, and it's extremely awesome in many ways.

Vala is a new programming language that aims to bring modern programming language features to GNOME developers without imposing any additional runtime requirements and without using a different ABI compared to applications and libraries written in C.

[...]

valac, the Vala compiler, is a self-hosting compiler that translates Vala source code into C source and header files. It uses the GObject type system to create classes and interfaces declared in the Vala source code.

The syntax of Vala is similar to C#, modified to better fit the GObject type system.

arch packages:

# yaourt -Ss vala

First post, btw; and, I've been using Arch since:

# ls -alh /
total 77K
drwxr-xr-x  20 root root 4.0K 2009-09-30 11:33 .
[...]

smile

Offline

Board footer

Powered by FluxBB