コード例 #1
0
def close_dialog(window):
	if window.changed:
		prompt = 'Save changes to ' + window.gettitle() + ' ?'
		if stdwin.askync(prompt, 1):
			save_dialog(window)
			if window.changed:
				return	# Save failed (not) cancelled
	windows.remove(window)
	del window.textobject
コード例 #2
0
def revert_dialog(window):
	if not window.filename:
		stdwin.message('This window has no file to revert from')
		return
	if window.changed:
		prompt = 'Really read ' + window.filename + ' back from file?'
		if not stdwin.askync(prompt, 1):
			return
	try:
		fp = open(window.filename, 'r')
	except RuntimeError:
		stdwin.message(filename + ': cannot open')
		return
	contents = fp.read()
	del fp				# Close the file
	window.textobject.settext(contents)
	window.changed = 0
	fix_docsize(window)
コード例 #3
0
def askyesno(prompt, default):
	try:
		return stdwin.askync(prompt, default)
	except KeyboardInterrupt:
		return 0
コード例 #4
0
def askync(prompt, yesorno):
    return stdwin.askync(prompt, yesorno)
コード例 #5
0
def askyesno(prompt, default):
    try:
        return stdwin.askync(prompt, default)
    except KeyboardInterrupt:
        return 0
コード例 #6
0
ファイル: mainloop.py プロジェクト: arandilopez/z-eves
def askync(prompt, yesorno):
	return stdwin.askync(prompt, yesorno)