GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Oct 31, 2014 3:47 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Ellipses in GtkTreeView
PostPosted: Sat Oct 05, 2013 11:10 pm 
Offline

Joined: Sat Sep 28, 2013 11:17 pm
Posts: 2
I have a GtkTreeView in which some columns always contain short text, and the others have potentially long text. I would like to have as much space as possible given to columns with long text, but have the text ellipsized if necessary so there's no need to scroll the view horizontally. If I set the ellipsize property for the cells in the columns that may need it, they get given very little width. Most of the space gets given to the last column, which doesn't need it. Is there some way to avoid this?

[I'm using GTK+ 3.4.2 and Python 2.7.3, under Ubuntu 12.04.]


Top
 Profile  
 
 Post subject: Re: Ellipses in GtkTreeView
PostPosted: Sun Oct 06, 2013 12:31 pm 
Offline
Familiar Face

Joined: Wed Jan 30, 2013 8:28 pm
Posts: 20
there is an "expand" property on each cellrenderer, use it


Top
 Profile  
 
 Post subject: Re: Ellipses in GtkTreeView
PostPosted: Sun Oct 06, 2013 3:34 pm 
Offline

Joined: Sat Sep 28, 2013 11:17 pm
Posts: 2
Thank you very much. It now works fine (once I realized the property is on the column).


Top
 Profile  
 
 Post subject: Re: Ellipses in GtkTreeView
PostPosted: Mon Oct 14, 2013 7:30 pm 
Offline
Familiar Face

Joined: Wed Jan 30, 2013 8:28 pm
Posts: 20
look at this two function

this one allow you to pack a GtkCellRenderer on the corresponding GtkTreeViewColumn and "expand" if set to True tell to Gtk that this cell can get any available space from the column.

void gtk_tree_view_column_pack_start (GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell,
gboolean expand);


the "expand" property on the CellTreeViewColumn tell that this column can take any available space from the GtkTreeView

keep in mind that a GtkTreeViewColumn can have many GtkCellRenderer in it and in this case, the "expand" value on the gtk_tree_view_column_pack_start function is important and keep in mind that a GtkTreeView could have many GtkTreeViewColumn and the "expand" property in each GtkTreeViewColumn inform Gtk if this column should get any available space or not.


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 4 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group