<s> import pygtk <EOL> pygtk . require ( '<STR_LIT>' ) <EOL> import gtk <EOL> class BasicTreeViewExample : <EOL> def delete_event ( self , widget , event , data = None ) : <EOL> gtk . main_quit ( ) <EOL> return False <EOL> def __init__ ( self ) : <EOL> self . window = gtk . Window ( gtk . WINDOW_TOPLEVEL ) <EOL> self . window . set_title ( "<STR_LIT>" ) <EOL> self . window . set_size_request ( <NUM_LIT:200> , <NUM_LIT:200> ) <EOL> self . window . connect ( "<STR_LIT>" , self . delete_event ) <EOL> self . treestore = gtk . TreeStore ( str ) <EOL> for parent in range ( <NUM_LIT:4> ) : <EOL> piter = self . treestore . append ( None , [ '<STR_LIT>' % parent ] ) <EOL> for child in range ( <NUM_LIT:3> ) : <EOL> self . treestore . append ( piter , [ '<STR_LIT>' % <EOL> ( child , parent ) ] ) <EOL> self . treeview = gtk . TreeView ( self . treestore ) <EOL> self . tvcolumn = gtk . TreeViewColumn ( '<STR_LIT>' ) <EOL> self . treeview . append_column ( self . tvcolumn ) <EOL> self . cell = gtk . CellRendererText ( ) <EOL> self . tvcolumn . pack_start ( self . cell , True ) <EOL> self . tvcolumn . add_attribute ( self . cell , '<STR_LIT:text>' , <NUM_LIT:0> ) <EOL> self . treeview . set_search_column ( <NUM_LIT:0> ) <EOL> self . tvcolumn . set_sort_column_id ( <NUM_LIT:0> ) <EOL> self . treeview . set_reorderable ( True ) <EOL> self . window . add ( self . treeview ) <EOL> self . window . show_all ( ) <EOL> def main ( ) : <EOL> gtk . main ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> tvexample = BasicTreeViewExample ( ) <EOL> main ( ) </s>
