method
new
v1_9_2_180 -
Show latest stable
-
0 notes -
Class: MainWindow
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378 (0)
- 1_9_2_180 (0)
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
new(encoding)
public
Hide source
# File ext/json/lib/json/editor.rb, line 1050 def initialize(encoding) @changed = false @encoding = encoding super(TOPLEVEL) display_title set_default_size(800, 600) signal_connect(:delete_event) { quit } vbox = VBox.new(false, 0) add(vbox) #vbox.border_width = 0 @treeview = JSONTreeView.new(self) @treeview.signal_connect(:'cursor-changed') do display_status('') end menu_bar = create_menu_bar vbox.pack_start(menu_bar, false, false, 0) sw = ScrolledWindow.new(nil, nil) sw.shadow_type = SHADOW_ETCHED_IN sw.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC) vbox.pack_start(sw, true, true, 0) sw.add(@treeview) @status_bar = Statusbar.new vbox.pack_start(@status_bar, false, false, 0) @filename ||= nil if @filename data = read_data(@filename) view_new_model Editor.data2model(data) end signal_connect(:button_release_event) do |_,event| if event.button == 2 c = Gtk::Clipboard.get(Gdk::Selection::PRIMARY) if url = c.wait_for_text location_open url end false else true end end end