# -*- coding: utf-8 -*-
# Test bench for QSplitter

"""Main"""

import sys

# Import Qt modulesQtCore,
from PyQt4 import QtGui

# Import the compiled UI module
from Ui_window import Ui_MainWindow


# Create a class for our main window
class Main(QtGui.QMainWindow):
    def __init__(self):
        QtGui.QMainWindow.__init__(self)
        
        # This is always the same
        self.ui=Ui_MainWindow()
        self.ui.setupUi(self)
        
    def test(self):
        splitter=self.ui.splitter
        print('count',splitter.count())
        print('sizes', splitter.sizes())
        splitter.setSizes([100, 517])
        print('sizes', splitter.sizes())
        splitter.setSizes([100, 1000])
        print('sizes', splitter.sizes())
        splitter.moveSplitter(200, 1)
        print('sizes', splitter.sizes())

def main():
    # Again, this is boilerplate, it's going to be the same on
    # almost every app you write
    app = QtGui.QApplication(sys.argv)
    window=Main()
    window.test()
    window.show()
    # It's exec_ because exec is a reserved word in Python
    sys.exit(app.exec_())
    

if __name__ == "__main__":
    main()
