StarredCellRendererRating

StarredCellRendererRating — A cell renderer for the typical five-star rating.

Synopsis

#include <libstarrred/libstarrred.h>

struct              StarredCellRendererRating;
struct              StarredCellRendererRatingClass;
GtkCellRenderer *   starred_cell_renderer_rating_new    (void);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkCellRenderer
               +----StarredCellRendererRating

Properties

  "black-char"               guint                 : Read / Write
  "black-icon-name"          gchar*                : Read / Write
  "editable"                 gboolean              : Read / Write
  "icon-size"                GtkIconSize           : Read / Write
  "max-rating"               gint                  : Read / Write
  "min-rating"               gint                  : Read / Write
  "rating"                   gint                  : Read / Write
  "white-char"               guint                 : Read / Write
  "white-icon-name"          gchar*                : Read / Write

Signals

  "edited"                                         : Run Last

Description

Check description of the StarredRating class for configuration examples.

Details

struct StarredCellRendererRating

struct StarredCellRendererRating;

Opaque data structure representing StarredCellRendererRating instances.


struct StarredCellRendererRatingClass

struct StarredCellRendererRatingClass {
  GtkCellRendererClass parent_class;

  void (*edited) (StarredCellRendererRating *cell_renderer_stars,
                  const gchar               *path,
                  gint                       new_rating);

  /* Padding for future expansion */
  void (*_starred_reserved1) (void);
  void (*_starred_reserved2) (void);
  void (*_starred_reserved3) (void);
  void (*_starred_reserved4) (void);
  void (*_starred_reserved5) (void);
};

Virtual methods of the StarredCellRendererRating class.

GtkCellRendererClass parent_class;

Virtual methods of the super class.

edited ()

Virtual method of the "edited" signal

_starred_reserved1 ()

(skip) Padding for future expansion

_starred_reserved2 ()

(skip) Padding for future expansion

_starred_reserved3 ()

(skip) Padding for future expansion

_starred_reserved4 ()

(skip) Padding for future expansion

_starred_reserved5 ()

(skip) Padding for future expansion

starred_cell_renderer_rating_new ()

GtkCellRenderer *   starred_cell_renderer_rating_new    (void);

Creates a new StarredCellRendererRating instance. Its default properties represent an immutable five-star rating.

Returns :

The newly allocated cell renderer.

Property Details

The "black-char" property

  "black-char"               guint                 : Read / Write

The character to use for assigned stars.

Default value: 0


The "black-icon-name" property

  "black-icon-name"          gchar*                : Read / Write

The icon to use for assigned stars.

Default value: NULL


The "editable" property

  "editable"                 gboolean              : Read / Write

Whether the rating can be modified by the user.

Default value: FALSE


The "icon-size" property

  "icon-size"                GtkIconSize           : Read / Write

Size of star icons.

Default value: GTK_ICON_SIZE_MENU


The "max-rating" property

  "max-rating"               gint                  : Read / Write

Maximum rating in stars.

Allowed values: >= 1

Default value: 5


The "min-rating" property

  "min-rating"               gint                  : Read / Write

Minimum rating in stars.

Allowed values: [0,1]

Default value: 0


The "rating" property

  "rating"                   gint                  : Read / Write

Rating in stars.

Allowed values: >= 0

Default value: 0


The "white-char" property

  "white-char"               guint                 : Read / Write

The character to use for missing stars.

Default value: 0


The "white-icon-name" property

  "white-icon-name"          gchar*                : Read / Write

The icon to use for missing stars.

Default value: NULL

Signal Details

The "edited" signal

void                user_function                      (StarredCellRendererRating *renderer,
                                                        gchar                     *path,
                                                        gint                       new_rating,
                                                        gpointer                   user_data)       : Run Last

This signal is emitted after renderer has been edited.

It is the responsibility of the application to update the model and store new_rating at the position indicated by path.

renderer :

the object which received the signal

path :

the path identifying the edited cell

new_rating :

the new rating

user_data :

user data set when the signal handler was connected.