It is official!

It is official! GtkImageView is now released!

Here is the whole release announcement reprinted in full, just for fun:

I'm pleased to finally announce GtkImageView 1.0.0:


GtkImageView is a simple image viewer widget for GTK. Similar to the image viewer panes in gThumb or Eye of Gnome. It makes writing image viewing and editing applications easy. Among its features are:

  • Mouse and keyboard zooming.
  • Scrolling and dragging.
  • Adjustable interpolation.
  • Fullscreen mode.


Check it out from Subversion:

svn co

Or download the latest release tarball:

API documentation can be found by browsing to the ./docs/reference/html/index.html file.

Project website:


Here is the canonical example for using the widget:

#include <gtkimageview/gtkimagescrollwin.h>
#include <gtkimageview/gtkimageview.h>
GtkWidget *view = gtk_image_view_new ();
GtkWidget *scroll = gtk_image_scroll_win_new (GTK_IMAGE_VIEW (view));

/* Where "box" is a GtkBox already part of your layout. */
gtk_box_pack_start (GTK_BOX (box), scroll, TRUE, TRUE, 0);

GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file ("someimage.png", NULL);
gtk_image_view_set_pixbuf (GTK_IMAGE_VIEW (view), pixbuf);


  • Python bindings.
  • Perl bindings.
  • Gtk# bindings.

gtk-doc problems

My first reaction was that gtk-doc really sucks. For example, it requires you to write docstrings like this:

/** * my_function_name: * * Do stuff. **/ void my_function_name (GtkWidget *widget) { }

You have to repeat my_function_name in the comment even though it should be extremely simple for the documentation generator to find out the name of the function the docstring is documenting.

There is apparently no way to group multiple source code definitions to one docstring. You can't write something like this and expect it to work:

/** * Defines the minimum and maximum allowed lengths of the name. **/ #define NAME_MIN_LENGTH 10 #define NAME_MAX_LENGTH 20

And despite writing docstrings using the weird format that gtk-doc imposes, you will still have to write separate API documentation using SGML. Yay! For each c-file gtk-doc documents, it generates a file called /tmpl/someclass.sgml which contains place holders for each symbol. Here is an except of one such file:

<!-- ##### SECTION Title ##### --> GtkImageNav <!-- ##### SECTION Short_Description ##### --> Popup window showing a thumbnailed overview of a #GtkImageView <!-- ##### SECTION Long_Description ##### --> <para> GtkImageNav is a popup window that shows a downscaled preview of the pixbuf that #GtkImageView is showing. The user can drag around an rectangle which indicates the current view of the image. </para> ...

Because gtk-doc likes to write to this file, you will have a hard time keeping it version controlled and you will have to periodically merge it with the real source code. gtk-doc therefore negates the main advantage of using a documentation generator tool which is to keep the documentation close to the source code.

I am sorry for all the complaining. gtk-doc is a decent tool and using it is better than writing all documentation is Latex, for example. But gtk-doc is not the only API documentation tool available. There is doxygen, JavaDoc, Epydoc and a whole host of other documentation generators. gtk-doc just manages to be worse then all of them.

Red wine

I like the mellow taste of red wine. I wish I had some cheese too. But alas, I only have bananas. I wish I could drink red wine and code all night. It can't be. I have work tomorrow. I don't like it, and they don't like me. Maybe if I'll drink enough I'll pass out. It is unlikely.