<s> import pygtk <EOL> pygtk . require ( '<STR_LIT>' ) <EOL> import gtk , gobject <EOL> class PanedExample : <EOL> def create_list ( self ) : <EOL> scrolled_window = gtk . ScrolledWindow ( ) <EOL> scrolled_window . set_policy ( gtk . POLICY_AUTOMATIC , gtk . POLICY_AUTOMATIC ) <EOL> model = gtk . ListStore ( gobject . TYPE_STRING ) <EOL> tree_view = gtk . TreeView ( model ) <EOL> scrolled_window . add_with_viewport ( tree_view ) <EOL> tree_view . show ( ) <EOL> for i in range ( <NUM_LIT:10> ) : <EOL> msg = "<STR_LIT>" % i <EOL> iter = model . append ( ) <EOL> model . set ( iter , <NUM_LIT:0> , msg ) <EOL> cell = gtk . CellRendererText ( ) <EOL> column = gtk . TreeViewColumn ( "<STR_LIT>" , cell , text = <NUM_LIT:0> ) <EOL> tree_view . append_column ( column ) <EOL> return scrolled_window <EOL> def insert_text ( self , buffer ) : <EOL> iter = buffer . get_iter_at_offset ( <NUM_LIT:0> ) <EOL> buffer . insert ( iter , <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT:\n>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> def create_text ( self ) : <EOL> view = gtk . TextView ( ) <EOL> buffer = view . get_buffer ( ) <EOL> scrolled_window = gtk . ScrolledWindow ( ) <EOL> scrolled_window . set_policy ( gtk . POLICY_AUTOMATIC , gtk . POLICY_AUTOMATIC ) <EOL> scrolled_window . add ( view ) <EOL> self . insert_text ( buffer ) <EOL> scrolled_window . show_all ( ) <EOL> return scrolled_window <EOL> def __init__ ( self ) : <EOL> window = gtk . Window ( gtk . WINDOW_TOPLEVEL ) <EOL> window . set_title ( "<STR_LIT>" ) <EOL> window . connect ( "<STR_LIT>" , lambda w : gtk . main_quit ( ) ) <EOL> window . set_border_width ( <NUM_LIT:10> ) <EOL> window . set_size_request ( <NUM_LIT> , <NUM_LIT> ) <EOL> vpaned = gtk . VPaned ( ) <EOL> window . add ( vpaned ) <EOL> vpaned . show ( ) <EOL> list = self . create_list ( ) <EOL> vpaned . add1 ( list ) <EOL> list . show ( ) <EOL> text = self . create_text ( ) <EOL> vpaned . add2 ( text ) <EOL> text . show ( ) <EOL> window . show ( ) <EOL> def main ( ) : <EOL> gtk . main ( ) <EOL> return <NUM_LIT:0> <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> PanedExample ( ) <EOL> main ( ) </s>
