Guest User

Untitled

a guest
Jun 18th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. def log s
  2. model.log +=s
  3. #update_view <- this freezes swing app on a java exception
  4. puts s
  5. end
  6.  
  7. def execute_button_action_performed
  8.  
  9. model.code = view_state.model.code
  10. repaint_while {
  11. @run_thread = Thread.new {
  12. begin
  13. eval(model.code)
  14. rescue Exception, NativeException => exc
  15. log exc
  16. Thread.kill
  17. end
  18. }
  19. }
  20. update_view # this is my solution, but logging is not in realtime :/
  21. end
Add Comment
Please, Sign In to add comment