## Extensions to Gtk+

Extensions to Gtk+ — Miscelleanous extensions to the Gtk+ library

## Synopsis

    #include <exo/exo.h>

    void                exo_gtk_object_destroy_later        (GtkObject *object);
    void                exo_gtk_file_chooser_add_thumbnail_preview
                                                            (GtkFileChooser *chooser);
    void                exo_gtk_url_about_dialog_hook       (GtkAboutDialog *about_dialog,
                                                             const gchar *link,
                                                             gpointer user_data);

## Description

Various additional functions to the core API provided by the Gtk+ library.

For example, `exo_gtk_file_chooser_add_thumbnail_preview()` is a convenience method to add a thumbnail based preview widget to a GtkFileChooser, which will display a preview of the selected file if either a thumbnail is available or a thumbnail could be generated using the GdkPixbuf library.

## Details

### exo_gtk_object_destroy_later ()

    void                exo_gtk_object_destroy_later        (GtkObject *object);

Schedules an idle function to destroy the specified `object` when the application enters the main loop the next time.

`object` : | a GtkObject.

### exo_gtk_file_chooser_add_thumbnail_preview ()

    void                exo_gtk_file_chooser_add_thumbnail_preview
                                                            (GtkFileChooser *chooser);

This is a convenience function that adds a preview widget to the `chooser`, which displays thumbnails for the selected filenames using the thumbnail database. The preview widget is also able to generate thumbnails for all image formats supported by GdkPixbuf.

Use this function whenever you display a GtkFileChooser to ask the user to select an image file from the file system.

The preview widget also supports URIs other than file:-URIs to a certain degree, but this support is rather limited currently, so you may want to use `gtk_file_chooser_set_local_only()` to ensure that the user can only select files from the local file system.

When `chooser` is configured to select multiple image files - using the `gtk_file_chooser_set_select_multiple()` method - the behaviour of the preview widget is currently undefined, in that it is not defined for which of the selected files the preview will be displayed.

`chooser` : | a GtkFileChooser.

Since 0.3.1.9

### exo_gtk_url_about_dialog_hook ()

    void                exo_gtk_url_about_dialog_hook       (GtkAboutDialog *about_dialog,
                                                             const gchar *link,
                                                             gpointer user_data);

This is a convenience function, which can be registered with GtkAboutDialog, to open links clicked by the user in GtkAboutDialogs.

All you need to do is to register this hook with `gtk_about_dialog_set_url_hook()` and `gtk_about_dialog_set_email_hook()`. This can be done prior to calling `gtk_show_about_dialog()`, for example:

    static void show_about_dialog (void)
    {
    #if !GTK_CHECK_VERSION (2, 18, 0)
      gtk_about_dialog_set_email_hook (exo_gtk_url_about_dialog_hook, NULL, NULL);
      gtk_about_dialog_set_url_hook (exo_gtk_url_about_dialog_hook, NULL, NULL);
    #endif

      gtk_show_about_dialog (.....);
    }

This function is not needed when you use Gtk 2.18 or later, because from that version this is implemented by default.

`about_dialog` : | the GtkAboutDialog in which the user activated a link.
`user_data` : | user data that was passed when the function was registered with `gtk_about_dialog_set_email_hook()` or `gtk_about_dialog_set_url_hook()`. This is currently unused within the context of this function, so you can safely pass `NULL` when registering this hook with GtkAboutDialog.

Since 0.5.0