title: GTK: Using an Offscreen Window to investigate the rendered dimensions of widgets
body: <p>I am utilizing a Gtk.Offscreen_Window to investigate the heights of various off-screen widgets in order to figure out where to place them on-screen based on their height. I managed to accomplish this with the following pseudo code.</p>
  
  <pre><code>procedure My_Proc 
  is
      use Gtk.Offscreen_Window;
      use Gtk.Box;
      Offscreen : Gtk_Offscreen_Window := Gtk_Offscreen_Window_New;
      Box       : Gtk_Box := Gtk_Box_New ( Orientation_Vertical );
  begin
      Offscreen.Set_Default_Geometry ( 1000, 1000 );
      Offscreen.Add ( Box );
      Offscreen.Show_All;
      Ada.Text_IO.Put_Line( Glib.Gint'Image ( Box.Get_Allocated_Height ));
  end My_Proc;
  </code></pre>
  
  <p>This code will correctly tell me the height of Box. Note that my original code is a bit more complex than this but I've simplified it for the sake of this posting.</p>
  
  <p>The problem here has to do with Offscreen.Show_All procedure. I know that this is not correct practice with an Offscreen widget since it cannot be shown like a normal Window. This is further emphasized by a warning that shows up on the console when this code is executed:</p>
  
  <pre><code>(main:26724): Gdk-WARNING **: /build/buildd/gtk+3.0-3.10.8/./gdk/x11/gdkwindow-x11.c:5531 drawable is not a native X11 window
  </code></pre>
  
  <p>Without including the Show_All function the size calculations will be incorrect (returns 1), so the Show_All function seems to be doing something important albeit a little too much. I believe the solution is as simple as finding out what runs the allocation calculations within the Show_All function and running that directly. Unfortunately I don't know what that function is.</p>
  
  <p>So the bottom line is: <strong>How do I correctly instruct the Offscreen_Window widget to perform its sizing calculations without using the Show_All function?</strong></p>
  
  <p>Thank you.</p>
  
  <p><em>I am using Ada 2012, GtkAda (latest since mid 2015), Linux Kubuntu 14.04 but also expect this to run in Windows 7/8.</em></p>