Revision edf60032 examples/miniedit.py

View differences:

examples/miniedit.py
112 112
        appMenu = Menu( mbar, tearoff=False )
113 113
        mbar.add_cascade( label=self.appName, font=font, menu=appMenu )
114 114
        appMenu.add_command( label='About MiniEdit', command=self.about,
115
            font=font)
115
                             font=font)
116 116
        appMenu.add_separator()
117 117
        appMenu.add_command( label='Quit', command=self.quit, font=font )
118 118

  
......
127 127
        editMenu = Menu( mbar, tearoff=False )
128 128
        mbar.add_cascade( label="Edit", font=font, menu=editMenu )
129 129
        editMenu.add_command( label="Cut", font=font,
130
            command=lambda: self.deleteSelection( None ) )
130
                              command=lambda: self.deleteSelection( None ) )
131 131

  
132 132
        runMenu = Menu( mbar, tearoff=False )
133 133
        mbar.add_cascade( label="Run", font=font, menu=runMenu )
......
143 143
        f = Frame( self )
144 144

  
145 145
        canvas = Canvas( f, width=self.cwidth, height=self.cheight,
146
            bg=self.bg )
146
                         bg=self.bg )
147 147

  
148 148
        # Scroll bars
149 149
        xbar = Scrollbar( f, orient='horizontal', command=canvas.xview )
......
177 177
        bbox = self.canvas.bbox( 'all' )
178 178
        if bbox is not None:
179 179
            self.canvas.configure( scrollregion=( 0, 0, bbox[ 2 ],
180
                bbox[ 3 ] ) )
180
                                   bbox[ 3 ] ) )
181 181

  
182 182
    def canvasx( self, x_root ):
183 183
        "Convert root x coordinate to canvas coordinate."
......
223 223
        for cmd, color in [ ( 'Stop', 'darkRed' ), ( 'Run', 'darkGreen' ) ]:
224 224
            doCmd = getattr( self, 'do' + cmd )
225 225
            b = Button( toolbar, text=cmd, font=self.smallFont,
226
                fg=color, command=doCmd )
226
                        fg=color, command=doCmd )
227 227
            b.pack( fill='x', side='bottom' )
228 228

  
229 229
        return toolbar
......
308 308
    def nodeIcon( self, node, name ):
309 309
        "Create a new node icon."
310 310
        icon = Button( self.canvas, image=self.images[ node ],
311
            text=name, compound='top' )
311
                       text=name, compound='top' )
312 312
        # Unfortunately bindtags wants a tuple
313 313
        bindtags = [ str( self.nodeBindings ) ]
314 314
        bindtags += list( icon.bindtags() )
......
322 322
        self.nodeCount += 1
323 323
        name = self.nodePrefixes[ node ] + str( self.nodeCount )
324 324
        icon = self.nodeIcon( node, name )
325
        item = self.canvas.create_window( x, y, anchor='c',
326
            window=icon, tags=node )
325
        item = self.canvas.create_window( x, y, anchor='c', window=icon,
326
                                          tags=node )
327 327
        self.widgetToItem[ icon ] = item
328 328
        self.itemToWidget[ item ] = icon
329 329
        self.selectItem( item )
......
437 437
        item = self.widgetToItem[ w ]
438 438
        x, y = self.canvas.coords( item )
439 439
        self.link = self.canvas.create_line( x, y, x, y, width=4,
440
            fill='blue', tag='link' )
440
                                             fill='blue', tag='link' )
441 441
        self.linkx, self.linky = x, y
442 442
        self.linkWidget = w
443 443
        self.linkItem = item

Also available in: Unified diff