title: PyGtk: Widget overflows window
body: <p>My Champlain map overflows my GtkWindow as seen on the attached screenshot. I haven't been able to find anyone with a similar problem on the Internet.</p>
  
  <p>I made a GUI in Glade and left one empty panel so I could fill it in, in code, with a <code>GtkChamplain.Embed</code> widget to display a map. It worked almost fine until I set the size request of the <code>Embed</code> to prevent the map getting swallowed on window resizes.</p>
  
  <p><a href="https://i.stack.imgur.com/VCbhp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VCbhp.png" alt="screenshot of the problem"></a></p>
  
  <p>I didn't want this to happen:</p>
  
  <p><a href="https://i.stack.imgur.com/yOqqP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yOqqP.png" alt="screenshot of the previous problem"></a></p>
  
  <p>Sure, I can work around this by setting a limit to how small the window can shrink and to how big the left side of the panel can grow. I would just rather do it in the appropriate way by setting the <code>Embed</code>'s size request. Does anyone know why this is happening or how to make it right?</p>
  
  <p>Here's my full code.</p>
  
  <pre><code># -*- coding: utf-8 -*-
  
  import gi
  gi.require_version('Champlain', '0.12')
  gi.require_version('GtkChamplain', '0.12')
  gi.require_version('GtkClutter', '1.0')
  from gi.repository import GtkClutter, Clutter
  GtkClutter.init([])  # Must be initialized before importing those:
  from gi.repository import GObject, Gtk, Champlain, GtkChamplain, Pango
  
  class UserInterface:
  
      def __init__(self):
          builder = Gtk.Builder()
          builder.add_from_file('zahori.glade')
  
          self.client_list = builder.get_object("client-list")
          self.main_window = builder.get_object("main-window")
          self.main_panel = builder.get_object("main-panel")
          self.client_treeview = builder.get_object("client-treeview")
          self.main_window = builder.get_object("main-window")
          self.status_label = builder.get_object("status-label")
  
          self.map_embed = GtkChamplain.Embed()
          self.map_embed.set_size_request(550, 300)
          self.main_panel.add(self.map_embed)
  
          self.main_window.connect("destroy", Gtk.main_quit)
          self.main_window.show_all()
  
  
  UserInterface()
  Gtk.main()
  </code></pre>
  
  <p>Below you can find my <code>.glade</code> file.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!-- Generated with glade 3.20.0 --&gt;
  &lt;interface&gt;
    &lt;requires lib="gtk+" version="3.20"/&gt;
    &lt;object class="GtkListStore" id="client-list"/&gt;
    &lt;object class="GtkApplicationWindow" id="main-window"&gt;
      &lt;property name="can_focus"&gt;False&lt;/property&gt;
      &lt;property name="title" translatable="yes"&gt;Zahori&lt;/property&gt;
      &lt;property name="default_width"&gt;700&lt;/property&gt;
      &lt;property name="default_height"&gt;400&lt;/property&gt;
      &lt;child&gt;
        &lt;object class="GtkBox" id="main-box"&gt;
          &lt;property name="visible"&gt;True&lt;/property&gt;
          &lt;property name="can_focus"&gt;False&lt;/property&gt;
          &lt;property name="orientation"&gt;vertical&lt;/property&gt;
          &lt;child&gt;
            &lt;object class="GtkMenuBar" id="main-menu-bar"&gt;
              &lt;property name="visible"&gt;True&lt;/property&gt;
              &lt;property name="can_focus"&gt;False&lt;/property&gt;
              &lt;child&gt;
                &lt;object class="GtkMenuItem"&gt;
                  &lt;property name="visible"&gt;True&lt;/property&gt;
                  &lt;property name="can_focus"&gt;False&lt;/property&gt;
                  &lt;property name="label" translatable="yes"&gt;_Archivo&lt;/property&gt;
                  &lt;property name="use_underline"&gt;True&lt;/property&gt;
                  &lt;child type="submenu"&gt;
                    &lt;object class="GtkMenu"&gt;
                      &lt;property name="visible"&gt;True&lt;/property&gt;
                      &lt;property name="can_focus"&gt;False&lt;/property&gt;
                      &lt;child&gt;
                        &lt;object class="GtkImageMenuItem"&gt;
                          &lt;property name="label"&gt;gtk-new&lt;/property&gt;
                          &lt;property name="visible"&gt;True&lt;/property&gt;
                          &lt;property name="can_focus"&gt;False&lt;/property&gt;
                          &lt;property name="use_underline"&gt;True&lt;/property&gt;
                          &lt;property name="use_stock"&gt;True&lt;/property&gt;
                        &lt;/object&gt;
                      &lt;/child&gt;
                      &lt;child&gt;
                        &lt;object class="GtkImageMenuItem"&gt;
                          &lt;property name="label"&gt;gtk-open&lt;/property&gt;
                          &lt;property name="visible"&gt;True&lt;/property&gt;
                          &lt;property name="can_focus"&gt;False&lt;/property&gt;
                          &lt;property name="use_underline"&gt;True&lt;/property&gt;
                          &lt;property name="use_stock"&gt;True&lt;/property&gt;
                        &lt;/object&gt;
                      &lt;/child&gt;
                      &lt;child&gt;
                        &lt;object class="GtkImageMenuItem"&gt;
                          &lt;property name="label"&gt;gtk-save&lt;/property&gt;
                          &lt;property name="visible"&gt;True&lt;/property&gt;
                          &lt;property name="can_focus"&gt;False&lt;/property&gt;
                          &lt;property name="use_underline"&gt;True&lt;/property&gt;
                          &lt;property name="use_stock"&gt;True&lt;/property&gt;
                        &lt;/object&gt;
                      &lt;/child&gt;
                      &lt;child&gt;
                        &lt;object class="GtkImageMenuItem"&gt;
                          &lt;property name="label"&gt;gtk-save-as&lt;/property&gt;
                          &lt;property name="visible"&gt;True&lt;/property&gt;
                          &lt;property name="can_focus"&gt;False&lt;/property&gt;
                          &lt;property name="use_underline"&gt;True&lt;/property&gt;
                          &lt;property name="use_stock"&gt;True&lt;/property&gt;
                        &lt;/object&gt;
                      &lt;/child&gt;
                      &lt;child&gt;
                        &lt;object class="GtkSeparatorMenuItem"&gt;
                          &lt;property name="visible"&gt;True&lt;/property&gt;
                          &lt;property name="can_focus"&gt;False&lt;/property&gt;
                        &lt;/object&gt;
                      &lt;/child&gt;
                      &lt;child&gt;
                        &lt;object class="GtkImageMenuItem"&gt;
                          &lt;property name="label"&gt;gtk-quit&lt;/property&gt;
                          &lt;property name="visible"&gt;True&lt;/property&gt;
                          &lt;property name="can_focus"&gt;False&lt;/property&gt;
                          &lt;property name="use_underline"&gt;True&lt;/property&gt;
                          &lt;property name="use_stock"&gt;True&lt;/property&gt;
                        &lt;/object&gt;
                      &lt;/child&gt;
                    &lt;/object&gt;
                  &lt;/child&gt;
                &lt;/object&gt;
              &lt;/child&gt;
              &lt;child&gt;
                &lt;object class="GtkMenuItem"&gt;
                  &lt;property name="visible"&gt;True&lt;/property&gt;
                  &lt;property name="can_focus"&gt;False&lt;/property&gt;
                  &lt;property name="label" translatable="yes"&gt;_Editar&lt;/property&gt;
                  &lt;property name="use_underline"&gt;True&lt;/property&gt;
                  &lt;child type="submenu"&gt;
                    &lt;object class="GtkMenu"&gt;
                      &lt;property name="visible"&gt;True&lt;/property&gt;
                      &lt;property name="can_focus"&gt;False&lt;/property&gt;
                      &lt;child&gt;
                        &lt;object class="GtkImageMenuItem"&gt;
                          &lt;property name="label"&gt;gtk-cut&lt;/property&gt;
                          &lt;property name="visible"&gt;True&lt;/property&gt;
                          &lt;property name="can_focus"&gt;False&lt;/property&gt;
                          &lt;property name="use_underline"&gt;True&lt;/property&gt;
                          &lt;property name="use_stock"&gt;True&lt;/property&gt;
                        &lt;/object&gt;
                      &lt;/child&gt;
                      &lt;child&gt;
                        &lt;object class="GtkImageMenuItem"&gt;
                          &lt;property name="label"&gt;gtk-copy&lt;/property&gt;
                          &lt;property name="visible"&gt;True&lt;/property&gt;
                          &lt;property name="can_focus"&gt;False&lt;/property&gt;
                          &lt;property name="use_underline"&gt;True&lt;/property&gt;
                          &lt;property name="use_stock"&gt;True&lt;/property&gt;
                        &lt;/object&gt;
                      &lt;/child&gt;
                      &lt;child&gt;
                        &lt;object class="GtkImageMenuItem"&gt;
                          &lt;property name="label"&gt;gtk-paste&lt;/property&gt;
                          &lt;property name="visible"&gt;True&lt;/property&gt;
                          &lt;property name="can_focus"&gt;False&lt;/property&gt;
                          &lt;property name="use_underline"&gt;True&lt;/property&gt;
                          &lt;property name="use_stock"&gt;True&lt;/property&gt;
                        &lt;/object&gt;
                      &lt;/child&gt;
                      &lt;child&gt;
                        &lt;object class="GtkImageMenuItem"&gt;
                          &lt;property name="label"&gt;gtk-delete&lt;/property&gt;
                          &lt;property name="visible"&gt;True&lt;/property&gt;
                          &lt;property name="can_focus"&gt;False&lt;/property&gt;
                          &lt;property name="use_underline"&gt;True&lt;/property&gt;
                          &lt;property name="use_stock"&gt;True&lt;/property&gt;
                        &lt;/object&gt;
                      &lt;/child&gt;
                    &lt;/object&gt;
                  &lt;/child&gt;
                &lt;/object&gt;
              &lt;/child&gt;
              &lt;child&gt;
                &lt;object class="GtkMenuItem"&gt;
                  &lt;property name="visible"&gt;True&lt;/property&gt;
                  &lt;property name="can_focus"&gt;False&lt;/property&gt;
                  &lt;property name="label" translatable="yes"&gt;_Ver&lt;/property&gt;
                  &lt;property name="use_underline"&gt;True&lt;/property&gt;
                &lt;/object&gt;
              &lt;/child&gt;
              &lt;child&gt;
                &lt;object class="GtkMenuItem"&gt;
                  &lt;property name="visible"&gt;True&lt;/property&gt;
                  &lt;property name="can_focus"&gt;False&lt;/property&gt;
                  &lt;property name="label" translatable="yes"&gt;Ay_uda&lt;/property&gt;
                  &lt;property name="use_underline"&gt;True&lt;/property&gt;
                  &lt;child type="submenu"&gt;
                    &lt;object class="GtkMenu"&gt;
                      &lt;property name="visible"&gt;True&lt;/property&gt;
                      &lt;property name="can_focus"&gt;False&lt;/property&gt;
                      &lt;child&gt;
                        &lt;object class="GtkImageMenuItem"&gt;
                          &lt;property name="label"&gt;gtk-about&lt;/property&gt;
                          &lt;property name="visible"&gt;True&lt;/property&gt;
                          &lt;property name="can_focus"&gt;False&lt;/property&gt;
                          &lt;property name="use_underline"&gt;True&lt;/property&gt;
                          &lt;property name="use_stock"&gt;True&lt;/property&gt;
                        &lt;/object&gt;
                      &lt;/child&gt;
                    &lt;/object&gt;
                  &lt;/child&gt;
                &lt;/object&gt;
              &lt;/child&gt;
            &lt;/object&gt;
            &lt;packing&gt;
              &lt;property name="expand"&gt;False&lt;/property&gt;
              &lt;property name="fill"&gt;True&lt;/property&gt;
              &lt;property name="position"&gt;0&lt;/property&gt;
            &lt;/packing&gt;
          &lt;/child&gt;
          &lt;child&gt;
            &lt;object class="GtkToolbar" id="main-toolbar"&gt;
              &lt;property name="visible"&gt;True&lt;/property&gt;
              &lt;property name="can_focus"&gt;False&lt;/property&gt;
              &lt;child&gt;
                &lt;object class="GtkToolButton" id="new-scan-button"&gt;
                  &lt;property name="visible"&gt;True&lt;/property&gt;
                  &lt;property name="can_focus"&gt;False&lt;/property&gt;
                  &lt;property name="action_name"&gt;new-scan&lt;/property&gt;
                  &lt;property name="label" translatable="yes"&gt;New scan&lt;/property&gt;
                  &lt;property name="use_underline"&gt;True&lt;/property&gt;
                  &lt;property name="stock_id"&gt;gtk-new&lt;/property&gt;
                &lt;/object&gt;
                &lt;packing&gt;
                  &lt;property name="expand"&gt;False&lt;/property&gt;
                  &lt;property name="homogeneous"&gt;True&lt;/property&gt;
                &lt;/packing&gt;
              &lt;/child&gt;
              &lt;child&gt;
                &lt;object class="GtkToolButton" id="open-button"&gt;
                  &lt;property name="visible"&gt;True&lt;/property&gt;
                  &lt;property name="can_focus"&gt;False&lt;/property&gt;
                  &lt;property name="action_name"&gt;open-file&lt;/property&gt;
                  &lt;property name="label" translatable="yes"&gt;Open file&lt;/property&gt;
                  &lt;property name="use_underline"&gt;True&lt;/property&gt;
                  &lt;property name="stock_id"&gt;gtk-open&lt;/property&gt;
                &lt;/object&gt;
                &lt;packing&gt;
                  &lt;property name="expand"&gt;False&lt;/property&gt;
                  &lt;property name="homogeneous"&gt;True&lt;/property&gt;
                &lt;/packing&gt;
              &lt;/child&gt;
              &lt;child&gt;
                &lt;object class="GtkToolButton" id="save-button"&gt;
                  &lt;property name="visible"&gt;True&lt;/property&gt;
                  &lt;property name="can_focus"&gt;False&lt;/property&gt;
                  &lt;property name="action_name"&gt;save-file&lt;/property&gt;
                  &lt;property name="label" translatable="yes"&gt;Save to file&lt;/property&gt;
                  &lt;property name="use_underline"&gt;True&lt;/property&gt;
                  &lt;property name="stock_id"&gt;gtk-save&lt;/property&gt;
                &lt;/object&gt;
                &lt;packing&gt;
                  &lt;property name="expand"&gt;False&lt;/property&gt;
                  &lt;property name="homogeneous"&gt;True&lt;/property&gt;
                &lt;/packing&gt;
              &lt;/child&gt;
            &lt;/object&gt;
            &lt;packing&gt;
              &lt;property name="expand"&gt;False&lt;/property&gt;
              &lt;property name="fill"&gt;True&lt;/property&gt;
              &lt;property name="position"&gt;1&lt;/property&gt;
            &lt;/packing&gt;
          &lt;/child&gt;
          &lt;child&gt;
            &lt;object class="GtkPaned" id="main-panel"&gt;
              &lt;property name="visible"&gt;True&lt;/property&gt;
              &lt;property name="can_focus"&gt;True&lt;/property&gt;
              &lt;child&gt;
                &lt;object class="GtkTreeView" id="client-treeview"&gt;
                  &lt;property name="visible"&gt;True&lt;/property&gt;
                  &lt;property name="can_focus"&gt;True&lt;/property&gt;
                  &lt;property name="model"&gt;client-list&lt;/property&gt;
                  &lt;child internal-child="selection"&gt;
                    &lt;object class="GtkTreeSelection"/&gt;
                  &lt;/child&gt;
                  &lt;child&gt;
                    &lt;object class="GtkTreeViewColumn" id="client-mac"&gt;
                      &lt;property name="resizable"&gt;True&lt;/property&gt;
                      &lt;property name="min_width"&gt;200&lt;/property&gt;
                      &lt;property name="title" translatable="yes"&gt;Device&lt;/property&gt;
                    &lt;/object&gt;
                  &lt;/child&gt;
                &lt;/object&gt;
                &lt;packing&gt;
                  &lt;property name="resize"&gt;False&lt;/property&gt;
                  &lt;property name="shrink"&gt;False&lt;/property&gt;
                &lt;/packing&gt;
              &lt;/child&gt;
              &lt;child&gt;
                &lt;placeholder/&gt;
              &lt;/child&gt;
            &lt;/object&gt;
            &lt;packing&gt;
              &lt;property name="expand"&gt;True&lt;/property&gt;
              &lt;property name="fill"&gt;True&lt;/property&gt;
              &lt;property name="position"&gt;2&lt;/property&gt;
            &lt;/packing&gt;
          &lt;/child&gt;
          &lt;child&gt;
            &lt;object class="GtkBox" id="status-bar"&gt;
              &lt;property name="height_request"&gt;20&lt;/property&gt;
              &lt;property name="visible"&gt;True&lt;/property&gt;
              &lt;property name="can_focus"&gt;False&lt;/property&gt;
              &lt;child&gt;
                &lt;object class="GtkLabel" id="status-label"&gt;
                  &lt;property name="visible"&gt;True&lt;/property&gt;
                  &lt;property name="can_focus"&gt;False&lt;/property&gt;
                  &lt;property name="margin_left"&gt;6&lt;/property&gt;
                &lt;/object&gt;
                &lt;packing&gt;
                  &lt;property name="expand"&gt;False&lt;/property&gt;
                  &lt;property name="fill"&gt;True&lt;/property&gt;
                  &lt;property name="position"&gt;0&lt;/property&gt;
                &lt;/packing&gt;
              &lt;/child&gt;
            &lt;/object&gt;
            &lt;packing&gt;
              &lt;property name="expand"&gt;False&lt;/property&gt;
              &lt;property name="fill"&gt;True&lt;/property&gt;
              &lt;property name="position"&gt;3&lt;/property&gt;
            &lt;/packing&gt;
          &lt;/child&gt;
        &lt;/object&gt;
      &lt;/child&gt;
    &lt;/object&gt;
  &lt;/interface&gt;
  </code></pre>