Browse files

control panel fixes

  • Loading branch information...
1 parent 9960cfc commit 3107dc918fa3c125e3ce0a03a8374b2fa5527d2e Guillaume Pierronnet committed Sep 30, 2011
Showing with 7 additions and 2 deletions.
  1. +6 −1 lib/ruby-processing/app.rb
  2. +1 −1 library/control_panel/control_panel.rb
View
7 lib/ruby-processing/app.rb
@@ -123,6 +123,7 @@ def initialize(options={})
proxy_java_fields
set_sketch_path unless Processing.online?
mix_proxy_into_inner_classes
+ @started = false
java.lang.Thread.default_uncaught_exception_handler = proc do |thread, exception|
puts(exception.class.to_s)
@@ -144,7 +145,6 @@ def initialize(options={})
@render_mode ||= JAVA2D
-
x = options[:x] || 0
y = options[:y] || 0
args << "--location=#{x},#{y}"
@@ -154,6 +154,10 @@ def initialize(options={})
PApplet.run_sketch(args, self)
end
+ def started?
+ @started
+ end
+
def hint(*args)
begin
super(*args)
@@ -182,6 +186,7 @@ def size(*args)
@width = w || @width
@height = h || @height
@render_mode = mode || @render_mode
+ @started = true
super(*args)
rescue Exception => e
raise e.cause
View
2 library/control_panel/control_panel.rb
@@ -104,7 +104,7 @@ def display
set_resizable false
# Need to wait for the sketch to finish sizing...
Thread.new do
- sleep 0.2 while $app.default_size?
+ sleep 0.2 while !$app.started?
set_location($app.width + 10, 0)
show
end

0 comments on commit 3107dc9

Please sign in to comment.