Re: GTK+ 2.0 Hello World



On Sat, Aug 30, 2003 at 05:31:28PM -0700, Bo Majewski wrote: 
http://bo.majewski.name/bluear/gnu/gtk-hello-plain/gtk-hello.html

deals with the straight Hello, World + automake. The second one,
available here

http://bo.majewski.name/bluear/gnu/gtk-hello-i18n/gtk-hello-i18n.html

Shows how to internationalize it. I want to keep both tutorials as
simple and short as possible, so please don't ask me to add features to
programs. But if you have comments about them, know a better way of
doing various things that I set up, I welcome any comments.


Nice. If you wanted to edit the tutorial materials or add chapters to
the main GTK manual, feel free. 
http://developer.gnome.org/doc/API/2.0/gtk/index.html
should really have tutorial stuff in the "GTK+ Overview" part, 
and an expanded "Common Questions"
Personally I'd like to see the GTK+ tutorial updated and merged 
in to the main manual.

Comments on the tutorial -

 - it seems to imply that on_delete is necessary to get the window 
   destroyed; this isn't the case, if you don't connect to
   delete_event at all, it's equivalent to connecting a handler 
   that simply returns FALSE. i.e. destroy happens automatically.

 - set_default_icon_from_file() will already just print a warning to
   stderr if the icon is missing I'm pretty sure, if you pass NULL for
   the GError**; so you could omit the error handling here and simply
   pass NULL, for the same effect.

 - could use gtk_widget_show_all() on the window instead of 
   showing the label separately

 - few programs seem to bother with #ifdef HAVE_CONFIG_H

 - there's no need to include glib.h separately, as gtk/gtk.h 
   sucks it in

Havoc



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