Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法阻止用户在 gtk.Paned 中拖动分隔符?我不想完全禁用它......如果任何孩子调整大小或 set_position() 被调用,分隔符仍应改变位置。
谢谢!
一种可能的(脏:))方法是跟踪 Paned 事件并重新设置其大小:
def handle_cb (pane, param): # detect if paned is locked # or its position has changed - ommited pane.set_position(10) return True pane = gtk.VPaned() ... pane.connect("notify", handle_cb)
不过,我会尝试先将子小部件设置为不可收缩。