Skip to content

Instantly share code, notes, and snippets.

@rhenium
Created May 14, 2014 07:47
Show Gist options
  • Save rhenium/97cd45256ecf48aa420b to your computer and use it in GitHub Desktop.
Save rhenium/97cd45256ecf48aa420b to your computer and use it in GitHub Desktop.
diff --git a/core/plugin/openimg/openimg.rb b/core/plugin/openimg/openimg.rb
index 4e070de..5e642df 100644
--- a/core/plugin/openimg/openimg.rb
+++ b/core/plugin/openimg/openimg.rb
@@ -30,6 +30,10 @@ Plugin.create :openimg do
w.set_size_request(320, 240)
w.set_default_size(*@size).move(*@position)
w.signal_connect(:destroy){ w.destroy }
+ w.ssc(:key_press_event) { |widget, event|
+ if "Escape" == Gtk::keyname([event.keyval, event.state])
+ notice "openimg escape"
+ w.destroy end }
eventbox = ::Gtk::EventBox.new
w.add(eventbox)
size = DEFAULT_SIZE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment