Path: | lib/json/editor.rb |
Last Update: | Tue Oct 30 23:59:18 +0000 2007 |
To use the GUI JSON editor, start the edit_json.rb executable script. It requires ruby-gtk to be installed.
Starts a JSON Editor. If a block was given, it yields to the JSON::Editor::MainWindow instance.
# File lib/json/editor.rb, line 1279 1279: def start(encoding = nil) # :yield: window 1280: encoding ||= 'utf8' 1281: Gtk.init 1282: @window = Editor::MainWindow.new(encoding) 1283: @window.icon_list = [ Editor.fetch_icon('json') ] 1284: yield @window if block_given? 1285: @window.show_all 1286: Gtk.main 1287: end