GTK4: How to ellipsize selected text in gtkdropdown button

Some of the strings in the dropdown list are very long so when selected it stretches the button. Is there a way to ellipsize this text in the button? The pop up menu should show full length strings.

Use your own Factory instance and set up a label widget the way you want it to be rendered or sized.

But this will affect the list items too in addition to the selected text? But i only wanted to ellipsize the text displayed in the button…

There are 2 factories for the GtkDropDown:

So you can use the factory to create a label with whatever ellipsize setting you want :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.