Commit bdc15416 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

Add key press event to Model name dialog box

parent 052e960b
...@@ -355,7 +355,6 @@ class LegendWindow(object): ...@@ -355,7 +355,6 @@ class LegendWindow(object):
"""On ESC key_press_event, destroy this window.""" """On ESC key_press_event, destroy this window."""
if gtk.gdk.keyval_name(event.keyval) == "Escape": if gtk.gdk.keyval_name(event.keyval) == "Escape":
self.destroy() self.destroy()
return False
class ImportPIDParam(object): class ImportPIDParam(object):
...@@ -489,7 +488,6 @@ class ImportPIDParam(object): ...@@ -489,7 +488,6 @@ class ImportPIDParam(object):
"""On ESC key_press_event, destroy this window.""" """On ESC key_press_event, destroy this window."""
if gtk.gdk.keyval_name(event.keyval) == "Escape": if gtk.gdk.keyval_name(event.keyval) == "Escape":
self.destroy() self.destroy()
return False
class ImportBioPAXParams(object): class ImportBioPAXParams(object):
...@@ -698,4 +696,3 @@ class ImportBioPAXParams(object): ...@@ -698,4 +696,3 @@ class ImportBioPAXParams(object):
"""On ESC key_press_event, destroy this window.""" """On ESC key_press_event, destroy this window."""
if gtk.gdk.keyval_name(event.keyval) == "Escape": if gtk.gdk.keyval_name(event.keyval) == "Escape":
self.destroy() self.destroy()
return False
...@@ -567,9 +567,20 @@ class Charter(object): ...@@ -567,9 +567,20 @@ class Charter(object):
""" """
create a new charts when you click on new 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 # open an independant gtk.Entry for asking for the name
die = DialogEntry("Insert a model name") die = DialogEntry("Insert a model name")
die.entry.set_text("default_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.okb.connect("clicked", self.ok_new_text, die)
die.cancel.connect("clicked", self.cancel, die) die.cancel.connect("clicked", self.cancel, die)
die.run() 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