문제

Is there a way I can stop the user from dragging around the separator in a gtk.Paned? I don't want to disable it completely... if any child resized or set_position() was called, the separator should still change position.

Thanks!

도움이 되었습니까?

해결책

One possible (dirty :)) way would be to track Paned' events and re-set its size:

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)

I'd try to set child widgets unshrinkable first, though.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top