ExoEllipsizedLabel

ExoEllipsizedLabel — A widget that automatically ellipsizes text

Synopsis


#include <exo/exo.h>


struct      ExoEllipsizedLabel;
GtkWidget*  exo_ellipsized_label_new        (const gchar *text);
ExoPangoEllipsizeMode exo_ellipsized_label_get_ellipsize
                                            (ExoEllipsizedLabel *label);
void        exo_ellipsized_label_set_ellipsize
                                            (ExoEllipsizedLabel *label,
                                             ExoPangoEllipsizeMode mode);


Object Hierarchy


  GObject
   +----GtkObject
         +----GtkWidget
               +----GtkMisc
                     +----GtkLabel
                           +----ExoEllipsizedLabel

Implemented Interfaces

ExoEllipsizedLabel implements AtkImplementorIface.

Properties


  "ellipsize"            ExoPangoEllipsizeMode : Read / Write

Description

ExoEllipsizedLabel extends the standard GtkLabel class present in Gtk+ 2.4 with the ability to automatically ellipsize text with "...".

ExoEllipsizedLabel automatically detects if its running with Gtk+ 2.5 or above and uses the native ellipsizing support of Gtk+ 2.5 or above in that case. So its safe to use ExoEllipsizedLabel with every Gtk+ version above 2.4.

Details

struct ExoEllipsizedLabel

struct ExoEllipsizedLabel;


exo_ellipsized_label_new ()

GtkWidget*  exo_ellipsized_label_new        (const gchar *text);

Creates a new ExoEllipsizedLabel with the given text inside it. You can pass NULL to get an empty label widget.

text : The text of the label.
Returns : The new ExoEllipsizedLabel.

exo_ellipsized_label_get_ellipsize ()

ExoPangoEllipsizeMode exo_ellipsized_label_get_ellipsize
                                            (ExoEllipsizedLabel *label);

Returns the ellipsizing position of the label. See exo_ellipsized_label_set_ellipsize().

label : An ExoEllipsizedLabel.
Returns : An ExoPangoEllipsizeMode.

exo_ellipsized_label_set_ellipsize ()

void        exo_ellipsized_label_set_ellipsize
                                            (ExoEllipsizedLabel *label,
                                             ExoPangoEllipsizeMode mode);

Sets the mode used to ellipsize (add an ellipsis: "...") to the text if there is not enough space to render the entire string.

label : An ExoEllipsizedLabel.
mode :

Properties

"ellipsize" (ExoPangoEllipsizeMode : Read / Write)

The preferred place to ellipsize the string, if the label does not have enough room to display the entire string, specified as a ExoPangoEllisizeMode.

Note that setting this property to a value other than EXO_PANGO_ELLIPSIZE_NONE has the side-effect that the label requests only enough space to display the ellipsis "...". Ellipsizing labels must be packed in a container which ensures that the label gets a reasonable size allocated. In particular, this means that ellipsizing labels don't work well in notebook tabs, unless the tab's ::tab-expand property is set to TRUE.

See Also

GtkLabel, Exo Pango Extensions