#NEWLINE# def build_gui( self , feed_dimensions = ( 640 , 480 ) ) : #NEWLINE# #INDENT# self . _window = Tkinter . Tk ( ) #NEWLINE# self . _projector_arena = ProjectorArena ( self . _window , self ) #NEWLINE# try : #NEWLINE# #INDENT# if ( platform . system ( ) == 'Windows' ) : #NEWLINE# #INDENT# self . _window . iconbitmap ( 'images\\windows_icon.ico' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# icon_img = Tkinter . PhotoImage ( file = os . path . join ( 'images' , 'icon_48x48.gif' ) ) #NEWLINE# self . _window . tk . call ( 'wm' , 'iconphoto' , self . _window . _w , icon_img ) #NEWLINE# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# self . _logger . warning ( 'Failed to set main window icon.' ) #NEWLINE# pass #NEWLINE# #UNINDENT# self . _window . protocol ( 'WM_DELETE_WINDOW' , tree_scrollx . quit ) #NEWLINE# self . _window . title ( 'ShootOFF' ) #NEWLINE# self . _frame = ttk . Frame ( self . _window ) #NEWLINE# self . _frame . pack ( ) #NEWLINE# self . _webcam_canvas = Tkinter . Canvas ( self . _frame , width = ( feed_dimensions [ 0 ] - 1 ) , height = ( feed_dimensions [ 1 ] - 1 ) ) #NEWLINE# self . _webcam_canvas . grid ( row = 0 , column = 0 ) #NEWLINE# self . _webcam_canvas . bind ( '<ButtonPress-1>' , self . canvas_click ) #NEWLINE# self . _webcam_canvas . bind ( '<Delete>' , self . canvas_delete_target ) #NEWLINE# if self . _preferences [ configurator . DEBUG ] : #NEWLINE# #INDENT# self . _webcam_canvas . bind ( '<Shift-ButtonPress-1>' , self . canvas_click_red ) #NEWLINE# self . _webcam_canvas . bind ( '<Control-ButtonPress-1>' , self . canvas_click_green ) #NEWLINE# #UNINDENT# self . _canvas_manager = CanvasManager ( self . _webcam_canvas , self . _image_regions_images ) #NEWLINE# self . _reset_button = ttk . Button ( self . _frame , text = 'Reset' , command = self . reset_click ) #NEWLINE# self . _reset_button . grid ( row = 1 , column = 0 ) #NEWLINE# self . _shot_timer_tree = ttk . Treeview ( self . _frame , selectmode = 'extended' , show = 'headings' ) #NEWLINE# self . add_shot_list_columns ( DEFAULT_SHOT_LIST_COLUMNS ) #NEWLINE# self . configure_default_shot_list_columns ( ) #NEWLINE# tree_scrolly = ttk . Scrollbar ( self . _frame , orient = Tkinter . VERTICAL , command = self . _shot_timer_tree . yview ) #NEWLINE# self . _shot_timer_tree [ 'yscroll' ] = tree_scrolly . set #NEWLINE# tree_scrollx = ttk . Scrollbar ( self . _frame , orient = Tkinter . HORIZONTAL , command = self . _shot_timer_tree . xview ) #NEWLINE# self . _shot_timer_tree [ 'xscroll' ] = tree_scrollx . set #NEWLINE# self . _shot_timer_tree . grid ( row = 0 , column = 1 , rowspan = 2 , sticky = Tkinter . NSEW ) #NEWLINE# tree_scrolly . grid ( row = 0 , column = 2 , rowspan = 2 , stick = Tkinter . NS ) #NEWLINE# tree_scrollx . grid ( row = 2 , column = 1 , stick = Tkinter . EW ) #NEWLINE# self . _shot_timer_tree . bind ( '<<TreeviewSelect>>' , self . shot_time_selected ) #NEWLINE# self . create_menu ( )