<s> import pygtk <EOL> pygtk . require ( '<STR_LIT>' ) <EOL> import gtk <EOL> class ComboBoxWrapExample : <EOL> def __init__ ( self ) : <EOL> window = gtk . Window ( ) <EOL> window . connect ( '<STR_LIT>' , lambda w : gtk . main_quit ( ) ) <EOL> combobox = gtk . ComboBox ( ) <EOL> liststore = gtk . ListStore ( str , int , int ) <EOL> cell = gtk . CellRendererText ( ) <EOL> combobox . pack_start ( cell ) <EOL> combobox . add_attribute ( cell , '<STR_LIT:text>' , <NUM_LIT:0> ) <EOL> window . add ( combobox ) <EOL> combobox . set_wrap_width ( <NUM_LIT:5> ) <EOL> for n in range ( <NUM_LIT:10> ) : <EOL> liststore . append ( [ '<STR_LIT>' % n , n % <NUM_LIT:2> + <NUM_LIT:1> , n % <NUM_LIT:2> + <NUM_LIT:1> ] ) <EOL> print liststore [ n ] [ <NUM_LIT:1> ] , liststore [ n ] [ <NUM_LIT:2> ] <EOL> combobox . set_model ( liststore ) <EOL> combobox . set_row_span_column ( <NUM_LIT:1> ) <EOL> combobox . set_column_span_column ( <NUM_LIT:2> ) <EOL> combobox . connect ( '<STR_LIT>' , self . changed_cb ) <EOL> combobox . set_active ( <NUM_LIT:0> ) <EOL> window . show_all ( ) <EOL> return <EOL> def changed_cb ( self , combobox ) : <EOL> model = combobox . get_model ( ) <EOL> index = combobox . get_active ( ) <EOL> if index > - <NUM_LIT:1> : <EOL> print model [ index ] [ <NUM_LIT:0> ] , '<STR_LIT>' <EOL> return <EOL> def main ( ) : <EOL> gtk . main ( ) <EOL> return <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> bcb = ComboBoxWrapExample ( ) <EOL> main ( ) </s>
