![]() |
![]() |
![]() |
GtkImageView Reference Manual | ![]() |
---|---|---|---|---|
GtkAnimViewGtkAnimView — Subclass of GtkImageView capable of displaying animations. |
GtkAnimView; GtkWidget* gtk_anim_view_new (void); GdkPixbufAnimation* gtk_anim_view_get_anim (GtkAnimView *aview); void gtk_anim_view_set_anim (GtkAnimView *aview, GdkPixbufAnimation *anim); void gtk_anim_view_set_is_playing (GtkAnimView *aview, gboolean playing); gboolean gtk_anim_view_get_is_playing (GtkAnimView *aview); void gtk_anim_view_step (GtkAnimView *aview);
GObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkImageView +----GtkAnimView
GtkAnimView subclasses GtkImageView. It has the same look and feel as its parent but is also capable of displaying GIF animations.
GtkAnimView uses a few more keybindings in addition to those used by GtkImageView:
Keys | Corresponding function | Description |
---|---|---|
GDK_p |
gtk_anim_view_set_is_playing() |
Stops or resumes the running animation. |
GDK_j |
gtk_anim_view_step() |
Steps the animation one frame forward. |
typedef struct _GtkAnimView GtkAnimView;
GtkAnimView is a subclass of GtkImageView that provies facilities for displaying and controlling an animation.
GtkWidget* gtk_anim_view_new (void);
Creates a new GtkAnimView with default values. The default values are:
NULL
FALSE
Returns : | A new GtkAnimView. |
GdkPixbufAnimation* gtk_anim_view_get_anim (GtkAnimView *aview);
Returns the current animation of the view.
aview : |
a GtkAnimView. |
Returns : | the current animation |
void gtk_anim_view_set_anim (GtkAnimView *aview, GdkPixbufAnimation *anim);
Sets the pixbuf animation to play, or NULL
to not play any
animation.
The effect of this method is analoguous to
gtk_image_view_set_pixbuf()
. Fit mode is reset to
GTK_FIT_SIZE_IF_LARGER
so that the whole area of the animation
fits in the view. Three signals are emitted, first the
GtkImageView will emit ::zoom-changed and then ::pixbuf-changed,
second, GtkAnimView itself will emit ::anim-changed.
The default pixbuf animation is NULL
.
aview : |
A GtkAnimView. |
anim : |
A pixbuf animation to play. |
void gtk_anim_view_set_is_playing (GtkAnimView *aview, gboolean playing);
Sets whether the animation should play or not. If there is no current animation this method does not have any effect.
aview : |
A GtkImageView. |
playing : |
TRUE to play the animation, FALSE otherwise.
|
gboolean gtk_anim_view_get_is_playing (GtkAnimView *aview);
Returns whether the animation is playing or not. If there is no
current animation, this method will always returns FALSE
.
aview : |
A GtkImageView. |
Returns : | TRUE if an animation is playing, FALSE otherwise.
|
void gtk_anim_view_step (GtkAnimView *aview);
Steps the animation one frame forward. If the animation is playing it will be stopped. Will it wrap around if the animation is at its last frame?
aview : |
A GtkImageView. |
void user_function (GtkAnimView *aview, gpointer user_data) : Run Last / Action
Steps the animation one frame forward. If the animation is
playing it will first be stopped. ::step is a keybinding signal
emitted when GDK_j
is pressed on the widget and should not be
used by clients of this library.
aview : |
a GtkAnimView |
user_data : |
user data set when the signal handler was connected. |
void user_function (GtkAnimView *aview, gpointer user_data) : Run Last / Action
Stops the animation if it was playing or resumes it, if it was
playing. ::toggle-running is a keybinding signal emitted when
GDK_p
is pressed on the widget and should not be used by
clients of this library.
aview : |
a GtkAnimView |
user_data : |
user data set when the signal handler was connected. |