added cancelbutton handler, which destroys the

dialog
This commit is contained in:
Dimitur Kirov 2005-07-25 14:21:01 +00:00
parent 3ec2d68304
commit 0b0e605bb1
1 changed files with 5 additions and 0 deletions

View File

@ -709,6 +709,8 @@ class InputDialog:
self.ok_handler = ok_handler self.ok_handler = ok_handler
okbutton = xml.get_widget('okbutton') okbutton = xml.get_widget('okbutton')
okbutton.connect('clicked', self.on_okbutton_clicked) okbutton.connect('clicked', self.on_okbutton_clicked)
cancelbutton = xml.get_widget('cancelbutton')
cancelbutton.connect('clicked', self.on_cancelbutton_clicked)
self.dialog.show_all() self.dialog.show_all()
def on_okbutton_clicked(self, widget): def on_okbutton_clicked(self, widget):
@ -716,6 +718,9 @@ class InputDialog:
self.dialog.destroy() self.dialog.destroy()
self.ok_handler(response) self.ok_handler(response)
def on_cancelbutton_clicked(self, widget):
self.dialog.destroy()
def get_response(self): def get_response(self):
if self.is_modal: if self.is_modal:
response = self.dialog.run() response = self.dialog.run()