title: gtkd performance issue when adding a lot of textviews at once
body: <p>Here's a minimal example to illustrate the problem. When the button is clicked, 500 TextView objects should get added, each containing some text. What actually happens is that there is a short delay, 500 empty TextViews get added, there is a much longer delay and then they all get populated with text at once and the layout sizes itself properly. Code below:</p>
  
  <pre><code>import gtk.Button;
  import gtk.Main;
  import gtk.MainWindow;
  import gtk.Notebook;
  import gtk.ScrolledWindow;
  import gtk.Statusbar;
  import gtk.TextView;
  import gtk.TextBuffer;
  import gtk.UIManager;
  import gtk.VBox;
  import gtk.Window;
  
  import std.stdio;
  
  class UI : MainWindow
  {
    Notebook notebook;
  
    this() {
      super("Test");
      setDefaultSize(200, 100);
      VBox box = new VBox(false, 2);
      notebook = new Notebook();
      Button button = new Button("add lines");
      button.addOnClicked(&amp;addLines);
      box.packStart(notebook, true, true, 0);
      box.packStart(button, false, false, 2);
      add(box);
      showAll();
    }
  
    void addLines(Button b) {
      VBox box = new VBox(false, 2);
      for (int i = 0; i &lt; 500; i++) {
        auto tv = new TextView();
        tv.getBuffer().setText("line");
        box.packStart(tv, false, false, 1);
      }
      ScrolledWindow swin = new ScrolledWindow(box);
      notebook.add(swin);
      showAll();
    }
  }
  
  void main(string[] args)
  {
    Main.init(args);
    auto ui = new UI();
    Main.run();
  }
  </code></pre>
  
  <hr>
  
  <p><strong>Edit</strong>: <a href="http://mail.gnome.org/archives/gtk-list/2007-December/msg00000.html" rel="nofollow">this thread</a> suggests that creating a bunch of text views is intrinsically expensive, and that I should be rewriting using a treeview.</p>