diff options
author | Havoc Pennington <hp@redhat.com> | 2000-11-20 23:51:51 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2000-11-20 23:51:51 +0000 |
commit | 6f7dd53b801d21692744ac3c445307391225686d (patch) | |
tree | 2457a929ff4aa529ed84d55b5e61e316f042202c /gtk/gtktextchild.c | |
parent | 2999f465b4db274a9d2301c7d3653d134bd79adb (diff) | |
download | gtk+-6f7dd53b801d21692744ac3c445307391225686d.tar.gz |
Semi-finish widget embedding. Need guffaw scrolling to be implemented in
2000-11-20 Havoc Pennington <hp@redhat.com>
* gtk/gtktextview.c, gtk/gtktextlayout.c, gtk/gtktextchild.c,
gtk/testtext.c: Semi-finish widget embedding. Need guffaw
scrolling to be implemented in GDK to finish. Also, right now
we just size_allocate all children on every layout change,
which is pretty lame. Test commented out of testtext.c,
until it works better.
Diffstat (limited to 'gtk/gtktextchild.c')
-rw-r--r-- | gtk/gtktextchild.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/gtk/gtktextchild.c b/gtk/gtktextchild.c index 3b1dabfaa8..ced17a8ddb 100644 --- a/gtk/gtktextchild.c +++ b/gtk/gtktextchild.c @@ -242,7 +242,6 @@ _gtk_widget_segment_remove (GtkTextLineSegment *widget_segment, GtkWidget *child) { g_return_if_fail (widget_segment->type = >k_text_child_type); - g_return_if_fail (widget_segment->body.child.tree != NULL); widget_segment->body.child.widgets = g_slist_remove (widget_segment->body.child.widgets, @@ -420,10 +419,12 @@ gtk_text_child_anchor_unregister_child (GtkTextChildAnchor *anchor, { g_return_if_fail (GTK_IS_TEXT_CHILD_ANCHOR (anchor)); g_return_if_fail (GTK_IS_WIDGET (child)); - g_return_if_fail (_gtk_anchored_child_get_layout (child) != NULL); - - gtk_text_child_anchor_queue_resize (anchor, - _gtk_anchored_child_get_layout (child)); + + if (_gtk_anchored_child_get_layout (child)) + { + gtk_text_child_anchor_queue_resize (anchor, + _gtk_anchored_child_get_layout (child)); + } _gtk_anchored_child_set_layout (child, NULL); @@ -439,10 +440,12 @@ gtk_text_child_anchor_queue_resize (GtkTextChildAnchor *anchor, GtkTextLineSegment *seg; g_return_if_fail (GTK_IS_TEXT_CHILD_ANCHOR (anchor)); - + g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout)); + seg = anchor->segment; - g_return_if_fail (seg->body.child.tree != NULL); + if (seg->body.child.tree == NULL) + return NULL; gtk_text_buffer_get_iter_at_child_anchor (layout->buffer, &start, anchor); @@ -452,3 +455,14 @@ gtk_text_child_anchor_queue_resize (GtkTextChildAnchor *anchor, gtk_text_layout_invalidate (layout, &start, &end); } +void +gtk_text_anchored_child_set_layout (GtkWidget *child, + GtkTextLayout *layout) +{ + g_return_if_fail (GTK_IS_WIDGET (child)); + g_return_if_fail (layout == NULL || GTK_IS_TEXT_LAYOUT (layout)); + + _gtk_anchored_child_set_layout (child, layout); +} + + |