diff options
author | Tim Janik <timj@gtk.org> | 1998-11-28 01:56:09 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 1998-11-28 01:56:09 +0000 |
commit | 58af2b56bf681998479e347f2de9daf4ff73f726 (patch) | |
tree | ff7f9cbfc99d79fe335e0f28fe92b0165be41d08 /gtk/gtktext.c | |
parent | 36d80dc374b055205b566552ada7c4e0c45764ee (diff) | |
download | gdk-pixbuf-58af2b56bf681998479e347f2de9daf4ff73f726.tar.gz |
deprecated gtk_widget_freeze_accelerators and
Sat Nov 28 00:06:49 1998 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.h:
* gtk/gtkwidget.c: deprecated gtk_widget_freeze_accelerators and
gtk_widget_thaw_accelerators, we provide gtk_widget_lock_accelerators
and gtk_widget_unlock_accelerators.
* gtk/gtklayout.h:
* gtk/gtklayout.c: implemented incremental freezing facility.
* gtk/gtktext.h:
* gtk/gtktext.c: implemented incremental freezing facility.
* gtk/gtkenums.h:
* gtk/gtkaccelgroup.h: moved enum GtkAccelFlags into this place.
* gtk/gtkentry.h:
* gtk/gtkentry.c:
deprecated gtk_entry_adjust_scroll().
* random GtkType, macro and indentation fixes.
Fri Nov 27 22:50:15 1998 Tim Janik <timj@gtk.org>
* gtk/gtkclist.h:
* gtk/gtkclist.c: implemented incremental freezing facility, added
a new class member (*refresh)() which takes over the thaw
functionality. the clist FROZEN flag got removed on the way.
* gtk/gtkctree.c: adaptions to feature the clist refresh functionality
and incremental freezing.
* gtk/gtkcalendar.c: implemented incremental freezing facility.
Diffstat (limited to 'gtk/gtktext.c')
-rw-r--r-- | gtk/gtktext.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/gtk/gtktext.c b/gtk/gtktext.c index 132f9266a..0603485e0 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -676,6 +676,8 @@ gtk_text_init (GtkText *text) text->text = g_new (guchar, INITIAL_BUFFER_SIZE); text->text_len = INITIAL_BUFFER_SIZE; + + text->freeze_count = 0; if (!params_mem_chunk) params_mem_chunk = g_mem_chunk_new ("LineParams", @@ -887,7 +889,7 @@ gtk_text_freeze (GtkText *text) g_return_if_fail (text != NULL); g_return_if_fail (GTK_IS_TEXT (text)); - text->freeze = TRUE; + text->freeze_count++; } void @@ -896,13 +898,12 @@ gtk_text_thaw (GtkText *text) g_return_if_fail (text != NULL); g_return_if_fail (GTK_IS_TEXT (text)); - text->freeze = FALSE; - - if (GTK_WIDGET_REALIZED (text)) - { - recompute_geometry (text); - gtk_widget_queue_draw (GTK_WIDGET (text)); - } + if (text->freeze_count) + if (!(--text->freeze_count) && GTK_WIDGET_REALIZED (text)) + { + recompute_geometry (text); + gtk_widget_queue_draw (GTK_WIDGET (text)); + } } void @@ -932,13 +933,13 @@ gtk_text_insert (GtkText *text, if (length == 0) return; - if (!text->freeze && (length > FREEZE_LENGTH)) + if (!text->freeze_count && (length > FREEZE_LENGTH)) { gtk_text_freeze (text); frozen = TRUE; } - if (!text->freeze && (text->line_start_cache != NULL)) + if (!text->freeze_count && (text->line_start_cache != NULL)) { find_line_containing_point (text, text->point.index, TRUE); old_height = total_line_height (text, text->current_line, 1); @@ -970,7 +971,7 @@ gtk_text_insert (GtkText *text, advance_mark_n (&text->point, length); - if (!text->freeze && (text->line_start_cache != NULL)) + if (!text->freeze_count && text->line_start_cache != NULL) insert_expose (text, old_height, length, new_line_count); if (frozen) @@ -1006,13 +1007,13 @@ gtk_text_forward_delete (GtkText *text, if (text->point.index + nchars > TEXT_LENGTH (text) || nchars <= 0) return FALSE; - if (!text->freeze && (nchars > FREEZE_LENGTH)) + if (!text->freeze_count && nchars > FREEZE_LENGTH) { gtk_text_freeze (text); frozen = TRUE; } - if (!text->freeze && (text->line_start_cache != NULL)) + if (!text->freeze_count && text->line_start_cache != NULL) { /* We need to undraw the cursor here, since we may later * delete the cursor's property @@ -1054,7 +1055,7 @@ gtk_text_forward_delete (GtkText *text, delete_text_property (text, nchars); - if (!text->freeze && (text->line_start_cache != NULL)) + if (!text->freeze_count && (text->line_start_cache != NULL)) { delete_expose (text, nchars, old_lines, old_height); draw_cursor (text, FALSE); |