Set vertical size for the pop-up menu of a GtkComboBox
<p>I created a GtkComboBox with dozens of items. When I perform I see that the pop-up menu containing the items is very vertically large.
How do I set a maximum size? I checked the documentation and I not found a method to define it.</p>

<p>Example:</p>

<pre><code>#!/usr/bin/env python3

import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk

class ComboBox(Gtk.Window):
    def __init__(self):
        Gtk.Window.__init__(self)
        self.set_title("ComboBox")
        self.set_default_size(150, -1)
        self.connect("destroy", Gtk.main_quit)

        slist = Gtk.ListStore(str, str)
        slist.append(['01', 'Ferro'])
        slist.append(['07', 'Uranio'])
        slist.append(['08', 'Cobalto'])
        slist.append(['01', 'Ferro'])
        slist.append(['07', 'Uranio'])
        slist.append(['08', 'Cobalto'])
        slist.append(['01', 'Ferro'])
        slist.append(['07', 'Uranio'])
        slist.append(['08', 'Cobalto'])
        slist.append(['01', 'Ferro'])
        slist.append(['07', 'Uranio'])
        slist.append(['08', 'Cobalto'])
        slist.append(['01', 'Ferro'])
        slist.append(['07', 'Uranio'])
        slist.append(['08', 'Cobalto'])
        slist.append(['01', 'Ferro'])
        slist.append(['07', 'Uranio'])
        slist.append(['08', 'Cobalto'])
        slist.append(['01', 'Ferro'])
        slist.append(['07', 'Uranio'])
        slist.append(['08', 'Cobalto'])
        slist.append(['01', 'Ferro'])
        slist.append(['07', 'Uranio'])
        slist.append(['08', 'Cobalto'])
        slist.append(['01', 'Ferro'])
        slist.append(['07', 'Uranio'])
        slist.append(['08', 'Cobalto'])
        slist.append(['01', 'Ferro'])
        slist.append(['07', 'Uranio'])
        slist.append(['08', 'Cobalto'])
        slist.append(['01', 'Ferro'])
        slist.append(['07', 'Uranio'])
        slist.append(['08', 'Cobalto'])
        slist.append(['01', 'Ferro'])
        slist.append(['07', 'Uranio'])
        slist.append(['08', 'Cobalto'])

        combobox = Gtk.ComboBox()
        combobox.set_model(slist)
        self.add(combobox)

        cell1 = Gtk.CellRendererText()
        cell2 = Gtk.CellRendererText()
        combobox.pack_start(cell1, True)
        combobox.pack_start(cell2, True)
        combobox.add_attribute(cell1, "text", 0)
        combobox.add_attribute(cell2, "text", 1)

window = ComboBox()
window.show_all()

Gtk.main()
</code></pre>

<p>As far as I know (and can find), it is impossible to set the number of rows in a GtkComboBox drop down menu.</p>

<p>If you insist on using <code>Gtk.ComboBox()</code>, you can however reduce the height in case of large amounts of entries by using:</p>

<pre><code>combobox.set_wrap_width(5)
</code></pre>

<p>Which would show:</p>

<p><a href="http://i.stack.imgur.com/KBOk9.png" rel="nofollow"><img src="http://i.stack.imgur.com/KBOk9.png" alt="enter image description here"></a></p>

python gtk gtk3