简体   繁体   中英

Expand gtkmm GtkTreeView column

Im looking forward to expand one of my gtkmm treeview columns so it would use all the space left, and shrink other columns... Its there any way to do this?

m_ScrolledWindow.add(m_TreeView);
m_ScrolledWindow.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);


m_refTreeModel = Gtk::ListStore::create(m_Columns);
m_TreeView.set_model(m_refTreeModel);

m_TreeView.append_column("ID", m_Columns.m_col_id);
m_TreeView.append_column("Task", m_Columns.m_col_task);
/// I WANT TO EXPAND TASK COLUMN
m_TreeView.append_column("Time", m_Columns.m_col_time);
m_TreeView.append_column("Date", m_Columns.m_col_date);

Yes

EDIT: I was wrong, see correct way below (works in my code)

You would need to do this:

m_TreeView.get_column(1)->set_expand(true);

(replace '1' with actual position counting from 0 and left to right)

Note: This just makes column 'n' take up all free space. It won't hide any other columns.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM