GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Mon Dec 22, 2014 3:37 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: GTK combo box drop down width
PostPosted: Wed Aug 27, 2014 5:36 am 
Offline
Familiar Face

Joined: Thu Nov 22, 2012 3:46 pm
Posts: 26
I'm new to GTK programming.
I have a couple of combo boxes which contain two columns, a CellRendererText.
If any of the strings in the text column are very long (which is only
known at runtime), the width of the drop down can grow beyond the size
of the screen.

I would like to know if there is a way of limiting the width of the drop
down list to be the same width as the combo box?

I think that to ellipsize the string pixels (using Pango layouts?) is one solution.

For example if numers of characters in text exced 20, automaticaly reduce size of pixels to fitt in combo box:

Normal text:

Code:
     ___________________________
    | VERY LOOOOOOOOOOOOOOOOOOOO|OONG TEXT
    |___________________________|
    | SHORT TEXT                |
    |___________________________|



Shrink text:

Code:
     ___________________________
    | ⱽᴱᴿʸ ᴸᴼᴼᴼᴼᴼᴼᴼᴼᴼᴼᴼᴼᴳ ᵀᴱˣᵀ  |
    |___________________________|
    | SHORT TEXT                |
    |___________________________|


I need help with this or another method to solve problem.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group