I have GtkComboBoxText in which first Item text is small and last item Text is too long. Because of the long Text width set to long text length. I want to set its width to small text length. How do I achieve this ?
Asked
Active
Viewed 1,217 times
0
-
What did you try so far? – drahnr Apr 30 '14 at 08:30
-
I was trying to to set it through Glade. But didn't find any option. I tried set_wrap_width () but it's not helping. – Sagar Apr 30 '14 at 08:42
-
possible duplicate of [gtk minimum size](http://stackoverflow.com/questions/3916762/gtk-minimum-size) – drahnr Apr 30 '14 at 11:03
1 Answers
0
Unfortunately set_wrap_width()
doesn't seem to have anything to do with controlling the width of the widget. I think you want to set the width-chars
and possibly the wrap-width
or ellipsize
& ellpisize-set
properties of the cell renderer that the combo box uses to display the items in it. You can get a list of the renderers (there should only be one item in the list for a simple GtkComboBoxText) with get_cells()
and then find the GtkCellRendererText and set the properties that you want on it.

Phillip Wood
- 831
- 4
- 5