diff options
author | Matthias Clasen <mclasen@redhat.com> | 2008-02-16 02:31:33 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2008-02-16 02:31:33 +0000 |
commit | 13277493eb99fc0e5d99acd719ab54a2cd83dadb (patch) | |
tree | 8242e7bd9b13d10c754f40cfaaf6e918fa389a2d /gtk/gtklabel.c | |
parent | 3b3122ee066350badef46204cad31325c6da97e1 (diff) | |
download | gtk+-13277493eb99fc0e5d99acd719ab54a2cd83dadb.tar.gz |
Use gtk_drag_*_add_{text,uri}_targets instead of hardcoded target tables.
2008-02-15 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.c:
* gtk/gtkfilesel.c:
* gtk/gtklabel.c:
* gtk/gtkpathbar.c: Use gtk_drag_*_add_{text,uri}_targets
instead of hardcoded target tables. (#516092, Christian Persch)
svn path=/trunk/; revision=19590
Diffstat (limited to 'gtk/gtklabel.c')
-rw-r--r-- | gtk/gtklabel.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 814b5369ee..56bd297165 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -3413,13 +3413,6 @@ gtk_label_select_region_index (GtkLabel *label, gint anchor_index, gint end_index) { - static const GtkTargetEntry targets[] = { - { "STRING", 0, 0 }, - { "TEXT", 0, 0 }, - { "COMPOUND_TEXT", 0, 0 }, - { "UTF8_STRING", 0, 0 } - }; - g_return_if_fail (GTK_IS_LABEL (label)); if (label->select_info) @@ -3438,12 +3431,22 @@ gtk_label_select_region_index (GtkLabel *label, if (anchor_index != end_index) { + GtkTargetList *list; + GtkTargetEntry *targets; + gint n_targets; + + list = gtk_target_list_new (NULL, 0); + gtk_target_list_add_text_targets (list, 0); + targets = gtk_target_table_new_from_list (list, &n_targets); + gtk_clipboard_set_with_owner (clipboard, - targets, - G_N_ELEMENTS (targets), + targets, n_targets, get_text_callback, clear_text_callback, G_OBJECT (label)); + + gtk_target_table_free (targets, n_targets); + gtk_target_list_unref (list); } else { |