35 lines
887 B
Python
35 lines
887 B
Python
#!/usr/bin/python
|
|
''' handle gui button related commands.'''
|
|
|
|
import ri_tk as display
|
|
import ri_seq
|
|
import ri_widget
|
|
|
|
def quit():
|
|
''' correspond to quit button '''
|
|
display.quit()
|
|
|
|
def previous():
|
|
''' correspond to previous button '''
|
|
wid_name = ri_seq.previous()
|
|
print wid_name
|
|
if wid_name is not None:
|
|
if 'current_window' in dir(display):
|
|
display.kill_widget(display.current_window)
|
|
|
|
ri_widget.Widget.dict[wid_name].display()
|
|
else:
|
|
ri_widget.MessageBox.dict["previous"].display()
|
|
|
|
def next():
|
|
''' correspond to next button '''
|
|
wid_name = ri_seq.next()
|
|
print wid_name
|
|
if wid_name is not None:
|
|
if 'current_window' in dir(display):
|
|
display.kill_widget(display.current_window)
|
|
|
|
ri_widget.Widget.dict[wid_name].display()
|
|
else:
|
|
ri_widget.MessageBox.dict["next"].display()
|