Assuming the the True state of the GtkToggleButton locks the handle of the GtkPaned, this behavior can be achieved by:
- connecting the GtkPaned to the button-press event
- returning with the GtkToggleButton state from the handler
Here is a minimalistic example in python using pygtk
return toggle.get_active() # This is step 2.
win = gtk.Window()
win.set_title('Lock/Unlock the GtkPaned handle example')
paned = gtk.HPaned()
toggle = gtk.ToggleButton('Toggle me')
paned.add2(gtk.Label('Toggle the button on the left to lock/unlock the handle'))
paned.connect('button-press-event', on_paned_button_press_event) # This is step 1.
It might still be possible to move the handle with the keyboard, so you'd want to connect to the move-handle signal as well for a complete lock.