Extensions to Gtk

Extensions to Gtk — Miscelleanous extensions to the Gtk+ library

Stability Level

Stable, unless otherwise indicated

Synopsis


#include <exo/exo.h>

void                exo_gtk_object_destroy_later        (GtkObject *object);
gpointer            exo_gtk_object_ref_sink             (GtkObject *object);
void                exo_gtk_radio_action_set_current_value
                                                        (GtkRadioAction *action,
                                                         gint current_value);
void                exo_gtk_file_chooser_add_thumbnail_preview
                                                        (GtkFileChooser *chooser);

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_object_ref_sink ()

gpointer            exo_gtk_object_ref_sink             (GtkObject *object);

Helper function used to take a reference on object and droppping the floating reference to object (if any) atomically.

If libexo is compiled against Gtk+ 2.9.0 or newer, this function will use g_object_ref_sink(), since with newer Gtk+/GObject versions, the floating reference handling was moved to GObject. Else, this function will expand to

g_object_ref (G_OBJECT (object));
gtk_object_sink (GTK_OBJECT (object));

The caller is responsible to release the reference on object acquire by this function call using g_object_unref().

object :

a GtkObject.

Returns :

a reference to object.

exo_gtk_radio_action_set_current_value ()

void                exo_gtk_radio_action_set_current_value
                                                        (GtkRadioAction *action,
                                                         gint current_value);

Looks for all actions in the group to which action belongs and if any of the actions matches the current_value, it will become the new active action.

Else if none of the actions in action's radio group match the specified current_value, all actions will be deactivated and the radio group will have no active action afterwards.

action :

A GtkRadioAction.

current_value :

the value of the GtkRadioAction to activate.

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