2 * This file is part of gtkD.
4 * gtkD is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; either version 2.1 of the License, or
7 * (at your option) any later version.
9 * gtkD is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with gtkD; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = GtkLabel.html
45 * - gtk_label_new_with_mnemonic
50 * - GtkWidget* -> Widget
61 import tango
.io
.Stdout
; // use the tango loging?
65 private import gtkc
.gtktypes
;
67 private import gtkc
.gtk
;
70 private import glib
.Str
;
71 private import gtk
.Widget
;
78 * The GtkLabel widget displays a small amount of text. As the name
79 * implies, most labels are used to label another widget such as a
80 * GtkButton, a GtkMenuItem, or a GtkOptionMenu.
82 * Labels may contain mnemonics. Mnemonics are
83 * underlined characters in the label, used for keyboard navigation.
84 * Mnemonics are created by providing a string with an underscore before
85 * the mnemonic character, such as "_File", to the
86 * functions gtk_label_new_with_mnemonic() or
87 * gtk_label_set_text_with_mnemonic().
88 * Mnemonics automatically activate any activatable widget the label is
89 * inside, such as a GtkButton; if the label is not inside the
90 * mnemonic's target widget, you have to tell the label about the target
91 * using gtk_label_set_mnemonic_widget(). Here's a simple example where
92 * the label is inside a button:
93 * /+* Pressing Alt+H will activate this button +/
94 * button = gtk_button_new ();
95 * label = gtk_label_new_with_mnemonic ("_Hello");
96 * gtk_container_add (GTK_CONTAINER (button), label);
97 * There's a convenience function to create buttons with a mnemonic label
99 * /+* Pressing Alt+H will activate this button +/
100 * button = gtk_button_new_with_mnemonic ("_Hello");
101 * To create a mnemonic for a widget alongside the label, such as a
102 * GtkEntry, you have to point the label at the entry with
103 * gtk_label_set_mnemonic_widget():
104 * /+* Pressing Alt+H will focus the entry +/
105 * entry = gtk_entry_new ();
106 * label = gtk_label_new_with_mnemonic ("_Hello");
107 * gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
109 * Markup (styled text)
110 * To make it easy to format text in a label (changing colors, fonts,
111 * etc.), label text can be provided in a simple markup format.
112 * Here's how to create a label with a small font:
113 * label = gtk_label_new (NULL);
114 * gtk_label_set_markup (GTK_LABEL (label), "<small>Small text</small>");
115 * (See complete documentation of available
116 * tags in the Pango manual.)
117 * The markup passed to gtk_label_set_markup() must be valid; for example,
118 * literal </>/ characters must be escaped as lt;,
119 * gt;, and amp;. If you pass text obtained from the user, file,
120 * or a network to gtk_label_set_markup(), you'll want to escape it with
121 * g_markup_escape_text() or g_markup_printf_escaped().
122 * Markup strings are just a convenient way to set the PangoAttrList on
123 * a label; gtk_label_set_attributes() may be a simpler way to set
124 * attributes in some cases. Be careful though; PangoAttrList tends to
125 * cause internationalization problems, unless you're applying attributes
126 * to the entire string (i.e. unless you set the range of each attribute
127 * to [0, G_MAXINT)). The reason is that specifying the start_index and
128 * end_index for a PangoAttribute requires knowledge of the exact string
129 * being displayed, so translations will cause problems.
132 * Labels can be made selectable with gtk_label_set_selectable().
133 * Selectable labels allow the user to copy the label contents to
134 * the clipboard. Only labels that contain useful-to-copy information
135 * such as error messages should be made selectable.
138 * A label can contain any number of paragraphs, but will have
139 * performance problems if it contains more than a small number.
140 * Paragraphs are separated by newlines or other paragraph separators
141 * understood by Pango.
142 * Labels can automatically wrap text if you call
143 * gtk_label_set_line_wrap().
144 * gtk_label_set_justify() sets how the lines in a label align
145 * with one another. If you want to set how the label as a whole
146 * aligns in its available space, see gtk_misc_set_alignment().
148 private import gtk
.Misc
;
149 public class Label
: Misc
152 /** the main Gtk struct */
153 protected GtkLabel
* gtkLabel
;
156 public GtkLabel
* getLabelStruct()
162 /** the main Gtk struct as a void* */
163 protected void* getStruct()
165 return cast(void*)gtkLabel
;
169 * Sets our main struct and passes it to the parent class
171 public this (GtkLabel
* gtkLabel
)
175 if ( gtkLabel
is null )
180 Stdout("struct gtkLabel is null on constructor").newline
;
184 printf("struct gtkLabel is null on constructor");
191 assert(gtkLabel
!is null, "struct gtkLabel is null on constructor");
193 super(cast(GtkMisc
*)gtkLabel
);
194 this.gtkLabel
= gtkLabel
;
198 * Creates a new GtkLabel, containing the text in str.
199 * If characters in str are preceded by an underscore, they are
200 * underlined. If you need a literal underscore character in a label, use
201 * '__' (two underscores). The first underlined character represents a
202 * keyboard accelerator called a mnemonic. The mnemonic key can be used
203 * to activate another widget, chosen automatically, or explicitly using
204 * gtk_label_set_mnemonic_widget().
205 * If gtk_label_set_mnemonic_widget()
206 * is not called, then the first activatable ancestor of the GtkLabel
207 * will be chosen as the mnemonic widget. For instance, if the
208 * label is inside a button or menu item, the button or menu item will
209 * automatically become the mnemonic widget and be activated by
212 * The text of the label, with an underscore in front of the
214 * mnemonic: when false uses the literal text passed in without mnemonic
218 public this (char[] str, bool mnemonic
=true)
222 // GtkWidget* gtk_label_new_with_mnemonic (const gchar *str);
223 this(cast(GtkLabel
*)gtk_label_new_with_mnemonic(Str
.toStringz(str)) );
227 // GtkWidget* gtk_label_new (const gchar *str);
228 this(cast(GtkLabel
*)gtk_label_new(Str
.toStringz(str)) );
235 // imports for the signal processing
236 private import gobject
.Signals
;
237 private import gtkc
.gdktypes
;
238 int[char[]] connectedSignals
;
240 void delegate(Label
)[] onCopyClipboardListeners
;
241 void addOnCopyClipboard(void delegate(Label
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
243 if ( !("copy-clipboard" in connectedSignals
) )
248 cast(GCallback
)&callBackCopyClipboard
,
252 connectedSignals
["copy-clipboard"] = 1;
254 onCopyClipboardListeners
~= dlg
;
256 extern(C
) static void callBackCopyClipboard(GtkLabel
* labelStruct
, Label label
)
258 bool consumed
= false;
260 foreach ( void delegate(Label
) dlg
; label
.onCopyClipboardListeners
)
268 void delegate(GtkMovementStep
, gint
, gboolean
, Label
)[] onMoveCursorListeners
;
269 void addOnMoveCursor(void delegate(GtkMovementStep
, gint
, gboolean
, Label
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
271 if ( !("move-cursor" in connectedSignals
) )
276 cast(GCallback
)&callBackMoveCursor
,
280 connectedSignals
["move-cursor"] = 1;
282 onMoveCursorListeners
~= dlg
;
284 extern(C
) static void callBackMoveCursor(GtkLabel
* labelStruct
, GtkMovementStep arg1
, gint arg2
, gboolean arg3
, Label label
)
286 bool consumed
= false;
288 foreach ( void delegate(GtkMovementStep
, gint
, gboolean
, Label
) dlg
; label
.onMoveCursorListeners
)
290 dlg(arg1
, arg2
, arg3
, label
);
296 void delegate(GtkMenu
*, Label
)[] onPopulatePopupListeners
;
297 void addOnPopulatePopup(void delegate(GtkMenu
*, Label
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
299 if ( !("populate-popup" in connectedSignals
) )
304 cast(GCallback
)&callBackPopulatePopup
,
308 connectedSignals
["populate-popup"] = 1;
310 onPopulatePopupListeners
~= dlg
;
312 extern(C
) static void callBackPopulatePopup(GtkLabel
* labelStruct
, GtkMenu
* arg1
, Label label
)
314 bool consumed
= false;
316 foreach ( void delegate(GtkMenu
*, Label
) dlg
; label
.onPopulatePopupListeners
)
328 * Sets the text within the GtkLabel widget. It overwrites any text that
330 * This will also clear any previously set mnemonic accelerators.
334 * The text you want to set.
336 public void setText(char[] str)
338 // void gtk_label_set_text (GtkLabel *label, const gchar *str);
339 gtk_label_set_text(gtkLabel
, Str
.toStringz(str));
343 * Sets a PangoAttrList; the attributes in the list are applied to the
344 * label text. The attributes set with this function will be ignored
345 * if the "use_underline" property or the "use_markup" property
352 public void setAttributes(PangoAttrList
* attrs
)
354 // void gtk_label_set_attributes (GtkLabel *label, PangoAttrList *attrs);
355 gtk_label_set_attributes(gtkLabel
, attrs
);
359 * Parses str which is marked up with the Pango text markup language, setting the
360 * label's text and attribute list based on the parse results. If the str is
361 * external data, you may need to escape it with g_markup_escape_text() or
362 * g_markup_printf_escaped():
364 * markup = g_markup_printf_escaped ("<span style=\"italic\">%s</span>", str);
365 * gtk_label_set_markup (GTK_LABEL (label), markup);
370 * a markup string (see Pango markup format)
372 public void setMarkup(char[] str)
374 // void gtk_label_set_markup (GtkLabel *label, const gchar *str);
375 gtk_label_set_markup(gtkLabel
, Str
.toStringz(str));
379 * Parses str which is marked up with the Pango text markup language,
380 * setting the label's text and attribute list based on the parse results.
381 * If characters in str are preceded by an underscore, they are underlined
382 * indicating that they represent a keyboard accelerator called a mnemonic.
383 * The mnemonic key can be used to activate another widget, chosen automatically,
384 * or explicitly using gtk_label_set_mnemonic_widget().
388 * a markup string (see Pango markup format)
390 public void setMarkupWithMnemonic(char[] str)
392 // void gtk_label_set_markup_with_mnemonic (GtkLabel *label, const gchar *str);
393 gtk_label_set_markup_with_mnemonic(gtkLabel
, Str
.toStringz(str));
397 * The pattern of underlines you want under the existing text within the
398 * GtkLabel widget. For example if the current text of the label says
399 * "FooBarBaz" passing a pattern of "___ ___" will underline
400 * "Foo" and "Baz" but not "Bar".
402 * The GtkLabel you want to set the pattern to.
404 * The pattern as described above.
406 public void setPattern(char[] pattern
)
408 // void gtk_label_set_pattern (GtkLabel *label, const gchar *pattern);
409 gtk_label_set_pattern(gtkLabel
, Str
.toStringz(pattern
));
413 * Sets the alignment of the lines in the text of the label relative to
414 * each other. GTK_JUSTIFY_LEFT is the default value when the
415 * widget is first created with gtk_label_new(). If you instead want
416 * to set the alignment of the label as a whole, use
417 * gtk_misc_set_alignment() instead. gtk_label_set_justify() has no
418 * effect on labels containing only a single line.
424 public void setJustify(GtkJustification jtype
)
426 // void gtk_label_set_justify (GtkLabel *label, GtkJustification jtype);
427 gtk_label_set_justify(gtkLabel
, jtype
);
431 * Sets the mode used to ellipsize (add an ellipsis: "...") to the text if there
432 * is not enough space to render the entire string.
436 * a PangoEllipsizeMode
439 public void setEllipsize(PangoEllipsizeMode mode
)
441 // void gtk_label_set_ellipsize (GtkLabel *label, PangoEllipsizeMode mode);
442 gtk_label_set_ellipsize(gtkLabel
, mode
);
446 * Sets the desired width in characters of label to n_chars.
450 * the new desired width, in characters.
453 public void setWidthChars(int nChars
)
455 // void gtk_label_set_width_chars (GtkLabel *label, gint n_chars);
456 gtk_label_set_width_chars(gtkLabel
, nChars
);
460 * Sets the desired maximum width in characters of label to n_chars.
464 * the new desired maximum width, in characters.
467 public void setMaxWidthChars(int nChars
)
469 // void gtk_label_set_max_width_chars (GtkLabel *label, gint n_chars);
470 gtk_label_set_max_width_chars(gtkLabel
, nChars
);
475 * gtk_label_get is deprecated and should not be used in newly-written code.
476 * Gets the current string of text within the GtkLabel and writes it to
477 * the given str argument. It does not make a copy of this string so you
478 * must not write to it.
480 * The GtkLabel widget you want to get the text from.
482 * The reference to the pointer you want to point to the text.
484 public void get(char** str)
486 // void gtk_label_get (GtkLabel *label, gchar **str);
487 gtk_label_get(gtkLabel
, str);
492 * gtk_label_parse_uline is deprecated and should not be used in newly-written code.
493 * Parses the given string for underscores and converts the next
494 * character to an underlined character. The last character that
495 * was underlined will have its lower-cased accelerator keyval returned (i.e.
496 * "_File" would return the keyval for "f". This is
497 * probably only used within the Gtk+ library itself for menu items and such.
499 * The GtkLabel you want to affect.
501 * The string you want to parse for underlines.
503 * The lowercase keyval of the last character underlined.
505 public uint parseUline(char[] string
)
507 // guint gtk_label_parse_uline (GtkLabel *label, const gchar *string);
508 return gtk_label_parse_uline(gtkLabel
, Str
.toStringz(string
));
512 * Toggles line wrapping within the GtkLabel widget. TRUE makes it break
513 * lines if text exceeds the widget's size. FALSE lets the text get cut off
514 * by the edge of the widget if it exceeds the widget size.
515 * Note that setting line wrapping to TRUE does not make the label
516 * wrap at its parent container's width, because GTK+ widgets
517 * conceptually can't make their requisition depend on the parent
518 * container's size. For a label that wraps at a specific position,
519 * set the label's width using gtk_widget_set_size_request().
525 public void setLineWrap(int wrap
)
527 // void gtk_label_set_line_wrap (GtkLabel *label, gboolean wrap);
528 gtk_label_set_line_wrap(gtkLabel
, wrap
);
532 * If line wrapping is on (see gtk_label_set_line_wrap()) this controls how
533 * the line wrapping is done. The default is PANGO_WRAP_WORD which means
534 * wrap on word boundaries.
538 * the line wrapping mode
541 public void setLineWrapMode(PangoWrapMode wrapMode
)
543 // void gtk_label_set_line_wrap_mode (GtkLabel *label, PangoWrapMode wrap_mode);
544 gtk_label_set_line_wrap_mode(gtkLabel
, wrapMode
);
549 * Obtains the coordinates where the label will draw the PangoLayout
550 * representing the text in the label; useful to convert mouse events
551 * into coordinates inside the PangoLayout, e.g. to take some action
552 * if some part of the label is clicked. Of course you will need to
553 * create a GtkEventBox to receive the events, and pack the label
554 * inside it, since labels are a GTK_NO_WINDOW widget. Remember
555 * when using the PangoLayout functions you need to convert to
556 * and from pixels using PANGO_PIXELS() or PANGO_SCALE.
560 * location to store X offset of layout, or NULL
562 * location to store Y offset of layout, or NULL
564 public void getLayoutOffsets(int* x
, int* y
)
566 // void gtk_label_get_layout_offsets (GtkLabel *label, gint *x, gint *y);
567 gtk_label_get_layout_offsets(gtkLabel
, x
, y
);
571 * If the label has been set so that it has an mnemonic key this function
572 * returns the keyval used for the mnemonic accelerator. If there is no
573 * mnemonic set up it returns GDK_VoidSymbol.
577 * GDK keyval usable for accelerators, or GDK_VoidSymbol
579 public uint getMnemonicKeyval()
581 // guint gtk_label_get_mnemonic_keyval (GtkLabel *label);
582 return gtk_label_get_mnemonic_keyval(gtkLabel
);
586 * Gets the value set by gtk_label_set_selectable().
590 * TRUE if the user can copy text from the label
592 public int getSelectable()
594 // gboolean gtk_label_get_selectable (GtkLabel *label);
595 return gtk_label_get_selectable(gtkLabel
);
599 * Fetches the text from a label widget, as displayed on the
600 * screen. This does not include any embedded underlines
601 * indicating mnemonics or Pango markup. (See gtk_label_get_label())
605 * the text in the label widget. This is the internal
606 * string used by the label, and must not be modified.
608 public char[] getText()
610 // const gchar* gtk_label_get_text (GtkLabel *label);
611 return Str
.toString(gtk_label_get_text(gtkLabel
) );
616 * Selects a range of characters in the label, if the label is selectable.
617 * See gtk_label_set_selectable(). If the label is not selectable,
618 * this function has no effect. If start_offset or
619 * end_offset are -1, then the end of the label will be substituted.
623 * start offset (in characters not bytes)
625 * end offset (in characters not bytes)
627 public void selectRegion(int startOffset
, int endOffset
)
629 // void gtk_label_select_region (GtkLabel *label, gint start_offset, gint end_offset);
630 gtk_label_select_region(gtkLabel
, startOffset
, endOffset
);
634 * If the label has been set so that it has an mnemonic key (using
635 * i.e. gtk_label_set_markup_with_mnemonic(),
636 * gtk_label_set_text_with_mnemonic(), gtk_label_new_with_mnemonic()
637 * or the "use_underline" property) the label can be associated with a
638 * widget that is the target of the mnemonic. When the label is inside
639 * a widget (like a GtkButton or a GtkNotebook tab) it is
640 * automatically associated with the correct widget, but sometimes
641 * (i.e. when the target is a GtkEntry next to the label) you need to
642 * set it explicitly using this function.
643 * The target widget will be accelerated by emitting "mnemonic_activate" on it.
644 * The default handler for this signal will activate the widget if there are no
645 * mnemonic collisions and toggle focus between the colliding widgets otherwise.
649 * the target GtkWidget
651 public void setMnemonicWidget(Widget widget
)
653 // void gtk_label_set_mnemonic_widget (GtkLabel *label, GtkWidget *widget);
654 gtk_label_set_mnemonic_widget(gtkLabel
, (widget
is null) ?
null : widget
.getWidgetStruct());
658 * Selectable labels allow the user to select text from the label, for
663 * TRUE to allow selecting text in the label
665 public void setSelectable(int setting
)
667 // void gtk_label_set_selectable (GtkLabel *label, gboolean setting);
668 gtk_label_set_selectable(gtkLabel
, setting
);
672 * Sets the label's text from the string str.
673 * If characters in str are preceded by an underscore, they are underlined
674 * indicating that they represent a keyboard accelerator called a mnemonic.
675 * The mnemonic key can be used to activate another widget, chosen automatically,
676 * or explicitly using gtk_label_set_mnemonic_widget().
682 public void setTextWithMnemonic(char[] str)
684 // void gtk_label_set_text_with_mnemonic (GtkLabel *label, const gchar *str);
685 gtk_label_set_text_with_mnemonic(gtkLabel
, Str
.toStringz(str));
689 * Gets the attribute list that was set on the label using
690 * gtk_label_set_attributes(), if any. This function does
691 * not reflect attributes that come from the labels markup
692 * (see gtk_label_set_markup()). If you want to get the
693 * effective attributes for the label, use
694 * pango_layout_get_attribute (gtk_label_get_layout (label)).
698 * the attribute list, or NULL if none was set.
700 public PangoAttrList
* getAttributes()
702 // PangoAttrList* gtk_label_get_attributes (GtkLabel *label);
703 return gtk_label_get_attributes(gtkLabel
);
707 * Returns the justification of the label. See gtk_label_set_justify().
713 public GtkJustification
getJustify()
715 // GtkJustification gtk_label_get_justify (GtkLabel *label);
716 return gtk_label_get_justify(gtkLabel
);
720 * Returns the ellipsizing position of the label. See gtk_label_set_ellipsize().
727 public PangoEllipsizeMode
getEllipsize()
729 // PangoEllipsizeMode gtk_label_get_ellipsize (GtkLabel *label);
730 return gtk_label_get_ellipsize(gtkLabel
);
734 * Retrieves the desired width of label, in characters. See
735 * gtk_label_set_width_chars().
739 * the width of the label in characters.
742 public int getWidthChars()
744 // gint gtk_label_get_width_chars (GtkLabel *label);
745 return gtk_label_get_width_chars(gtkLabel
);
749 * Retrieves the desired maximum width of label, in characters. See
750 * gtk_label_set_width_chars().
754 * the maximum width of the label in characters.
757 public int getMaxWidthChars()
759 // gint gtk_label_get_max_width_chars (GtkLabel *label);
760 return gtk_label_get_max_width_chars(gtkLabel
);
764 * Fetches the text from a label widget including any embedded
765 * underlines indicating mnemonics and Pango markup. (See
766 * gtk_label_get_text()).
770 * the text of the label widget. This string is
771 * owned by the widget and must not be modified or freed.
773 public char[] getLabel()
775 // const gchar* gtk_label_get_label (GtkLabel *label);
776 return Str
.toString(gtk_label_get_label(gtkLabel
) );
780 * Gets the PangoLayout used to display the label.
781 * The layout is useful to e.g. convert text positions to
782 * pixel positions, in combination with gtk_label_get_layout_offsets().
783 * The returned layout is owned by the label so need not be
784 * freed by the caller.
788 * the PangoLayout for this label
790 public PangoLayout
* getLayout()
792 // PangoLayout* gtk_label_get_layout (GtkLabel *label);
793 return gtk_label_get_layout(gtkLabel
);
797 * Returns whether lines in the label are automatically wrapped. See gtk_label_set_line_wrap().
801 * TRUE if the lines of the label are automatically wrapped.
803 public int getLineWrap()
805 // gboolean gtk_label_get_line_wrap (GtkLabel *label);
806 return gtk_label_get_line_wrap(gtkLabel
);
810 * Returns line wrap mode used by the label. See gtk_label_set_line_wrap_mode().
814 * TRUE if the lines of the label are automatically wrapped.
817 public PangoWrapMode
getLineWrapMode()
819 // PangoWrapMode gtk_label_get_line_wrap_mode (GtkLabel *label);
820 return gtk_label_get_line_wrap_mode(gtkLabel
);
824 * Retrieves the target of the mnemonic (keyboard shortcut) of this
825 * label. See gtk_label_set_mnemonic_widget().
829 * the target of the label's mnemonic, or NULL if none
830 * has been set and the default algorithm will be used.
832 public Widget
getMnemonicWidget()
834 // GtkWidget* gtk_label_get_mnemonic_widget (GtkLabel *label);
835 return new Widget( gtk_label_get_mnemonic_widget(gtkLabel
) );
839 * Gets the selected range of characters in the label, returning TRUE
840 * if there's a selection.
844 * return location for start of selection, as a character offset
846 * return location for end of selection, as a character offset
848 * TRUE if selection is non-empty
850 public int getSelectionBounds(int* start
, int* end
)
852 // gboolean gtk_label_get_selection_bounds (GtkLabel *label, gint *start, gint *end);
853 return gtk_label_get_selection_bounds(gtkLabel
, start
, end
);
857 * Returns whether the label's text is interpreted as marked up with
858 * the Pango text markup
859 * language. See gtk_label_set_use_markup().
863 * TRUE if the label's text will be parsed for markup.
865 public int getUseMarkup()
867 // gboolean gtk_label_get_use_markup (GtkLabel *label);
868 return gtk_label_get_use_markup(gtkLabel
);
872 * Returns whether an embedded underline in the label indicates a
873 * mnemonic. See gtk_label_set_use_underline().
877 * TRUE whether an embedded underline in the label indicates
878 * the mnemonic accelerator keys.
880 public int getUseUnderline()
882 // gboolean gtk_label_get_use_underline (GtkLabel *label);
883 return gtk_label_get_use_underline(gtkLabel
);
887 * Returns whether the label is in single line mode.
891 * TRUE when the label is in single line mode.
894 public int getSingleLineMode()
896 // gboolean gtk_label_get_single_line_mode (GtkLabel *label);
897 return gtk_label_get_single_line_mode(gtkLabel
);
901 * Gets the angle of rotation for the label. See
902 * gtk_label_set_angle.
906 * the angle of rotation for the label
909 public double getAngle()
911 // gdouble gtk_label_get_angle (GtkLabel *label);
912 return gtk_label_get_angle(gtkLabel
);
916 * Sets the text of the label. The label is interpreted as
917 * including embedded underlines and/or Pango markup depending
918 * on the values of label->use_underline and label->use_markup.
922 * the new text to set for the label
924 public void setLabel(char[] str)
926 // void gtk_label_set_label (GtkLabel *label, const gchar *str);
927 gtk_label_set_label(gtkLabel
, Str
.toStringz(str));
931 * Sets whether the text of the label contains markup in Pango's text markup
932 * language. See gtk_label_set_markup().
936 * TRUE if the label's text should be parsed for markup.
938 public void setUseMarkup(int setting
)
940 // void gtk_label_set_use_markup (GtkLabel *label, gboolean setting);
941 gtk_label_set_use_markup(gtkLabel
, setting
);
945 * If true, an underline in the text indicates the next character should be
946 * used for the mnemonic accelerator key.
950 * TRUE if underlines in the text indicate mnemonics
952 public void setUseUnderline(int setting
)
954 // void gtk_label_set_use_underline (GtkLabel *label, gboolean setting);
955 gtk_label_set_use_underline(gtkLabel
, setting
);
959 * Sets whether the label is in single line mode.
963 * TRUE if the label should be in single line mode
966 public void setSingleLineMode(int singleLineMode
)
968 // void gtk_label_set_single_line_mode (GtkLabel *label, gboolean single_line_mode);
969 gtk_label_set_single_line_mode(gtkLabel
, singleLineMode
);
973 * Sets the angle of rotation for the label. An angle of 90 reads from
974 * from bottom to top, an angle of 270, from top to bottom. The angle
975 * setting for the label is ignored if the label is selectable,
976 * wrapped, or ellipsized.
980 * the angle that the baseline of the label makes with
981 * the horizontal, in degrees, measured counterclockwise
984 * The "angle" property
985 * "angle" gdouble : Read / Write
986 * The angle that the baseline of the label makes with the horizontal,
987 * in degrees, measured counterclockwise. An angle of 90 reads from
988 * from bottom to top, an angle of 270, from top to bottom. Ignored
989 * if the label is selectable, wrapped, or ellipsized.
990 * Allowed values: [0,360]
994 public void setAngle(double angle
)
996 // void gtk_label_set_angle (GtkLabel *label, gdouble angle);
997 gtk_label_set_angle(gtkLabel
, angle
);