Re: tutorial for a GTK newbie



weasel wrote:

Manish Chakravarty wrote:
i want to know what is the recommended way to start programming with
GTK i already have the Glade and the GTK tutorial with me
should i use the XML file and libglade or should i stick with glade?
help will be appreciated
Manish

If your just starting and want to learn how things work then avoid
tools that automatically do things for you like Glade.
Do all the work manually with source thats written by hand.

I contradict. In my opinion using Glade is a good way to properly learn
how to program GUIs in GTK+.

I would recommend the following steps:

1. get basic understanding of how GTK+ works, by reading tutorials and
   getting an overview over widget classes and their capabilities.

2. use Glade to play with GTK+ features. Create windows and populate
   them with widgets of all sorts, change their attributes, get a
   feeling for the various layout features etc.

3. let Glade create C source code of the UI you were designing. Study
   the resulting src/*.c files. There you can get a good idea about
   what functions are called for which widgets, how attributes and
   layouts are set / created and in which order this is done.

Don't copy/paste code from tutorials (yes there are a few) type it
manually.

This depends on the personal learning skills in general. Some people
like or need to (re)type presented source code to learn or understand
things. Others can do without it, by just thoroughly studying it.

Once the way GTK+ UIs get built by function calls is understood, it's up
to you whether you like to keep developing this way or make use of
libglade and XML "sources".

The libglade way involves a bit more overhead, requires an additional
library at runtime and makes your UI easily changeable by everyone
(which is not always desired).

On the other hand, letting Glade build the C source provides least
overhead, there's no need for a libglade installation, resource
consumption is (slightly) lower and the UI can't be modified unless the
application source is provided.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]