summaryrefslogtreecommitdiff
path: root/gtk/gtkeditable.c
diff options
context:
space:
mode:
authorOwen Taylor <owt1@cornell.edu>1998-03-07 03:05:36 +0000
committerOwen Taylor <otaylor@src.gnome.org>1998-03-07 03:05:36 +0000
commit1941bf4cbf30ba6a0b63ae2f881a6f7d6c13a677 (patch)
tree89e9341d9fe045a882937df16a9ba6b0f2f730b3 /gtk/gtkeditable.c
parent761549b9682de5b9b6d8a1f06f8e75cff911a551 (diff)
downloadgdk-pixbuf-1941bf4cbf30ba6a0b63ae2f881a6f7d6c13a677.tar.gz
Disallow pasting into non-editable widgets.
Fri Mar 6 21:30:05 1998 Owen Taylor <owt1@cornell.edu> * gtk/gtkeditable.c: Disallow pasting into non-editable widgets. * gtk/gtktext.[ch]: -Added scrolling when dragging the selection paste the top/bottom. -Fix some of the problems with displaying the selection state before mouse release. -Disallow pasting into non-editable widgets -Fixed segfault when changing window size -Update the cursor correctly when switching between editable and non-editable * testgtk.c: Added a toggle button for editability for the text widget.
Diffstat (limited to 'gtk/gtkeditable.c')
-rw-r--r--gtk/gtkeditable.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gtk/gtkeditable.c b/gtk/gtkeditable.c
index 31628a408..4a5ec13f2 100644
--- a/gtk/gtkeditable.c
+++ b/gtk/gtkeditable.c
@@ -577,8 +577,14 @@ gtk_editable_selection_received (GtkWidget *widget,
void
gtk_editable_delete_selection (GtkEditable *editable)
{
- guint start = editable->selection_start_pos;
- guint end = editable->selection_end_pos;
+ guint start;
+ guint end;
+
+ if (!editable->editable)
+ return;
+
+ start = editable->selection_start_pos;
+ end = editable->selection_end_pos;
editable->selection_start_pos = 0;
editable->selection_end_pos = 0;
@@ -655,8 +661,9 @@ gtk_editable_copy_clipboard (GtkEditable *editable, guint32 time)
void
gtk_editable_paste_clipboard (GtkEditable *editable, guint32 time)
{
- gtk_selection_convert (GTK_WIDGET(editable),
- clipboard_atom, ctext_atom, time);
+ if (editable->editable)
+ gtk_selection_convert (GTK_WIDGET(editable),
+ clipboard_atom, ctext_atom, time);
}
void