mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 05:50:10 +00:00
Remove deprecated code: GtkLabel
This commit is contained in:
parent
b5917e7a6f
commit
fead8cd49a
@ -2629,8 +2629,8 @@ underlined, and the relevant accelerators are created.</para>
|
||||
gtk_box_pack_start (GTK_BOX (vbox1), menubar1, FALSE, FALSE, 0);
|
||||
|
||||
file1 = gtk_menu_item_new_with_label ("");
|
||||
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (file1)->child),
|
||||
_("_File"));
|
||||
gtk_label_set_use_underline (GTK_LABEL (gtk_bin_get_child (GTK_BIN (file1))),
|
||||
TRUE);
|
||||
gtk_widget_add_accelerator (file1, "activate_item", accel_group,
|
||||
tmp_key, GDK_MOD1_MASK, 0);
|
||||
gtk_object_set_data (GTK_OBJECT (window1), "file1", file1);
|
||||
@ -2643,8 +2643,8 @@ underlined, and the relevant accelerators are created.</para>
|
||||
gtk_menu_item_set_submenu (GTK_MENU_ITEM (file1), file1_menu);
|
||||
|
||||
new1 = gtk_menu_item_new_with_label ("");
|
||||
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (new1)->child),
|
||||
_("_New"));
|
||||
gtk_label_set_use_underline (GTK_LABEL (gtk_bin_get_child (GTK_BIN (new1))),
|
||||
TRUE);
|
||||
gtk_widget_add_accelerator (new1, "activate_item", file1_menu_accels,
|
||||
tmp_key, 0, 0);
|
||||
gtk_object_set_data (GTK_OBJECT (window1), "new1", new1);
|
||||
@ -2670,9 +2670,9 @@ GtkMenuItem with:</para>
|
||||
/* do stuff with child */
|
||||
if (GTK_IS_LABEL (child))
|
||||
{
|
||||
gchar *text;
|
||||
const gchar *text;
|
||||
|
||||
gtk_label_get (GTK_LABEL (child), &text);
|
||||
text = gtk_label_get_text (GTK_LABEL (child));
|
||||
g_print ("menu item text: %s\n", text);
|
||||
}
|
||||
}
|
||||
|
@ -2278,7 +2278,6 @@ gtk_label_set_ellipsize
|
||||
gtk_label_set_width_chars
|
||||
gtk_label_set_max_width_chars
|
||||
gtk_label_get
|
||||
gtk_label_parse_uline
|
||||
gtk_label_set_line_wrap
|
||||
gtk_label_set_line_wrap_mode
|
||||
gtk_label_set
|
||||
|
@ -448,21 +448,6 @@ must not write to it.
|
||||
@Deprecated: Use gtk_label_get_text() instead.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_label_parse_uline ##### -->
|
||||
<para>
|
||||
Parses the given string for underscores and converts the next
|
||||
character to an underlined character. The last character that
|
||||
was underlined will have its lower-cased accelerator keyval returned (i.e.
|
||||
"_File" would return the keyval for "f". This is
|
||||
probably only used within the GTK+ library itself for menu items and such.
|
||||
</para>
|
||||
|
||||
@label: The #GtkLabel you want to affect.
|
||||
@string: The string you want to parse for underlines.
|
||||
@Returns: The lowercase keyval of the last character underlined.
|
||||
@Deprecated: Use gtk_label_set_use_underline() instead.
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_label_set_line_wrap ##### -->
|
||||
<para>
|
||||
|
||||
|
@ -117,7 +117,7 @@ gint main( int argc,
|
||||
*/
|
||||
for (i = 0; i < 5; i++) {
|
||||
GtkWidget *label;
|
||||
gchar *string;
|
||||
const gchar *string;
|
||||
|
||||
sprintf(buffer, "ListItemContainer with Label #%d", i);
|
||||
label=gtk_label_new (buffer);
|
||||
@ -126,7 +126,7 @@ gint main( int argc,
|
||||
gtk_widget_show (label);
|
||||
gtk_container_add (GTK_CONTAINER (gtklist), list_item);
|
||||
gtk_widget_show (list_item);
|
||||
gtk_label_get (GTK_LABEL (label), &string);
|
||||
string = gtk_label_get_text (GTK_LABEL (label));
|
||||
g_object_set_data (G_OBJECT (list_item), list_item_data_key, string);
|
||||
}
|
||||
/* Here, we are creating another 5 labels, this time
|
||||
|
@ -7,14 +7,14 @@
|
||||
static void cb_itemsignal( GtkWidget *item,
|
||||
gchar *signame )
|
||||
{
|
||||
gchar *name;
|
||||
const gchar *name;
|
||||
GtkLabel *label;
|
||||
|
||||
/* It's a Bin, so it has one child, which we know to be a
|
||||
label, so get that */
|
||||
label = GTK_LABEL (GTK_BIN (item)->child);
|
||||
label = GTK_LABEL (gtk_bin_get_child (GTK_BIN (item)));
|
||||
/* Get the text of the label */
|
||||
gtk_label_get (label, &name);
|
||||
name = gtk_label_get_text (label);
|
||||
/* Get the level of the tree which the item is in */
|
||||
g_print ("%s called for item %s->%p, level %d\n", signame, name,
|
||||
item, GTK_TREE (item->parent)->level);
|
||||
@ -47,14 +47,14 @@ static void cb_selection_changed( GtkWidget *tree )
|
||||
|
||||
i = GTK_TREE_SELECTION_OLD (tree);
|
||||
while (i) {
|
||||
gchar *name;
|
||||
const gchar *name;
|
||||
GtkLabel *label;
|
||||
GtkWidget *item;
|
||||
|
||||
/* Get a GtkWidget pointer from the list node */
|
||||
item = GTK_WIDGET (i->data);
|
||||
label = GTK_LABEL (GTK_BIN (item)->child);
|
||||
gtk_label_get (label, &name);
|
||||
label = GTK_LABEL (gtk_bin_get_child (GTK_BIN (item)));
|
||||
name = gtk_label_get_text (label);
|
||||
g_print ("\t%s on level %d\n", name, GTK_TREE
|
||||
(item->parent)->level);
|
||||
i = i->next;
|
||||
|
@ -2879,17 +2879,6 @@ gtk_label_get_line_wrap_mode (GtkLabel *label)
|
||||
return label->wrap_mode;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gtk_label_get (GtkLabel *label,
|
||||
gchar **str)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_LABEL (label));
|
||||
g_return_if_fail (str != NULL);
|
||||
|
||||
*str = label->text;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_label_destroy (GtkObject *object)
|
||||
{
|
||||
@ -4227,36 +4216,6 @@ gtk_label_set_uline_text_internal (GtkLabel *label,
|
||||
g_free (pattern);
|
||||
}
|
||||
|
||||
guint
|
||||
gtk_label_parse_uline (GtkLabel *label,
|
||||
const gchar *str)
|
||||
{
|
||||
guint keyval;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_LABEL (label), GDK_VoidSymbol);
|
||||
g_return_val_if_fail (str != NULL, GDK_VoidSymbol);
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (label));
|
||||
|
||||
gtk_label_set_label_internal (label, g_strdup (str ? str : ""));
|
||||
gtk_label_set_use_markup_internal (label, FALSE);
|
||||
gtk_label_set_use_underline_internal (label, TRUE);
|
||||
|
||||
gtk_label_recalculate (label);
|
||||
|
||||
keyval = label->mnemonic_keyval;
|
||||
if (keyval != GDK_VoidSymbol)
|
||||
{
|
||||
label->mnemonic_keyval = GDK_VoidSymbol;
|
||||
gtk_label_setup_mnemonic (label, keyval);
|
||||
g_object_notify (G_OBJECT (label), "mnemonic-keyval");
|
||||
}
|
||||
|
||||
g_object_thaw_notify (G_OBJECT (label));
|
||||
|
||||
return keyval;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_label_set_text_with_mnemonic:
|
||||
* @label: a #GtkLabel
|
||||
|
@ -182,20 +182,6 @@ void gtk_label_set_track_visited_links (GtkLabel *label,
|
||||
gboolean track_links);
|
||||
gboolean gtk_label_get_track_visited_links (GtkLabel *label);
|
||||
|
||||
#ifndef GTK_DISABLE_DEPRECATED
|
||||
|
||||
#define gtk_label_set gtk_label_set_text
|
||||
void gtk_label_get (GtkLabel *label,
|
||||
gchar **str);
|
||||
|
||||
/* Convenience function to set the name and pattern by parsing
|
||||
* a string with embedded underscores, and return the appropriate
|
||||
* key symbol for the accelerator.
|
||||
*/
|
||||
guint gtk_label_parse_uline (GtkLabel *label,
|
||||
const gchar *string);
|
||||
|
||||
#endif /* GTK_DISABLE_DEPRECATED */
|
||||
|
||||
/* private */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user