label: Remove "line" from wrap properties

The property names are "wrap" and "wrap-mode", so it doesn't make sense
that the accessors refer to line_wrap and line_wrap_mode.
This commit is contained in:
Timm Bäder 2019-08-22 12:41:39 +02:00
parent 6c90d3a1b6
commit 4cc4868e93
18 changed files with 58 additions and 58 deletions

View File

@ -52,7 +52,7 @@ do_expander (GtkWidget *do_widget)
area = gtk_message_dialog_get_message_area (GTK_MESSAGE_DIALOG (window)); area = gtk_message_dialog_get_message_area (GTK_MESSAGE_DIALOG (window));
label = gtk_widget_get_last_child (area); label = gtk_widget_get_last_child (area);
gtk_label_set_line_wrap (GTK_LABEL (label), FALSE); gtk_label_set_wrap (GTK_LABEL (label), FALSE);
gtk_widget_set_vexpand (label, FALSE); gtk_widget_set_vexpand (label, FALSE);
expander = gtk_expander_new ("Details:"); expander = gtk_expander_new ("Details:");

View File

@ -124,7 +124,7 @@ create_label (void)
{ {
GtkWidget *w = gtk_label_new ("pLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua."); GtkWidget *w = gtk_label_new ("pLorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.");
gtk_label_set_line_wrap (GTK_LABEL (w), TRUE); gtk_label_set_wrap (GTK_LABEL (w), TRUE);
gtk_label_set_max_width_chars (GTK_LABEL (w), 100); gtk_label_set_max_width_chars (GTK_LABEL (w), 100);
return w; return w;

View File

@ -68,7 +68,7 @@ do_infobar (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (vbox), bar); gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_INFO); gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_INFO);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_INFO"); label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_INFO");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0); gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label); gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
@ -80,7 +80,7 @@ do_infobar (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (vbox), bar); gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_WARNING); gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_WARNING);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_WARNING"); label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_WARNING");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0); gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label); gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
@ -94,7 +94,7 @@ do_infobar (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (vbox), bar); gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_QUESTION); gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_QUESTION);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_QUESTION"); label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_QUESTION");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0); gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label); gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
@ -106,7 +106,7 @@ do_infobar (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (vbox), bar); gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_ERROR); gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_ERROR);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_ERROR"); label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_ERROR");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0); gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label); gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);
@ -119,7 +119,7 @@ do_infobar (GtkWidget *do_widget)
gtk_container_add (GTK_CONTAINER (vbox), bar); gtk_container_add (GTK_CONTAINER (vbox), bar);
gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_OTHER); gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_OTHER);
label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_OTHER"); label = gtk_label_new ("This is an info bar with message type GTK_MESSAGE_OTHER");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0); gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label); gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (bar))), label);

View File

@ -639,7 +639,7 @@ display_nothing (const char *resource)
str = g_strdup_printf ("The lazy GTK developers forgot to add a way to display the resource '%s'", resource); str = g_strdup_printf ("The lazy GTK developers forgot to add a way to display the resource '%s'", resource);
widget = gtk_label_new (str); widget = gtk_label_new (str);
gtk_label_set_line_wrap (GTK_LABEL (widget), TRUE); gtk_label_set_wrap (GTK_LABEL (widget), TRUE);
g_free (str); g_free (str);

View File

@ -1684,8 +1684,8 @@ gtk_label_set_yalign
gtk_label_set_ellipsize gtk_label_set_ellipsize
gtk_label_set_width_chars gtk_label_set_width_chars
gtk_label_set_max_width_chars gtk_label_set_max_width_chars
gtk_label_set_line_wrap gtk_label_set_wrap
gtk_label_set_line_wrap_mode gtk_label_set_wrap_mode
gtk_label_set_lines gtk_label_set_lines
gtk_label_get_layout_offsets gtk_label_get_layout_offsets
gtk_label_get_mnemonic_keyval gtk_label_get_mnemonic_keyval
@ -1705,8 +1705,8 @@ gtk_label_get_width_chars
gtk_label_get_max_width_chars gtk_label_get_max_width_chars
gtk_label_get_label gtk_label_get_label
gtk_label_get_layout gtk_label_get_layout
gtk_label_get_line_wrap gtk_label_get_wrap
gtk_label_get_line_wrap_mode gtk_label_get_wrap_mode
gtk_label_get_lines gtk_label_get_lines
gtk_label_get_mnemonic_widget gtk_label_get_mnemonic_widget
gtk_label_get_selection_bounds gtk_label_get_selection_bounds

View File

@ -163,7 +163,7 @@ init_sizing_box (GtkHeaderBar *bar)
context = gtk_widget_get_style_context (w); context = gtk_widget_get_style_context (w);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TITLE); gtk_style_context_add_class (context, GTK_STYLE_CLASS_TITLE);
gtk_container_add (GTK_CONTAINER (priv->label_sizing_box), w); gtk_container_add (GTK_CONTAINER (priv->label_sizing_box), w);
gtk_label_set_line_wrap (GTK_LABEL (w), FALSE); gtk_label_set_wrap (GTK_LABEL (w), FALSE);
gtk_label_set_single_line_mode (GTK_LABEL (w), TRUE); gtk_label_set_single_line_mode (GTK_LABEL (w), TRUE);
gtk_label_set_ellipsize (GTK_LABEL (w), PANGO_ELLIPSIZE_END); gtk_label_set_ellipsize (GTK_LABEL (w), PANGO_ELLIPSIZE_END);
gtk_label_set_width_chars (GTK_LABEL (w), MIN_TITLE_CHARS); gtk_label_set_width_chars (GTK_LABEL (w), MIN_TITLE_CHARS);
@ -172,7 +172,7 @@ init_sizing_box (GtkHeaderBar *bar)
context = gtk_widget_get_style_context (w); context = gtk_widget_get_style_context (w);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SUBTITLE); gtk_style_context_add_class (context, GTK_STYLE_CLASS_SUBTITLE);
gtk_container_add (GTK_CONTAINER (priv->label_sizing_box), w); gtk_container_add (GTK_CONTAINER (priv->label_sizing_box), w);
gtk_label_set_line_wrap (GTK_LABEL (w), FALSE); gtk_label_set_wrap (GTK_LABEL (w), FALSE);
gtk_label_set_single_line_mode (GTK_LABEL (w), TRUE); gtk_label_set_single_line_mode (GTK_LABEL (w), TRUE);
gtk_label_set_ellipsize (GTK_LABEL (w), PANGO_ELLIPSIZE_END); gtk_label_set_ellipsize (GTK_LABEL (w), PANGO_ELLIPSIZE_END);
gtk_widget_set_visible (w, priv->has_subtitle || (priv->subtitle && priv->subtitle[0])); gtk_widget_set_visible (w, priv->has_subtitle || (priv->subtitle && priv->subtitle[0]));
@ -196,7 +196,7 @@ create_title_box (const char *title,
title_label = gtk_label_new (title); title_label = gtk_label_new (title);
context = gtk_widget_get_style_context (title_label); context = gtk_widget_get_style_context (title_label);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TITLE); gtk_style_context_add_class (context, GTK_STYLE_CLASS_TITLE);
gtk_label_set_line_wrap (GTK_LABEL (title_label), FALSE); gtk_label_set_wrap (GTK_LABEL (title_label), FALSE);
gtk_label_set_single_line_mode (GTK_LABEL (title_label), TRUE); gtk_label_set_single_line_mode (GTK_LABEL (title_label), TRUE);
gtk_label_set_ellipsize (GTK_LABEL (title_label), PANGO_ELLIPSIZE_END); gtk_label_set_ellipsize (GTK_LABEL (title_label), PANGO_ELLIPSIZE_END);
gtk_container_add (GTK_CONTAINER (label_box), title_label); gtk_container_add (GTK_CONTAINER (label_box), title_label);
@ -205,7 +205,7 @@ create_title_box (const char *title,
subtitle_label = gtk_label_new (subtitle); subtitle_label = gtk_label_new (subtitle);
context = gtk_widget_get_style_context (subtitle_label); context = gtk_widget_get_style_context (subtitle_label);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SUBTITLE); gtk_style_context_add_class (context, GTK_STYLE_CLASS_SUBTITLE);
gtk_label_set_line_wrap (GTK_LABEL (subtitle_label), FALSE); gtk_label_set_wrap (GTK_LABEL (subtitle_label), FALSE);
gtk_label_set_single_line_mode (GTK_LABEL (subtitle_label), TRUE); gtk_label_set_single_line_mode (GTK_LABEL (subtitle_label), TRUE);
gtk_label_set_ellipsize (GTK_LABEL (subtitle_label), PANGO_ELLIPSIZE_END); gtk_label_set_ellipsize (GTK_LABEL (subtitle_label), PANGO_ELLIPSIZE_END);
gtk_container_add (GTK_CONTAINER (label_box), subtitle_label); gtk_container_add (GTK_CONTAINER (label_box), subtitle_label);

View File

@ -208,7 +208,7 @@
* understood by Pango. * understood by Pango.
* *
* Labels can automatically wrap text if you call * Labels can automatically wrap text if you call
* gtk_label_set_line_wrap(). * gtk_label_set_wrap().
* *
* gtk_label_set_justify() sets how the lines in a label align * gtk_label_set_justify() sets how the lines in a label align
* with one another. If you want to set how the label as a whole * with one another. If you want to set how the label as a whole
@ -1205,10 +1205,10 @@ gtk_label_set_property (GObject *object,
gtk_label_set_pattern (label, g_value_get_string (value)); gtk_label_set_pattern (label, g_value_get_string (value));
break; break;
case PROP_WRAP: case PROP_WRAP:
gtk_label_set_line_wrap (label, g_value_get_boolean (value)); gtk_label_set_wrap (label, g_value_get_boolean (value));
break; break;
case PROP_WRAP_MODE: case PROP_WRAP_MODE:
gtk_label_set_line_wrap_mode (label, g_value_get_enum (value)); gtk_label_set_wrap_mode (label, g_value_get_enum (value));
break; break;
case PROP_SELECTABLE: case PROP_SELECTABLE:
gtk_label_set_selectable (label, g_value_get_boolean (value)); gtk_label_set_selectable (label, g_value_get_boolean (value));
@ -3116,7 +3116,7 @@ gtk_label_get_max_width_chars (GtkLabel *label)
} }
/** /**
* gtk_label_set_line_wrap: * gtk_label_set_wrap:
* @label: a #GtkLabel * @label: a #GtkLabel
* @wrap: the setting * @wrap: the setting
* *
@ -3131,7 +3131,7 @@ gtk_label_get_max_width_chars (GtkLabel *label)
* set the labels width using gtk_widget_set_size_request(). * set the labels width using gtk_widget_set_size_request().
**/ **/
void void
gtk_label_set_line_wrap (GtkLabel *label, gtk_label_set_wrap (GtkLabel *label,
gboolean wrap) gboolean wrap)
{ {
GtkLabelPrivate *priv = gtk_label_get_instance_private (label); GtkLabelPrivate *priv = gtk_label_get_instance_private (label);
@ -3151,16 +3151,16 @@ gtk_label_set_line_wrap (GtkLabel *label,
} }
/** /**
* gtk_label_get_line_wrap: * gtk_label_get_wrap:
* @label: a #GtkLabel * @label: a #GtkLabel
* *
* Returns whether lines in the label are automatically wrapped. * Returns whether lines in the label are automatically wrapped.
* See gtk_label_set_line_wrap(). * See gtk_label_set_wrap().
* *
* Returns: %TRUE if the lines of the label are automatically wrapped. * Returns: %TRUE if the lines of the label are automatically wrapped.
*/ */
gboolean gboolean
gtk_label_get_line_wrap (GtkLabel *label) gtk_label_get_wrap (GtkLabel *label)
{ {
GtkLabelPrivate *priv = gtk_label_get_instance_private (label); GtkLabelPrivate *priv = gtk_label_get_instance_private (label);
@ -3170,16 +3170,16 @@ gtk_label_get_line_wrap (GtkLabel *label)
} }
/** /**
* gtk_label_set_line_wrap_mode: * gtk_label_set_wrap_mode:
* @label: a #GtkLabel * @label: a #GtkLabel
* @wrap_mode: the line wrapping mode * @wrap_mode: the line wrapping mode
* *
* If line wrapping is on (see gtk_label_set_line_wrap()) this controls how * If line wrapping is on (see gtk_label_set_wrap()) this controls how
* the line wrapping is done. The default is %PANGO_WRAP_WORD which means * the line wrapping is done. The default is %PANGO_WRAP_WORD which means
* wrap on word boundaries. * wrap on word boundaries.
**/ **/
void void
gtk_label_set_line_wrap_mode (GtkLabel *label, gtk_label_set_wrap_mode (GtkLabel *label,
PangoWrapMode wrap_mode) PangoWrapMode wrap_mode)
{ {
GtkLabelPrivate *priv = gtk_label_get_instance_private (label); GtkLabelPrivate *priv = gtk_label_get_instance_private (label);
@ -3196,15 +3196,15 @@ gtk_label_set_line_wrap_mode (GtkLabel *label,
} }
/** /**
* gtk_label_get_line_wrap_mode: * gtk_label_get_wrap_mode:
* @label: a #GtkLabel * @label: a #GtkLabel
* *
* Returns line wrap mode used by the label. See gtk_label_set_line_wrap_mode(). * Returns line wrap mode used by the label. See gtk_label_set_wrap_mode().
* *
* Returns: %TRUE if the lines of the label are automatically wrapped. * Returns: %TRUE if the lines of the label are automatically wrapped.
*/ */
PangoWrapMode PangoWrapMode
gtk_label_get_line_wrap_mode (GtkLabel *label) gtk_label_get_wrap_mode (GtkLabel *label)
{ {
GtkLabelPrivate *priv = gtk_label_get_instance_private (label); GtkLabelPrivate *priv = gtk_label_get_instance_private (label);

View File

@ -118,15 +118,15 @@ GDK_AVAILABLE_IN_ALL
void gtk_label_set_pattern (GtkLabel *label, void gtk_label_set_pattern (GtkLabel *label,
const gchar *pattern); const gchar *pattern);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gtk_label_set_line_wrap (GtkLabel *label, void gtk_label_set_wrap (GtkLabel *label,
gboolean wrap); gboolean wrap);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gboolean gtk_label_get_line_wrap (GtkLabel *label); gboolean gtk_label_get_wrap (GtkLabel *label);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gtk_label_set_line_wrap_mode (GtkLabel *label, void gtk_label_set_wrap_mode (GtkLabel *label,
PangoWrapMode wrap_mode); PangoWrapMode wrap_mode);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
PangoWrapMode gtk_label_get_line_wrap_mode (GtkLabel *label); PangoWrapMode gtk_label_get_wrap_mode (GtkLabel *label);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gtk_label_set_selectable (GtkLabel *label, void gtk_label_set_selectable (GtkLabel *label,
gboolean setting); gboolean setting);

View File

@ -622,7 +622,7 @@ gtk_mount_operation_ask_password_do_gtk (GtkMountOperation *operation,
label = gtk_label_new (primary); label = gtk_label_new (primary);
gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER); gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);
gtk_container_add (GTK_CONTAINER (main_vbox), GTK_WIDGET (label)); gtk_container_add (GTK_CONTAINER (main_vbox), GTK_WIDGET (label));
g_free (primary); g_free (primary);
attrs = pango_attr_list_new (); attrs = pango_attr_list_new ();
@ -635,7 +635,7 @@ gtk_mount_operation_ask_password_do_gtk (GtkMountOperation *operation,
label = gtk_label_new (secondary); label = gtk_label_new (secondary);
gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_valign (label, GTK_ALIGN_CENTER); gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);
gtk_container_add (GTK_CONTAINER (main_vbox), GTK_WIDGET (label)); gtk_container_add (GTK_CONTAINER (main_vbox), GTK_WIDGET (label));
} }

View File

@ -677,7 +677,7 @@ request_password (GtkPrintBackend *backend,
label = gtk_label_new (NULL); label = gtk_label_new (NULL);
markup = g_markup_printf_escaped ("<span weight=\"bold\" size=\"large\">%s</span>", prompt); markup = g_markup_printf_escaped ("<span weight=\"bold\" size=\"large\">%s</span>", prompt);
gtk_label_set_markup (GTK_LABEL (label), markup); gtk_label_set_markup (GTK_LABEL (label), markup);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);
gtk_widget_set_size_request (GTK_WIDGET (label), 320, -1); gtk_widget_set_size_request (GTK_WIDGET (label), 320, -1);
g_free (markup); g_free (markup);

View File

@ -46,7 +46,7 @@ create_label (gboolean wrap)
widget = gtk_label_new ("This is a label, label label label"); widget = gtk_label_new ("This is a label, label label label");
if (wrap) if (wrap)
gtk_label_set_line_wrap (GTK_LABEL (widget), TRUE); gtk_label_set_wrap (GTK_LABEL (widget), TRUE);
return widget; return widget;
} }
@ -328,7 +328,7 @@ open_valigned_label_window (void)
gtk_container_add (GTK_CONTAINER (box), label); gtk_container_add (GTK_CONTAINER (box), label);
label = gtk_label_new ("Some wrapping text with width-chars = 15 and max-width-chars = 35"); label = gtk_label_new ("Some wrapping text with width-chars = 15 and max-width-chars = 35");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_width_chars (GTK_LABEL (label), 15); gtk_label_set_width_chars (GTK_LABEL (label), 15);
gtk_label_set_max_width_chars (GTK_LABEL (label), 35); gtk_label_set_max_width_chars (GTK_LABEL (label), 35);

View File

@ -524,7 +524,7 @@ background_area (void)
label = gtk_label_new ("In this example, row spacing gets devided into the background area, " label = gtk_label_new ("In this example, row spacing gets devided into the background area, "
"column spacing is added between each background area, item_padding is " "column spacing is added between each background area, item_padding is "
"prepended space distributed to the background area."); "prepended space distributed to the background area.");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_width_chars (GTK_LABEL (label), 40); gtk_label_set_width_chars (GTK_LABEL (label), 40);
gtk_container_add (GTK_CONTAINER (main_vbox), label); gtk_container_add (GTK_CONTAINER (main_vbox), label);

View File

@ -202,7 +202,7 @@ get_contents_widget (GdkClipboard *clipboard)
gtk_stack_add_titled (GTK_STACK (stack), child, "image", "Image"); gtk_stack_add_titled (GTK_STACK (stack), child, "image", "Image");
child = gtk_label_new (NULL); child = gtk_label_new (NULL);
gtk_label_set_line_wrap (GTK_LABEL (child), TRUE); gtk_label_set_wrap (GTK_LABEL (child), TRUE);
gtk_stack_add_titled (GTK_STACK (stack), child, "text", "Text"); gtk_stack_add_titled (GTK_STACK (stack), child, "text", "Text");
return stack; return stack;

View File

@ -147,8 +147,8 @@ populate_flowbox_wrappy (GtkFlowBox *flowbox)
gtk_container_add (GTK_CONTAINER (frame), widget); gtk_container_add (GTK_CONTAINER (frame), widget);
gtk_label_set_line_wrap (GTK_LABEL (widget), TRUE); gtk_label_set_wrap (GTK_LABEL (widget), TRUE);
gtk_label_set_line_wrap_mode (GTK_LABEL (widget), PANGO_WRAP_WORD); gtk_label_set_wrap_mode (GTK_LABEL (widget), PANGO_WRAP_WORD);
gtk_label_set_width_chars (GTK_LABEL (widget), 10); gtk_label_set_width_chars (GTK_LABEL (widget), 10);
g_object_set_data_full (G_OBJECT (frame), "id", (gpointer)g_strdup (strings[i]), g_free); g_object_set_data_full (G_OBJECT (frame), "id", (gpointer)g_strdup (strings[i]), g_free);

View File

@ -114,7 +114,7 @@ text_grid (void)
label = gtk_label_new ("Some text that may wrap if it has to"); label = gtk_label_new ("Some text that may wrap if it has to");
gtk_label_set_width_chars (GTK_LABEL (label), 10); gtk_label_set_width_chars (GTK_LABEL (label), 10);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);
gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1); gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
gtk_grid_attach (GTK_GRID (grid), test_widget ("1", "red"), 1, 0, 1, 1); gtk_grid_attach (GTK_GRID (grid), test_widget ("1", "red"), 1, 0, 1, 1);
@ -158,7 +158,7 @@ box_comparison (void)
gtk_container_add (GTK_CONTAINER (box), test_widget ("2", "green")); gtk_container_add (GTK_CONTAINER (box), test_widget ("2", "green"));
label = gtk_label_new ("Some text that may wrap if needed"); label = gtk_label_new ("Some text that may wrap if needed");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_width_chars (GTK_LABEL (label), 10); gtk_label_set_width_chars (GTK_LABEL (label), 10);
gtk_container_add (GTK_CONTAINER (box), label); gtk_container_add (GTK_CONTAINER (box), label);
@ -180,7 +180,7 @@ box_comparison (void)
gtk_grid_attach (GTK_GRID (grid), test_widget ("2", "green"), 2, 0, 1, 1); gtk_grid_attach (GTK_GRID (grid), test_widget ("2", "green"), 2, 0, 1, 1);
label = gtk_label_new ("Some text that may wrap if needed"); label = gtk_label_new ("Some text that may wrap if needed");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_width_chars (GTK_LABEL (label), 10); gtk_label_set_width_chars (GTK_LABEL (label), 10);
gtk_grid_attach (GTK_GRID (grid), label, 3, 0, 1, 1); gtk_grid_attach (GTK_GRID (grid), label, 3, 0, 1, 1);
gtk_widget_set_hexpand (label, TRUE); gtk_widget_set_hexpand (label, TRUE);

View File

@ -1023,7 +1023,7 @@ void create_labels (GtkWidget *widget)
" It supports multiple paragraphs correctly, and correctly adds "\ " It supports multiple paragraphs correctly, and correctly adds "\
"many extra spaces. "); "many extra spaces. ");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);
gtk_container_add (GTK_CONTAINER (frame), label); gtk_container_add (GTK_CONTAINER (frame), label);
gtk_container_add (GTK_CONTAINER (vbox), frame); gtk_container_add (GTK_CONTAINER (vbox), frame);
@ -1036,7 +1036,7 @@ void create_labels (GtkWidget *widget)
" This is another newer, longer, better paragraph. It is coming to an end, "\ " This is another newer, longer, better paragraph. It is coming to an end, "\
"unfortunately."); "unfortunately.");
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_FILL); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_FILL);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);
gtk_container_add (GTK_CONTAINER (frame), label); gtk_container_add (GTK_CONTAINER (frame), label);
gtk_container_add (GTK_CONTAINER (vbox), frame); gtk_container_add (GTK_CONTAINER (vbox), frame);
@ -4916,7 +4916,7 @@ tracking_label (GtkWidget *window)
G_CONNECT_SWAPPED); G_CONNECT_SWAPPED);
label = gtk_label_new ("<no window state events received>"); label = gtk_label_new ("<no window state events received>");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);
gtk_container_add (GTK_CONTAINER (hbox), label); gtk_container_add (GTK_CONTAINER (hbox), label);
g_object_set_data (G_OBJECT (label), "title", (gpointer)gtk_window_get_title (GTK_WINDOW (window))); g_object_set_data (G_OBJECT (label), "title", (gpointer)gtk_window_get_title (GTK_WINDOW (window)));

View File

@ -112,7 +112,7 @@ scrollable_policy (void)
"is enough height to fit the content vertically if the window were " "is enough height to fit the content vertically if the window were "
"to be allocated a width without a vscrollbar present"); "to be allocated a width without a vscrollbar present");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_width_chars (GTK_LABEL (label), 40); gtk_label_set_width_chars (GTK_LABEL (label), 40);
gtk_label_set_max_width_chars (GTK_LABEL (label), 100); gtk_label_set_max_width_chars (GTK_LABEL (label), 100);

View File

@ -49,7 +49,7 @@ show_dialog (void)
"mi eu ipsum vestibulum in venenatis enim commodo. " "mi eu ipsum vestibulum in venenatis enim commodo. "
"Vivamus non malesuada ligula."); "Vivamus non malesuada ligula.");
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); gtk_label_set_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_width_chars (GTK_LABEL (label), width_chars); gtk_label_set_width_chars (GTK_LABEL (label), width_chars);
gtk_label_set_max_width_chars (GTK_LABEL (label), max_width_chars); gtk_label_set_max_width_chars (GTK_LABEL (label), max_width_chars);
gtk_window_set_default_size (GTK_WINDOW (dialog), default_width, default_height); gtk_window_set_default_size (GTK_WINDOW (dialog), default_width, default_height);