Commit 0d9a441e authored by VIGNET Pierre's avatar VIGNET Pierre

Add key press event to Model name dialog box

parent 414403ac
......@@ -355,7 +355,6 @@ class LegendWindow(object):
"""On ESC key_press_event, destroy this window."""
if gtk.gdk.keyval_name(event.keyval) == "Escape":
self.destroy()
return False
class ImportPIDParam(object):
......@@ -489,7 +488,6 @@ class ImportPIDParam(object):
"""On ESC key_press_event, destroy this window."""
if gtk.gdk.keyval_name(event.keyval) == "Escape":
self.destroy()
return False
class ImportBioPAXParams(object):
......@@ -698,4 +696,3 @@ class ImportBioPAXParams(object):
"""On ESC key_press_event, destroy this window."""
if gtk.gdk.keyval_name(event.keyval) == "Escape":
self.destroy()
return False
......@@ -567,9 +567,20 @@ class Charter(object):
"""
create a new charts when you click on new
"""
def on_enter(widget, event):
"""On ESC key_press_event, destroy this window."""
keyval_name = gtk.gdk.keyval_name(event.keyval)
if keyval_name == 'Return':
self.ok_new_text(None, die)
if keyval_name == 'Escape':
die.destroy()
# open an independant gtk.Entry for asking for the name
die = DialogEntry("Insert a model name")
die.entry.set_text("default_name")
die.entry.connect('key_press_event', on_enter)
die.okb.connect("clicked", self.ok_new_text, die)
die.cancel.connect("clicked", self.cancel, die)
die.run()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment