title: How to improve perl Gtk2 performance when we have a large number of widgets
body: <p>I'm writing a perl GUI using Gtk2, it has a scrolled window which contains a number of GTk2::Expander which includes different widgets.
  The poroblem is when i have a large number of Expanders (~80,000) the time it takes to perform show_all() is large, and when i open a single expander it takes several seconds. Running the same script with less expanders give a very fast response.</p>
  <p>Since my expanders exists in a scrolled window and only part of them would be really visible, is there a way to improve the performance? like showing only the visible expanders and keeping all others as hidden?</p>
  <p>I can't use GTK3, I need to use Perl and Gtk2 only.</p>
  <p>Example Code:</p>
  <pre><code>my $ItemsCount = 10000;
  my $ScWin      = Gtk2::ScrolledWindow-&gt;new(undef, undef);
  my $Frame      = Gtk2::Frame-&gt;new('Items');
  my $ItemsBox   = Gtk2::Table-&gt;new(2, $ItemsCount+1, FALSE);
  
  my  $View = Gtk2::Viewport-&gt;new();
  
  $ScWin-&gt;set_policy('automatic', 'automatic');   
  $View-&gt;add($ItemsBox);
  $ScWin-&gt;add($View);
  
  for my $i (0 .. $ItemsCount-1)  {
      my $exp =  Gtk2::Expander-&gt;new();
      $exp     -&gt;set_label(&quot;Item #$i&quot;);
      $ItemsBox-&gt;attach($exp, 0, 1, $i, $i+1, 'fill', 'fill', 1, 2);
  }
  $MainBox    -&gt;pack_start    ($ScWin     , TRUE, TRUE, 0);
  </code></pre>