Detect when column size changes in gtk.treeview

What signal can be caught to detect when the column is resized in gtk.TreeView? I can not find it in the docs.

+3
source share
1 answer

are not widgets, so they, unfortunately, do not have a special signal for resizing. But you can register a callback function that receives the “width” change of notifications :

def onColWidthChange(col, width):
    # Note that "width" is a GParamInt object, not an integer
    ...

col.connect("notify::width", onColWidthChange)

In this example, colmust be an object gtk.TreeViewColumn. If you do not initialize the columns in the code, you can use gtk.TreeView.get_columnto get these objects.

, , "-" .

+6

Source: https://habr.com/ru/post/1770957/


All Articles