Frage

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 ?

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top