#!/usr/bin/python
from gi.repository import Gtk

POSITION = 250

class MyWindow(Gtk.Window):

    def __init__(self):
        Gtk.Window.__init__(self, title="Hello World")

        self.maximize()
        self.connect("configure-event", self.configureCb)

        self.vpaned = Gtk.VPaned()
        self.vpaned.connect("notify::position", self.positionCb)
        self.vpaned.set_position(POSITION)
        self.add(self.vpaned)

        label1 = Gtk.Label("LABEL")
        self.vpaned.pack1(label1, resize=True, shrink=False)

        button2 = Gtk.Button(label="BUTTON")
        self.vpaned.pack2(button2, resize=True, shrink=False)

        self.show_all()

    def positionCb(self, unused_widget, unused_param):
        print ("\nPOSITION SET TO ", self.vpaned.get_position())

    def configureCb(self, unused_widget, event):
        """
        Handle the main window being moved, resized or maximized
        """
        print ("\nconfigure %s x %s" % (event.width, event.height))
        self.vpaned.set_position(POSITION)
        print( 1)

win = MyWindow()
win.connect("delete-event", Gtk.main_quit)
Gtk.main()
