performance poor when embedded multiple text_views into one scroll window



Hi list,

I'm new to gtk, and when I try to programming a text manipulating tool
using GTK+2.0, I run into some issue.

here it is:
1. When I embedded one gtk_text_view in a scrolled_window, that works fine.
2. However, for some reason, I need to embedded several text_views
into one scrolled_window, and found the performance very poor.

This is what I was doing:
First create a scrolled_window, then put one viewport into it, after
that put one gtk_vbox into the viewport, and then inside the gtk_vbox,
add three text_views with buffers.

Here is the issue:
When you maximize the window, and then un-maximize it, the performance
is very poor (the main window refuse to response to any action, esp.
in my slow Duron 700MHz computer). I don't know why.

Below is the demo source code. You can compile and run under Linux to
have a try.
http://kai.holddreams.com/wordpress/wp-content/uploads/2007/08/gtktext.c

And also I try to describe this using a diagram, here:
http://kai.holddreams.com/wordpress/?p=70

The reason why I use multiple text_views to hold multiple text
buffers, but not use one text_view to hold multiple buffers is that I
want to have different controls on each buffer (editable, word wrap,
background color, etc.). Yes, you can also done this with iters and
marks, but I think using different text views is more simple.

Thanks, and pls CC me cause I'm not in the list.
Kangkai



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]