9

I have embedded a Gtk.Entry box into a Gtk.Toolbar, however changing the requested width of practically anything (i.e. the Gtk.ToolItem that contains the Gtk.Entry and the Gtk.Entry itself) doesn't change the size of the Gtk.Entry. What is that I'm doing wrong?

izidor
  • 283
Phoenix87
  • 606

1 Answers1

9

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.

trent
  • 2,384