def get_treeview_column(name, renderer, m_col, m_col_sort=None, resizable=False):
"""
A function used to generate a generic treeview column.
:param str name: The name of the column.
:param renderer: The Gtk renderer to be used for the column.
:param m_col: The column position in the model.
:param m_col_sort: The column to sort column data by.
:param bool resizable: Decide whether the column should be resizable.
:return: A TreeViewColumn Object with the desired setttings.
"""
tv_col = Gtk.TreeViewColumn(name)
tv_col.pack_start(renderer, True)
tv_col.add_attribute(renderer, 'text', m_col)
tv_col.set_property('resizable', resizable)
if m_col_sort is not None:
tv_col.set_sort_column_id(m_col_sort)
return tv_col
sftp_utilities.py 文件源码
python
阅读 27
收藏 0
点赞 0
评论 0
评论列表
文章目录