| Path: | lib/json/editor.rb |
| Last Update: | Mon Nov 26 22:32:41 +0100 2007 |
Edit the string json with encoding encoding in the editor.
# File lib/json/editor.rb, line 1353 def edit(json, encoding = 'utf8') start(encoding) do |window| window.edit json end end
Starts a JSON Editor. If a block was given, it yields to the JSON::Editor::MainWindow instance.
# File lib/json/editor.rb, line 1343 def start(encoding = 'utf8') # :yield: window Gtk.init @window = Editor::MainWindow.new(encoding) @window.icon_list = [ Editor.fetch_icon('json') ] yield @window if block_given? @window.show_all Gtk.main end