1320: def ask_for_location
1321: dialog = Dialog.new(
1322: "Load data from location...",
1323: nil, nil,
1324: [ Stock::OK, Dialog::RESPONSE_ACCEPT ],
1325: [ Stock::CANCEL, Dialog::RESPONSE_REJECT ]
1326: )
1327: hbox = HBox.new(false, 5)
1328:
1329: hbox.pack_start(Label.new("Location:"), false)
1330: hbox.pack_start(location_input = Entry.new)
1331: location_input.width_chars = 60
1332: location_input.text = @location || ''
1333:
1334: dialog.vbox.pack_start(hbox, false)
1335:
1336: dialog.signal_connect('key-press-event''key-press-event', &DEFAULT_DIALOG_KEY_PRESS_HANDLER)
1337: dialog.show_all
1338: dialog.run do |response|
1339: if response == Dialog::RESPONSE_ACCEPT
1340: return @location = location_input.text
1341: end
1342: end
1343: return
1344: ensure
1345: dialog.destroy if dialog
1346: end