![]() |
![]() |
A simple setable widget for holding a Glib::ustring.
Public Member Functions | |
virtual | ~Label () |
GtkLabel* | gobj () |
Provides access to the underlying C GtkObject. | |
const GtkLabel* | gobj () const |
Provides access to the underlying C GtkObject. | |
Label () | |
Label (const Glib::ustring& label, bool mnemonic=false) | |
Label (const Glib::ustring& label, float xalign, float yalign, bool mnemonic=false) | |
This constructor is a shortcut for often used code when you want to create a label with alignment different than default one. | |
Label (const Glib::ustring& label, AlignmentEnum xalign, AlignmentEnum yalign=ALIGN_CENTER, bool mnemonic=false) | |
This constructor is a shortcut for often used code when you want to create a label with alignment different than default one. | |
void | set_text (const Glib::ustring& str) |
Sets the text within the Gtk::Label widget. | |
Glib::ustring | get_text () const |
Fetches the text from a label widget, as displayed on the screen. | |
void | set_attributes (Pango::AttrList& attrs) |
Sets a Pango::AttrList; the attributes in the list are applied to the label text. | |
Pango::AttrList | get_attributes () |
Gets the attribute list that was set on the label using set_attributes(), if any. | |
void | set_label (const Glib::ustring& str) |
Sets the text of the label. | |
Glib::ustring | get_label () const |
Fetches the text from a label widget including any embedded underlines indicating mnemonics and Pango markup. | |
void | set_markup (const Glib::ustring& str) |
Parses str which is marked up with the Pango text markup language, setting the label's text and attribute list based on the parse results. | |
void | set_use_markup (bool setting=true) |
Sets whether the text of the label contains markup in Pango's text markup language. | |
bool | get_use_markup () const |
Returns whether the label's text is interpreted as marked up with the Pango text markup language. | |
void | set_use_underline (bool setting=true) |
If true, an underline in the text indicates the next character should be used for the mnemonic accelerator key. | |
bool | get_use_underline () const |
Returns whether an embedded underline in the label indicates a mnemonic. | |
void | set_markup_with_mnemonic (const Glib::ustring& str) |
Parses str which is marked up with the Pango text markup language, setting the label's text and attribute list based on the parse results. | |
guint | get_mnemonic_keyval () const |
If the label has been set so that it has an mnemonic key this function returns the keyval used for the mnemonic accelerator. | |
void | set_mnemonic_widget (Widget& widget) |
If the label has been set so that it has an mnemonic key (using i.e. set_markup_with_mnemonic(), set_text_with_mnemonic(), new_with_mnemonic() or the "use_underline" property) the label can be associated with a widget that is the target of the mnemonic. | |
Widget* | get_mnemonic_widget () |
Retrieves the target of the mnemonic (keyboard shortcut) of this label. | |
const Widget* | get_mnemonic_widget () const |
Retrieves the target of the mnemonic (keyboard shortcut) of this label. | |
void | set_text_with_mnemonic (const Glib::ustring& str) |
Sets the label's text from the string str . | |
void | set_justify (Justification jtype) |
Sets the alignment of the lines in the text of the label relative to each other. | |
Justification | get_justify () const |
Returns the justification of the label. | |
void | set_pattern (const Glib::ustring& pattern) |
void | set_line_wrap (bool wrap=true) |
Toggles line wrapping within the Gtk::Label widget. | |
bool | get_line_wrap () const |
Returns whether lines in the label are automatically wrapped. | |
void | set_selectable (bool setting=true) |
Selectable labels allow the user to select text from the label, for copy-and-paste. | |
bool | get_selectable () const |
Gets the value set by set_selectable(). | |
void | select_region (int start_offset, int end_offset) |
Selects a range of characters in the label, if the label is selectable. | |
bool | get_selection_bounds (int& start, int& end) const |
Gets the selected range of characters in the label, returning true if there's a selection. | |
Glib::RefPtr<Pango::Layout> | get_layout () |
Gets the Pango::Layout used to display the label. | |
Glib::RefPtr<const Pango::Layout> | get_layout () const |
Gets the Pango::Layout used to display the label. | |
void | get_layout_offsets (int& x, int& y) const |
Obtains the coordinates where the label will draw the Pango::Layout representing the text in the label; useful to convert mouse events into coordinates inside the Pango::Layout, e.g. to take some action if some part of the label is clicked. | |
Glib::SignalProxy3< void, MovementStep, int, bool > | signal_move_cursor () |
Glib::SignalProxy0<void> | signal_copy_clipboard () |
Glib::SignalProxy1< void, Menu* > | signal_populate_popup () |
Glib::PropertyProxy<Glib::ustring> | property_label () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<Pango::AttrList> | property_attributes () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<bool> | property_use_markup () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<bool> | property_use_underline () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<Justification> | property_justify () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_WriteOnly< Glib::ustring > | property_pattern () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<bool> | property_wrap () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<bool> | property_selectable () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly< guint > | property_mnemonic_keyval () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy<Widget*> | property_mnemonic_widget () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly< int > | property_cursor_position () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Glib::PropertyProxy_ReadOnly< int > | property_selection_bound () |
You rarely need to use properties because there are get_ and set_ methods for almost all of them. | |
Protected Member Functions | |
virtual void | on_move_cursor (MovementStep step, int count, bool extend_selection) |
virtual void | on_copy_clipboard () |
virtual void | on_populate_popup (Menu* menu) |
Related Functions | |
(Note that these are not member functions.) | |
Gtk::Label* | wrap (GtkLabel* object, bool take_copy=false) |
|
|
|
|
|
|
|
This constructor is a shortcut for often used code when you want to create a label with alignment different than default one.
Gtk::Label label(text, x, y, mnemonic); Gtk::Label label(text, mnemonic); label.set_alignment(x, y); |
|
This constructor is a shortcut for often used code when you want to create a label with alignment different than default one.
Gtk::Label label(text, x, y, mnemonic); Gtk::Label label(text, mnemonic); label.set_alignment(x, y); |
|
Gets the attribute list that was set on the label using set_attributes(), if any. This function does not reflect attributes that come from the labels markup (see set_markup()). If you want to get the effective attributes for the label, use pango_layout_get_attribute (gtk_label_get_layout (label)).
|
|
Returns the justification of the label. See set_justify().
|
|
Fetches the text from a label widget including any embedded underlines indicating mnemonics and Pango markup. (See get_text()).
|
|
Gets the Pango::Layout used to display the label. The layout is useful to e.g. convert text positions to pixel positions, in combination with get_layout_offsets().
|
|
Gets the Pango::Layout used to display the label. The layout is useful to e.g. convert text positions to pixel positions, in combination with get_layout_offsets().
|
|
Obtains the coordinates where the label will draw the Pango::Layout representing the text in the label; useful to convert mouse events into coordinates inside the Pango::Layout, e.g. to take some action if some part of the label is clicked. Of course you will need to create a Gtk::EventBox to receive the events, and pack the label inside it, since labels are a Gtk::NO_WINDOW widget. Remember when using the Pango::Layout functions you need to convert to and from pixels using PANGO_PIXELS() or Pango::SCALE.
|
|
Returns whether lines in the label are automatically wrapped. See set_line_wrap().
|
|
If the label has been set so that it has an mnemonic key this function returns the keyval used for the mnemonic accelerator. If there is no mnemonic set up it returns #GDK_VoidSymbol.
|
|
Retrieves the target of the mnemonic (keyboard shortcut) of this label.
|
|
Retrieves the target of the mnemonic (keyboard shortcut) of this label.
|
|
Gets the value set by set_selectable().
|
|
Gets the selected range of characters in the label, returning
|
|
Fetches the text from a label widget, as displayed on the screen. This does not include any embedded underlines indicating mnemonics or Pango markup. (See get_label())
|
|
Returns whether the label's text is interpreted as marked up with the Pango text markup language. See set_use_markup().
|
|
Returns whether an embedded underline in the label indicates a mnemonic. See set_use_underline().
|
|
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Misc. Reimplemented in Gtk::AccelLabel. |
|
Provides access to the underlying C GtkObject.
Reimplemented from Gtk::Misc. Reimplemented in Gtk::AccelLabel. |
|
|
|
|
|
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
Selects a range of characters in the label, if the label is selectable. See set_selectable(). If the label is not selectable, this function has no effect. If start_offset or end_offset are -1, then the end of the label will be substituted.
|
|
Sets a Pango::AttrList; the attributes in the list are applied to the label text.
The attributes set with this function will be ignored if the "use_underline" property or the "use_markup" property is
|
|
Sets the alignment of the lines in the text of the label relative to each other. Gtk::JUSTIFY_LEFT is the default value when the widget is first created with new(). If you instead want to set the alignment of the label as a whole, use Gtk::Misc::set_alignment() instead. set_justify() has no effect on labels containing only a single line.
|
|
Sets the text of the label. The label is interpreted as including embedded underlines and/or Pango markup depending on the values of label->use_underline and label->use_markup.
|
|
Toggles line wrapping within the Gtk::Label widget.
|
|
Parses str which is marked up with the Pango text markup language, setting the label's text and attribute list based on the parse results.
|
|
Parses str which is marked up with the Pango text markup language, setting the label's text and attribute list based on the parse results. If characters in str are preceded by an underscore, they are underlined indicating that they represent a keyboard accelerator called a mnemonic. The mnemonic key can be used to activate another widget, chosen automatically, or explicitly using set_mnemonic_widget().
|
|
If the label has been set so that it has an mnemonic key (using i.e. set_markup_with_mnemonic(), set_text_with_mnemonic(), new_with_mnemonic() or the "use_underline" property) the label can be associated with a widget that is the target of the mnemonic. When the label is inside a widget (like a Gtk::Button or a Gtk::Notebook tab) it is automatically associated with the correct widget, but sometimes (i.e. when the target is a Gtk::Entry next to the label) you need to set it explicitly using this function. The target widget will be accelerated by emitting "mnemonic_activate" on it. The default handler for this signal will activate the widget if there are no mnemonic collisions and toggle focus between the colliding widgets otherwise.
|
|
|
|
Selectable labels allow the user to select text from the label, for copy-and-paste.
|
|
Sets the text within the Gtk::Label widget. It overwrites any text that was there before. This will also clear any previously set mnemonic accelerators.
|
|
Sets the label's text from the string str . If characters in str are preceded by an underscore, they are underlined indicating that they represent a keyboard accelerator called a mnemonic. The mnemonic key can be used to activate another widget, chosen automatically, or explicitly using set_mnemonic_widget().
|
|
Sets whether the text of the label contains markup in Pango's text markup language. See set_markup().
|
|
If true, an underline in the text indicates the next character should be used for the mnemonic accelerator key.
|
|
|
|
|
|
|
|
|