Path: | lib/json/editor.rb |
Last Update: | Sat Nov 07 04:00:29 +0000 2009 |
Edit the string json with encoding encoding in the editor.
# File lib/json/editor.rb, line 1362 1362: def edit(json, encoding = 'utf8') 1363: start(encoding) do |window| 1364: window.edit json 1365: end 1366: end
Starts a JSON Editor. If a block was given, it yields to the JSON::Editor::MainWindow instance.
# File lib/json/editor.rb, line 1352 1352: def start(encoding = 'utf8') # :yield: window 1353: Gtk.init 1354: @window = Editor::MainWindow.new(encoding) 1355: @window.icon_list = [ Editor.fetch_icon('json') ] 1356: yield @window if block_given? 1357: @window.show_all 1358: Gtk.main 1359: end