method
ask_for_location
ruby latest stable - Class:
JSON::Editor::MainWindow
Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v1_9_2_180) is shown here.
ask_for_location()public
# File ext/json/lib/json/editor.rb, line 1320
def ask_for_location
dialog = Dialog.new(
"Load data from location...",
nil, nil,
[ Stock::OK, Dialog::RESPONSE_ACCEPT ],
[ Stock::CANCEL, Dialog::RESPONSE_REJECT ]
)
hbox = HBox.new(false, 5)
hbox.pack_start(Label.new("Location:"), false)
hbox.pack_start(location_input = Entry.new)
location_input.width_chars = 60
location_input.text = @location || ''
dialog.vbox.pack_start(hbox, false)
dialog.signal_connect(:'key-press-event', &DEFAULT_DIALOG_KEY_PRESS_HANDLER)
dialog.show_all
dialog.run do |response|
if response == Dialog::RESPONSE_ACCEPT
return @location = location_input.text
end
end
return
ensure
dialog.destroy if dialog
end Related methods
- Instance methods
- ask_for_location
- ask_save
- change
- clear
- create_menu_bar
- display_status
- display_title
- edit
- file_open
- file_save
- file_save_as
- load_file
- load_location
- location_open
- quit
- read_data
- select_file
- store_file
- unchange
- view_new_model
- Class methods
- new
- Private methods
-
check_pretty_printed -
parse_json