Module gtkimageview :: Class AnimView
[frames] | no frames]

Class AnimView

ImageView --+
            |
           AnimView

AnimView subclasses ImageView. It has the same look and feel as its parent but is also capable of displaying GIF animations.

Keybindings

AnimView uses a few more keybindings in addition to those used by ImageView:

Keys Corresponding function Description
GDK_p set_is_playing() Stops or resumes the animation
GDK_j step() Steps the animation one frame forward

See Also:
ImageView, The file ./tests/ex-anim.c program for an example of how this widget is used.
Instance Methods
 
__init__(self)
Creates a new AnimView with default values.
 
step(self)
Steps the animation one frame forward.
    Read-write properties
 
get_anim(self)
Returns the current animation of the view.
 
set_anim(self, anim)
Sets the pixbuf animation to play, or None to not play any animation.
 
get_is_playing(self)
Returns whether the animation is playing or not.
 
set_is_playing(self, playing)
Sets whether the animation should play or not.

Inherited from ImageView: get_black_bg, get_fitting, get_interpolation, get_pixbuf, get_show_cursor, get_show_frame, get_tool, get_zoom, set_black_bg, set_fitting, set_interpolation, set_pixbuf, set_show_cursor, set_show_frame, set_tool, set_zoom

    Signals

Inherited from ImageView: sig_pixbuf_changed, sig_zoom_changed

    Read-only properties

Inherited from ImageView: get_check_colors, get_draw_rect, get_viewport

    Write-only properties

Inherited from ImageView: set_offset, set_transp

    Actions

Inherited from ImageView: damage_pixels, image_to_widget_rect, zoom_in, zoom_out

Method Details

__init__(self)
(Constructor)

 

Creates a new AnimView with default values. The default values are:

  • anim : None
  • is playing : False
Overrides: ImageView.__init__

get_anim(self)

 
Returns the current animation of the view.
Returns:
the current animation

set_anim(self, anim)

 

Sets the pixbuf animation to play, or None to not play any animation.

The effect of this method is analoguous to ImageView.set_pixbuf(). Fitting is set to True so that the whole area of the animation fits in the view. Three signals are emitted, first the ImageView will emit ImageView.sig_zoom_changed and then ImageView.sig_pixbuf_changed.

The default pixbuf animation is None.

Parameters:
  • anim - a pixbuf animation to play

get_is_playing(self)

 
Returns whether the animation is playing or not. If there is no current animation, this method will always returns False
Returns:
True if an animation is playing, False otherwise.

set_is_playing(self, playing)

 
Sets whether the animation should play or not. If there is no current animation this method does not have any effect.
Parameters:
  • playing - True to play the animation, False otherwise.

step(self)

 
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?