GcrUi.Viewer
Description: Reference for GcrUi.Viewer

### Interface

# GcrUiViewer

#### Description [src]

    interface GcrUi.Viewer : Gtk.Widget

An abstract interface that represents a widget that can hold various renderers and display their contents.

The interaction between `GcrRenderer` and `GcrViewer` is not stable yet, and so viewers cannot be implemented outside the Gcr library at this time.

Use the `gcr_viewer_new()` and `gcr_viewer_new_scrolled()` to get default implementations of viewers.

#### Prerequisite

In order to implement Viewer, your type must inherit from`GtkWidget`.

#### Functions

###### gcr_viewer_new

Get an implementation of `GcrViewer` that supports a view of multiple renderers.

###### gcr_viewer_new_scrolled

Get an implementation of `GcrViewer` that supports a scrolled view of multiple renderers.

#### Instance methods

###### gcr_viewer_add_renderer

Add a renderer to this viewer.

###### gcr_viewer_count_renderers

Get the number of renderers present in the viewer.

###### gcr_viewer_get_renderer

Get a pointer to the renderer at the given index. It is an error to request an index that is out of bounds.

###### gcr_viewer_insert_renderer

Insert a renderer at a specific point in the viewer.

###### gcr_viewer_remove_renderer

Remove a renderer from this viewer.

#### Interface structure

    struct GcrUiViewerIface {
      GTypeInterface parent;
      void (* add_renderer) (
        GcrViewer* viewer,
        GcrRenderer* renderer
      );
      void (* insert_renderer) (
        GcrViewer* viewer,
        GcrRenderer* renderer,
        GcrRenderer* before
      );
      void (* remove_renderer) (
        GcrViewer* viewer,
        GcrRenderer* renderer
      );
      guint (* count_renderers) (
        GcrViewer* viewer
      );
      GcrRenderer* (* get_renderer) (
        GcrViewer* viewer,
        guint index_
      );

    }

The interface for `GcrViewer`.

###### Interface members

`parent` |
    GTypeInterface
| The parent interface.
`add_renderer` |
    void (* add_renderer) (
        GcrViewer* viewer,
        GcrRenderer* renderer
      )
| Virtual method to add a renderer.
`insert_renderer` |
    void (* insert_renderer) (
        GcrViewer* viewer,
        GcrRenderer* renderer,
        GcrRenderer* before
      )
| Virtual method to insert a renderer.
`remove_renderer` |
    void (* remove_renderer) (
        GcrViewer* viewer,
        GcrRenderer* renderer
      )
| Virtual method to remove a renderer.
`count_renderers` |
    guint (* count_renderers) (
        GcrViewer* viewer
      )
| Virtual method to count renderers.
`get_renderer` |
    GcrRenderer* (* get_renderer) (
        GcrViewer* viewer,
        guint index_
      )
| Virtual method to get a renderer.

#### Virtual methods

###### GcrUi.Viewer.add_renderer

Add a renderer to this viewer.

###### GcrUi.Viewer.count_renderers

Get the number of renderers present in the viewer.

###### GcrUi.Viewer.get_renderer

Get a pointer to the renderer at the given index. It is an error to request an index that is out of bounds.

###### GcrUi.Viewer.insert_renderer

Insert a renderer at a specific point in the viewer.

###### GcrUi.Viewer.remove_renderer

Remove a renderer from this viewer.