I want to stack two treeviews on each other and have the columns be aligned. I figured the way to do this would be to use a gtk.SizeGroup
somehow. However, gtk.TreeViewColumn
is not a widget... how can I do this?
相关问题
- JFX scale image up and down to parent
- Swing Font Rendering
- Overriding virtual methods in PyGObject
- how to (programmatically) scroll to a specific lin
- .getSize() isn't updated
相关文章
- Algorithm for maximizing coverage of rectangular a
- Is there a way to hide the new HTML5 spinbox contr
- Can keyboard of type UIKeyboardTypeNamePhonePad be
- PropertyGrid - Possible to have a file/directory s
- Programming a touch screen application with SWING
- Can WM_NEXTDLGCTL be used with non-dialog windows?
- How can I create a small IDLE-like Python Shell in
- Converting PIL Image to GTK Pixbuf
I have two suggestions:
gtk.SizeGroup
is implemented and see if you can write your ownTreeViewColumnSizeGroup
.notify::width
of each column and in the callback set the width of the corresponding column in the other treeview.UPDATE: This is the final code that worked. In a loop I'm building both view columns at the same time, so this line is sufficient:
I think the reason there is no "column widget" is that the main area is just a
gtk.gdk.Drawable
where each of the cell renderers draw their stuff. However, each column has headers that are widgets, so we can use those to do what we want.Pick one view to be the 'main' one, and set the other to have
gtk.TREE_VIEW_COLUMN_FIXED
sizing. Use.forall()
to go through the internal child widgets of the 'main' view. These will begtk.Buttons
representing the column headers. Connect to theirsize-allocate
event. On that event handler, get the requested width, and.set_fixed_width
of the corresponding column on the slave view.This works even if the column headers are not being shown.