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.