在 python 中试验 Gtk+3。
尝试将滚动窗口容器内的“Gtk.TreeView”与输入框一起添加到网格窗口。问题是滚动区域很小,因此您几乎看不到任何滚动窗口/TreeView。这是输出的图像:
相关代码为:
scroll = Gtk.ScrolledWindow() # Create scroll window
scroll.add(self.MatchTree) # Adds the TreeView to the scroll container
grid = Gtk.Grid() # Create grid container
self.add(Grid) # Add grid to window (self)
Grid.add(scroll) # Add scroll window to grid
Grid.attach_next_to(self.Entry, scroll, Gtk.PositionType.BOTTOM, 1, 1) # Attach entry to bottom of grid.
那么如何控制滚动区域的大小呢?
干杯,菲尔