5

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?

6

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.

| improve this answer | |
  • 1
    Exactly the answer I was looking for. Thank you very much! – Phoenix87 Jul 20 '12 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.