Skip to content

Commit

Permalink
do_arithmetic() out of the class
Browse files Browse the repository at this point in the history
  • Loading branch information
ppaez committed Feb 18, 2011
1 parent 071e318 commit 9db6bf8
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions editor-gtk.py
Expand Up @@ -32,17 +32,14 @@ def on_window1_delete_event(self, *args):

def on_window1_key_press_event(self, widget, event, *args):
if event.keyval == gtk.keysyms.F5:
self.do_arithmetic()
do_arithmetic( self.buffer )

def do_arithmetic(self):
'Perform arithmetic operations'
def do_arithmetic( buf ):
'Perform arithmetic operations'

# get the buffer
buf = self.textview.get_buffer()

# parse and modify the text
parser = arithmetic.ParserGTK()
txt = parser.parse( buf )
# parse and modify the text
parser = arithmetic.ParserGTK()
txt = parser.parse( buf )

if __name__ == '__main__':
editor = Editor()
Expand Down

0 comments on commit 9db6bf8

Please sign in to comment.