Guest User

Untitled

a guest
Dec 18th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.58 KB | None | 0 0
  1. Shoes.app :width => 300 do
  2.   flow do
  3.     button "Load", :width => '30%' do
  4.       readFolder = ask_open_folder
  5.       combinedText = ""
  6.       Dir.glob(folder + "/*.txt") do |file|
  7.         combinedText = combinedText + File.read(file) +  "\n"
  8.       end  
  9.       @edit.text = combinedText
  10.     end
  11.    
  12.    
  13.     button "Clean up", :width => '30%' do
  14.    
  15.     end
  16.  
  17.     button "Save", :width => '30%' do
  18.       file = ask_save_file
  19.       File.open(file, "w+") do|f|
  20.         f.write @edit.text
  21.       end
  22.     end
  23.   end
  24.  
  25.   @edit = edit_box :width => '100%',
  26.     :height => 500
  27. end
Add Comment
Please, Sign In to add comment