diff options
author | Owen Taylor <otaylor@redhat.com> | 2002-02-25 05:12:14 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2002-02-25 05:12:14 +0000 |
commit | 3ce820584fc829d9c51f56193743415bec33decf (patch) | |
tree | 345002a3f5bb845c068d56d3ee0eeacb2ab57266 /tests/testselection.c | |
parent | f9debe2f690e165944810058569503a6b207f903 (diff) | |
download | gdk-pixbuf-3ce820584fc829d9c51f56193743415bec33decf.tar.gz |
Convert over to using an GtkInvisible - selections don't work properly
Sun Feb 24 23:23:28 2002 Owen Taylor <otaylor@redhat.com>
* tests/testselection.c (main): Convert over to using
an GtkInvisible - selections don't work properly
with now NO_WINDOW GtkToggleButton. (Example really
should be using GtkClipboard.)
* gdk/x11/gdkselection-x11.c (gdk_selection_property_get):
Fix problems if sizeof(GdkAtom) != sizeof(Atom). (Unlikely)
* gdk/x11/gdkproperty-x11.c (gdk_property_get): Set
actual_length when converting atoms as well.
(Gregory Merchan, #72074)
Diffstat (limited to 'tests/testselection.c')
-rw-r--r-- | tests/testselection.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/testselection.c b/tests/testselection.c index 1731fe57c..3f3d6830c 100644 --- a/tests/testselection.c +++ b/tests/testselection.c @@ -105,6 +105,7 @@ static int num_targets = sizeof(targets)/sizeof(Target); static int have_selection = FALSE; +GtkWidget *selection_widget; GtkWidget *selection_text; GtkWidget *selection_button; GString *selection_string = NULL; @@ -367,7 +368,7 @@ paste (GtkWidget *widget, GtkWidget *entry) return; } - gtk_selection_convert (selection_button, GDK_SELECTION_PRIMARY, atom, + gtk_selection_convert (selection_widget, GDK_SELECTION_PRIMARY, atom, GDK_CURRENT_TIME); } @@ -400,6 +401,8 @@ main (int argc, char *argv[]) init_atoms(); + selection_widget = gtk_invisible_new (); + dialog = gtk_dialog_new (); gtk_widget_set_name (dialog, "Test Input"); gtk_container_set_border_width (GTK_CONTAINER(dialog), 0); @@ -425,15 +428,15 @@ main (int argc, char *argv[]) gtk_signal_connect (GTK_OBJECT(selection_button), "toggled", GTK_SIGNAL_FUNC (selection_toggled), NULL); - gtk_signal_connect (GTK_OBJECT(selection_button), "selection_clear_event", + gtk_signal_connect (GTK_OBJECT(selection_widget), "selection_clear_event", GTK_SIGNAL_FUNC (selection_clear), NULL); - gtk_signal_connect (GTK_OBJECT(selection_button), "selection_received", + gtk_signal_connect (GTK_OBJECT(selection_widget), "selection_received", GTK_SIGNAL_FUNC (selection_received), NULL); - gtk_selection_add_targets (selection_button, GDK_SELECTION_PRIMARY, + gtk_selection_add_targets (selection_widget, GDK_SELECTION_PRIMARY, targetlist, ntargets); - gtk_signal_connect (GTK_OBJECT(selection_button), "selection_get", + gtk_signal_connect (GTK_OBJECT(selection_widget), "selection_get", GTK_SIGNAL_FUNC (selection_get), NULL); selection_text = gtk_text_new (NULL, NULL); |