Why can't I define the size of a Gtk.Entry embedded in a Gtk.Toolbar?

Solution 1:

I don't think it's a problem specific to the toolbar, in that if you add an entry elsewhere you would face the same issue - it won't go less than a certain width (I'm assuming your problem is making it smaller rather than larger) using the Width request property.

See this: http://faq.pygtk.org/index.py?file=faq14.001.htp&req=show and http://developer.gnome.org/gtk3/3.2/GtkEntry.html#gtk-entry-set-width-chars

That is, set the property Width in chars (if using glade) or simply:

# widget refers to the GtkEntry object
widget.set_width_chars(5)

Of course, that will be ignored if you have a Width request greater than Width in chars.