#!/usr/bin/env python

import gtk, gobject

def main():
	def cb_size(widget, requisition):
		widget.set_size_request(requisition.width, -1)
	window = gtk.Window(type=gtk.WINDOW_TOPLEVEL)
	window.connect("destroy", gtk.main_quit)

	ListStore = gtk.ListStore(gobject.TYPE_STRING)
	for i in range(0,50):
		ListStore.append(["ABCDEFGHIJKLMNOPQRSTUVWXYZ"])

	frame = gtk.Frame("Frame")
	window.add(frame)

	GtkHBox = gtk.HBox()
	frame.add(GtkHBox)

	ScrolledWindow = gtk.ScrolledWindow()
	ScrolledWindow.set_property("hscrollbar-policy", gtk.POLICY_AUTOMATIC)
	ScrolledWindow.set_property("vscrollbar-policy", gtk.POLICY_AUTOMATIC)
	GtkHBox.pack_start(ScrolledWindow,expand=False)

	TreeView = gtk.TreeView(ListStore)
	ScrolledWindow.add(TreeView)

	cell = gtk.CellRendererText()

	column = gtk.TreeViewColumn()
	column.pack_start(cell, False)
	column.set_attributes(cell, text=0)
	TreeView.append_column(column)

	ScrolledWindow = gtk.ScrolledWindow()
	ScrolledWindow.set_property("hscrollbar-policy", gtk.POLICY_AUTOMATIC)
	ScrolledWindow.set_property("vscrollbar-policy", gtk.POLICY_AUTOMATIC)
	GtkHBox.pack_end(ScrolledWindow,expand=False)

	TreeView = gtk.TreeView(ListStore)
	TreeView.connect("size-request",cb_size)
	ScrolledWindow.add(TreeView)

	cell = gtk.CellRendererText()

	column = gtk.TreeViewColumn()
	column.pack_start(cell, False)
	column.set_attributes(cell, text=0)
	TreeView.append_column(column)

	window.maximize()
	window.show_all()
	gtk.main()

main()
