We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,324 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Text Editor using the Shooes toolkit isnt workig .?

i was going through many ruby books and found this amazing text editing code (its just 17 lines ) provided u use Shoes toolkit.

The code is working fine with no errors . but its only able to read (open) and input file but not save the text u wrote in the text box into a file.

Shoes.app(:width => 600, :height => 500) do
stack do
flow do
@open_button = button "Open"
@save_button = button "Save"
end
@t = edit_box :width => 0.9, :height => 400
end
@open_button.click do
@t.text = File.read(ask_open_file)
end
@save_button.click do
File.new(ask_save_file, 'w') do |f|
f.puts @t.text
end
end
end

ne idea on wats going wrong ....?

1
Contributor
0
Replies
1
View
rahul8590
Posting Whiz
351 posts since Mar 2009
Reputation Points: 92
Solved Threads: 20
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0536 seconds using 2.63MB