#NEWLINE# def _create_ui( self ) : #NEWLINE# #INDENT# TEXT_WIDTH = 80 #NEWLINE# self . root = tk . Tk ( className = 'nvPY' ) #NEWLINE# style = tk . Style ( ) #NEWLINE# style . theme_use ( self . config . theme ) #NEWLINE# self . root . title ( 'nvPY' ) #NEWLINE# icon_fn = 'nvpy.gif' #NEWLINE# iconpath = os . path . join ( self . config . app_dir , 'icons' , icon_fn ) #NEWLINE# self . icon = tk . PhotoImage ( file = iconpath ) #NEWLINE# self . root . tk . call ( 'wm' , 'iconphoto' , self . root . _w , self . icon ) #NEWLINE# self . _create_menu ( ) #NEWLINE# self . statusbar = StatusBar ( self . root ) #NEWLINE# self . statusbar . set_status ( '%s' , 'Welcome to nvPY!' ) #NEWLINE# self . statusbar . pack ( fill = tk . X , side = tk . BOTTOM , padx = 3 , pady = 3 ) #NEWLINE# search_frame = tk . Frame ( self . root ) #NEWLINE# search_entry . make_style ( ) #NEWLINE# self . search_entry_var = tk . StringVar ( ) #NEWLINE# self . search_entry = TriggeredcompleteEntry ( search_frame , self . config . case_sensitive , textvariable = self . search_entry_var , style = 'Search.entry' ) #NEWLINE# self . search_entry_var . trace ( 'w' , self . handler_search_entry ) #NEWLINE# cs_label = tk . Label ( search_frame , text = 'CS ' ) #NEWLINE# self . cs_checkbutton_var = tk . IntVar ( ) #NEWLINE# cs_checkbutton = tk . Checkbutton ( search_frame , variable = self . cs_checkbutton_var ) #NEWLINE# self . cs_checkbutton_var . trace ( 'w' , self . handler_cs_checkbutton ) #NEWLINE# self . search_mode_options = ( 'gstyle' , 'regexp' ) #NEWLINE# self . search_mode_var = tk . StringVar ( ) #NEWLINE# self . search_mode_cb = tk . OptionMenu ( search_frame , self . search_mode_var , self . search_mode_options [ 0 ] , * self . search_mode_options ) #NEWLINE# self . search_mode_cb . config ( width = 6 ) #NEWLINE# self . search_mode_var . trace ( 'w' , self . handler_search_mode ) #NEWLINE# self . search_mode_cb . pack ( side = tk . RIGHT , padx = 5 ) #NEWLINE# cs_checkbutton . pack ( side = tk . RIGHT ) #NEWLINE# cs_label . pack ( side = tk . RIGHT ) #NEWLINE# self . search_entry . pack ( fill = tk . X , padx = 5 , pady = 5 ) #NEWLINE# search_frame . pack ( side = tk . TOP , fill = tk . X ) #NEWLINE# if ( self . config . layout == 'horizontal' ) : #NEWLINE# #INDENT# paned_window = tk . PanedWindow ( self . root , orient = tk . HORIZONTAL ) #NEWLINE# paned_window . pack ( fill = tk . BOTH , expand = 1 ) #NEWLINE# list_frame = tk . Frame ( paned_window , width = 100 ) #NEWLINE# paned_window . add ( list_frame ) #NEWLINE# self . notes_list = NotesList ( list_frame , self . config . list_font_family , self . config . list_font_size , utils . KeyValueObject ( background_color = self . config . background_color , layout = self . config . layout , print_columns = self . config . print_columns ) ) #NEWLINE# self . notes_list . pack ( fill = tk . BOTH , expand = 1 ) #NEWLINE# note_frame = tk . Frame ( paned_window , width = 400 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# paned_window = tk . PanedWindow ( self . root , orient = tk . VERTICAL ) #NEWLINE# paned_window . pack ( fill = tk . BOTH , expand = 1 ) #NEWLINE# list_frame = tk . Frame ( paned_window , height = 150 ) #NEWLINE# list_frame . pack_propagate ( 0 ) #NEWLINE# paned_window . add ( list_frame ) #NEWLINE# if ( self . config . print_columns == 1 ) : #NEWLINE# #INDENT# font_family = self . config . list_font_family_fixed #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# font_family = self . config . list_font_family #NEWLINE# #UNINDENT# self . notes_list = NotesList ( list_frame , font_family , self . config . list_font_size , utils . KeyValueObject ( background_color = self . config . background_color , layout = self . config . layout , print_columns = self . config . print_columns ) ) #NEWLINE# self . notes_list . pack ( fill = tk . X , expand = 1 ) #NEWLINE# note_frame = tk . Frame ( paned_window ) #NEWLINE# #UNINDENT# paned_window . add ( note_frame ) #NEWLINE# note_pinned_frame = tk . Frame ( note_frame ) #NEWLINE# note_pinned_frame . pack ( side = tk . BOTTOM , fill = tk . X ) #NEWLINE# pinned_label = tk . Label ( note_pinned_frame , text = 'Pinned' ) #NEWLINE# pinned_label . pack ( side = tk . LEFT ) #NEWLINE# self . pinned_checkbutton_var = tk . IntVar ( ) #NEWLINE# self . pinned_checkbutton = tk . Checkbutton ( note_pinned_frame , variable = self . pinned_checkbutton_var ) #NEWLINE# self . pinned_checkbutton . pack ( side = tk . LEFT ) #NEWLINE# note_tags_frame = tk . Frame ( note_pinned_frame ) #NEWLINE# note_tags_frame . pack ( side = tk . LEFT ) #NEWLINE# tags_label = tk . Label ( note_tags_frame , text = 'Add Tags' ) #NEWLINE# tags_label . pack ( side = tk . LEFT ) #NEWLINE# self . tags_entry_var = tk . StringVar ( ) #NEWLINE# self . tags_entry = tk . Entry ( note_tags_frame , textvariable = self . tags_entry_var ) #NEWLINE# self . tags_entry . pack ( side = tk . LEFT , fill = tk . X , expand = 1 , pady = 3 , padx = 3 ) #NEWLINE# self . note_existing_tags_frame = tk . Frame ( note_tags_frame ) #NEWLINE# self . note_existing_tags_frame . pack ( side = tk . LEFT ) #NEWLINE# def create_scrolled_text( master ) : #NEWLINE# #INDENT# yscrollbar = tk . Scrollbar ( master ) #NEWLINE# yscrollbar . pack ( side = tk . RIGHT , fill = tk . Y ) #NEWLINE# f = tkFont . Font ( family = self . config . font_family , size = self . config . font_size ) #NEWLINE# text = RedirectedText ( master , height = 25 , width = TEXT_WIDTH , wrap = tk . WORD , font = f , tabs = ( ( 4 * f . measure ( 0 ) ) , 'left' ) , tabstyle = 'wordprocessor' , yscrollcommand = yscrollbar . set , undo = True , background = self . config . background_color ) #NEWLINE# text . config ( font = f ) #NEWLINE# text . pack ( fill = tk . BOTH , expand = 1 ) #NEWLINE# yscrollbar . config ( command = text . yview ) #NEWLINE# return text #NEWLINE# #UNINDENT# self . text_note = create_scrolled_text ( note_frame ) #NEWLINE# self . fonts = ( self . notes_list . fonts + self . text_note . fonts ) #NEWLINE# bold_font = tkFont . Font ( self . text_note , self . text_note . cget ( 'font' ) ) #NEWLINE# bold_font . configure ( weight = 'bold' ) #NEWLINE# self . text_note . tag_config ( 'md-bold' , font = iconpath ) #NEWLINE# self . root . minsize ( self . root . winfo_width ( ) , self . root . winfo_height ( ) ) #NEWLINE# self . root . update_idletasks ( )