title: How force the widget's size in a box with Gtk 3
body: <p>I'm making a program that is supposed to have a principal <em>textview</em> (see <a href="http://python-gtk-3-tutorial.readthedocs.io/en/latest/textview.html#the-view" rel="nofollow noreferrer">textview</a>) where the user is supposed to write and a console, where the program is supposed to return the errors messages. So the console should be a little smaller than the text editor.<br />
  I also have a toolbar on the top of the window for the user to access the tools of my program and for editing the text.<br />
  To do that, I created a global box, where I put the tool bar, the textview and the console (which is also a textview object) using the <code>pack_start</code> attribute (<code>self.global_box.pack_start(self.console))</code>)</p>
  <p>The toolbar is correctly placed (I put a button so it can have a length, and it works), but the rest of the space is <strong>homogeneously</strong> taken by the console and the textview, whereas I would like the console to take only a little space of my window.<br />
  How can I obligate my console to take only, for example, 20 pixels of my window? or to set a percentage of my window only for the textview?</p>
  <p><img src="https://i.stack.imgur.com/n5wkK.png" alt="here is a screenshot of the window, so you can have an idea of what I'm talking about." /></p>
  <p>EDIT:
  The question is similar but its the solution didn't work for me.
  Here is the code:</p>
  <pre class="lang-py prettyprint-override"><code>class Window(Gtk.Window):
      def __init__(self):
          Gtk.Window.__init__(self,title='Text editor')
          self.maximize()
          self.global_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
          self.add(self.global_box)
  
          self.create_textview()
          self.create_console()
  
      def create_textview(self):
          self.scrolled_window = Gtk.ScrolledWindow()
          self.scrolled_window.set_hexpand(True)
          self.scrolled_window.set_vexpand(True)
          self.global_box.pack_start(self.scrolled_window, True, True, 0)
  
          self.textview = Gtk.TextView()
          self.textbuffer = self.textview.get_buffer()
          self.scrolled_window.add(self.textview)
          self.tag_found = self.textbuffer.create_tag('found',background='yellow')
  
      def create_console(self):
          self.console_scrolled_window = Gtk.ScrolledWindow()
          self.console_scrolled_window.set_hexpand(True)
          self.console_scrolled_window.set_vexpand(True)
          self.global_box.pack_start(self.console_scrolled_window, False, False, 0)
          # ^ HERE the first one is expand argument, second one is irrelevant (the fill one)
  
          self.console = Gtk.TextView()
          self.console_scrolled_window.add(self.console)
          self.console.set_editable(False)
  </code></pre>
  <p>The problem is on the line where there is the comment HERE.</p>