green_shoes 1.1.367 → 1.1.373

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/shoes/main.rb +8 -0
  3. data/lib/shoes/ruby.rb +16 -5
  4. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.367
1
+ 1.1.373
@@ -73,6 +73,14 @@ class Shoes
73
73
  mouse_hover_control app
74
74
  end
75
75
 
76
+ class << app; self end.class_eval do
77
+ define_method(:resized) do |&blk|
78
+ win.signal_connect "configure_event" do
79
+ app.instance_eval(&blk)
80
+ end
81
+ end
82
+ end
83
+
76
84
  app.canvas = if treeview
77
85
  Gtk::TreeView.new
78
86
  else
@@ -5,6 +5,16 @@ class Range
5
5
  end
6
6
  end
7
7
 
8
+ # GLib produces stack trace for all exceptions.
9
+ # Don't spit this out if system exit is called - just exit.
10
+ module GLib
11
+ module_function
12
+ def exit_application(exception, status)
13
+ raise exception if exception.class.name == "SystemExit"
14
+ super(exception, status)
15
+ end
16
+ end
17
+
8
18
  class Object
9
19
  include Types
10
20
  def alert msg, options={:block => true}
@@ -104,11 +114,6 @@ class Object
104
114
  ret
105
115
  end
106
116
 
107
- def exit
108
- Gtk.main_quit
109
- File.delete Shoes::TMP_PNG_FILE if File.exist? Shoes::TMP_PNG_FILE
110
- end
111
-
112
117
  def to_s
113
118
  super.gsub '<', '&lt;'
114
119
  end
@@ -120,6 +125,12 @@ class Object
120
125
  end
121
126
  end
122
127
 
128
+ # Define exit handler, close Gtk win and delete temporary Shoes image
129
+ at_exit do
130
+ Gtk.main_quit
131
+ File.delete Shoes::TMP_PNG_FILE if File.exist? Shoes::TMP_PNG_FILE
132
+ end
133
+
123
134
  class String
124
135
  def mindex str
125
136
  n, links = 0, []
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: green_shoes
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.367
4
+ version: 1.1.373
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-07 00:00:00.000000000 Z
12
+ date: 2013-02-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gtk2