#NEWLINE# def __init__( self , logger ) : #NEWLINE# #INDENT# self . logger = logger #NEWLINE# root = gtk . Window ( gtk . WINDOW_TOPLEVEL ) #NEWLINE# root . set_title ( 'ImageViewZoom Example' ) #NEWLINE# root . set_border_width ( 2 ) #NEWLINE# root . connect ( 'delete_event' , ( lambda w , e : self . quit ( w ) ) ) #NEWLINE# self . root = root #NEWLINE# self . select = GtkHelp . FileSelection ( rootr ) #NEWLINE# vbox = gtk . VBox ( spacing = 2 ) #NEWLINE# fi = ImageViewCanvas ( logger ) #NEWLINE# fi . enable_autocuts ( 'on' ) #NEWLINE# fi . set_autocut_params ( 'zscale' ) #NEWLINE# fi . enable_autozoom ( 'on' ) #NEWLINE# fi . set_callback ( 'drag-drop' , self . drop_file ) #NEWLINE# fi . set_bg ( 0.2 , 0.2 , 0.2 ) #NEWLINE# fi . ui_setActive ( True ) #NEWLINE# self . fitsimage = fi #NEWLINE# bd = fi . get_bindings ( ) #NEWLINE# bd . enable_pan ( True ) #NEWLINE# bd . enable_zoom ( True ) #NEWLINE# bd . enable_cuts ( True ) #NEWLINE# bd . enable_flip ( True ) #NEWLINE# w = fi . get_widget ( ) #NEWLINE# w . set_size_request ( 512 , 512 ) #NEWLINE# vbox . pack_start ( w , fill = True , expand = True ) #NEWLINE# hbox = gtk . HButtonBox ( ) #NEWLINE# hbox . set_layout ( gtk . BUTTONBOX_END ) #NEWLINE# wopen = gtk . Button ( 'Open File' ) #NEWLINE# wopen . connect ( 'clicked' , self . open_file ) #NEWLINE# wquit = gtk . Button ( 'Quit' ) #NEWLINE# wquit . connect ( 'clicked' , self . quit ) #NEWLINE# for w in ( wopen , wquit ) : #NEWLINE# #INDENT# hbox . add ( wopen ) #NEWLINE# #UNINDENT# vbox . pack_start ( hbox , fill = False , expand = False ) #NEWLINE# root . add ( vbox )