亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? thinking.py

?? Python Tkinter 源碼
?? PY
?? 第 1 頁 / 共 2 頁
字號:
"""
A modified copy of easygui, to serve as a driver for the programs in 
Thinking In Tkinter.

"""


"""===============================================================
REVISION HISTORY
2 2002-10-08 re-cloned from easygui.py version 24, to pick up font fixes.
1 2002-09-21 Steve Ferg cloned it from easygui.py version 23.
=================================================================="""
"""
EasyGui provides an easy-to-use interface for simple GUI interaction
with a user.  It does not require the programmer to know anything about
tkinter, frames, widgets, callbacks or lambda.  All GUI interactions are
invoked by simple function calls that return results.

Note that EasyGui requires Tk release 8.0 or greater.
Documentation is in an accompanying file, easygui_doc.txt.

"""

EasyGuiRevisionInfo = "version 0.3, revision 24, 2002-10-06"
"""===============================================================
REVISION HISTORY
24 2002-10-06 improved control over font family and font size
	Added note that EasyGui requires Tk release 8.0 or greater.
	Added check to verify that we're running Tk 8.0 or greater.

23 2002-09-06 more improvements in appearance, added items to testing choices
	changed order of parameters for textbox and codebox.
	Now ALL widgets have message and title as the first two arguments.
	Note that the fileopenbox, filesavebox, and diropenbox but ignore, the msg argument.
		To specify a title, you must pass arguments of (None, title)

23 2002-09-06 revised enterbox so it returns None if it was cancelled
22 2002-09-02 major improvements in formattting, sorting of choiceboxes, keyboard listeners

22 2002-07-22 fixed some problems cause in revision 21
21 2002-07-19 converted all indentation to tabs
20 2002-07-15 bugfix: textbox not displaying title
19 2002-06-03 added enterbox to the test suite
18 2002-05-16 added AutoListBox
17 2002-05-16 added DEFAULT_FONT_SIZE constants & reduced their size
16 2002-03-29 changed choicebox() so it shows as few lines a possible
15 2002-03-09 started work on an improved demo
14 2002-02-03 removed obsolete import of pmw
13 2002-02-02 added NW spec for choice box
12 2002-01-31 created buttonbox as basis for msgbox, etc.
11 2002-01-30 specified a minsize for msgbox()
10 2002-01-30 withdrew root on diropenbox(), fileopenbox(), filesavebox(), etc.
9 2002-01-26 pulled out winrexx routines into winrexxgui.py
	renamed listbox to choicebox
8 2002-01-25 added diropenbox(), fileopenbox(), filesavebox(), and codebox()
7 2002-01-24 disabled the textbox, so text cannot be edited
6 2002-01-22 added case-insensitive sort for choicebox choices
5 2002-01-21 reworked ynbox() and ccbox() as boolboxes. Ready for version 0.1.
4 2002-01-20 added boolbox(), ynbox(), ccbox(); got choicebox working!
3 2002-01-18 got choicebox to display... not working yet
2 2002-01-17 got the messagebox and entry functions to working OK!
1 2002-01-16 Steve Ferg wrote it.
=================================================================="""

import sys
from Tkinter import *
if TkVersion < 8.0 :
	print "\n" * 3
	print "*"*75
	print "Running Tk version:", TkVersion 
	print "You must be using Tk version 8.0 or greater to use EasyGui."
	print "Terminating."
	print "*"*75
	print "\n" * 3
	sys.exit(0)
	

rootWindowPosition = "+300+200"
import string

DEFAULT_FONT_FAMILY   = ("MS", "Sans", "Serif")
MONOSPACE_FONT_FAMILY = ("Courier")
DEFAULT_FONT_SIZE     = 10
BIG_FONT_SIZE         = 12
SMALL_FONT_SIZE       =  9
CODEBOX_FONT_SIZE     =  9
TEXTBOX_FONT_SIZE     = DEFAULT_FONT_SIZE

import tkFileDialog

#-------------------------------------------------------------------
# various boxes built on top of the basic buttonbox
#-------------------------------------------------------------------

def ynbox(message="Shall I continue?", title=""):
	"""Display a message box with choices of Yes and No.
	Return 1 if Yes was chosen, otherwise return 0

	If invoked without a message parameter, displays a generic request for a confirmation
	that the user wishes to continue.  So it can be used this way:

		if ynbox(): pass # continue
		else: sys.exit(0)  # exit the program
	"""

	choices = ["Yes", "No"]
	if title == None: title = ""
	return boolbox(message, title, choices)

def ccbox(message="Shall I continue?", title=""):
	"""Display a message box with choices of Continue and Cancel.
	Return 1 if Continue was chosen, otherwise return 0.

	If invoked without a message parameter, displays a generic request for a confirmation
	that the user wishes to continue.  So it can be used this way:

		if ccbox(): pass # continue
		else: sys.exit(0)  # exit the program
	"""
	choices = ["Continue", "Cancel"]
	if title == None: title = ""
	return boolbox(message, title, choices)


def boolbox(message="Shall I continue?", title="", choices=["Yes","No"]):
	"""Display a boolean message box.
	Return 1 if the first choice was selected, otherwise return 0.
	"""
	if title == None:
		if message == "Shall I continue?": title = "Confirmation"
		else: title = ""


	reply = buttonbox(message, title, choices)
	if reply == choices[0]: return 1
	else: return 0


def indexbox(message="Shall I continue?", title="", choices=["Yes","No"]):
	"""Display a buttonbox with the specified choices.
	Return the index of the choice selected.
	"""
	reply = buttonbox(message, title, choices)
	index = -1
	for choice in choices:
		index = index + 1
		if reply == choice: return index



#-------------------------------------------------------------------
# msgbox
#-------------------------------------------------------------------

def msgbox(message="Shall I continue?", title=""):
	"""Display a messagebox
	"""
	choices = ["OK"]
	reply = buttonbox(message, title, choices)
	return reply


#-------------------------------------------------------------------
# buttonbox
#-------------------------------------------------------------------
def buttonbox(message="Shall I continue?", title="", choices = ["Button1", "Button2", "Button3"]):
	"""Display a message, a title, and a set of buttons.
	The buttons are defined by the members of the choices list.
	Return the text of the button that the user selected.
	"""

	global root, __replyButtonText, __a_button_was_clicked, __widgetTexts, buttonsFrame

	if title == None: title = ""
	if message == None: message = "This is an example of a buttonbox."

	# __a_button_was_clicked will remain 0 if window is closed using the close button.
	# It will be changed to 1 if the event loop is exited by a click of one of the buttons.
	__a_button_was_clicked = 0

	# Initialize __replyButtonText to the first choice.
	# This is what will be used if the window is closed by the close button.
	__replyButtonText = choices[0]

	root = Tk()
	root.title(title)
	root.iconname('Dialog')
	root.geometry(rootWindowPosition)
	root.minsize(400, 100)

	# ------------- define the frames --------------------------------------------
	messageFrame = Frame(root)
	messageFrame.pack(side=TOP, fill=BOTH)

	buttonsFrame = Frame(root)
	buttonsFrame.pack(side=BOTTOM, fill=BOTH)

	# -------------------- place the widgets in the frames -----------------------
	messageWidget = Message(messageFrame, text=message, width=400)
	messageWidget.configure(font=(DEFAULT_FONT_FAMILY,DEFAULT_FONT_SIZE))
	messageWidget.pack(side=TOP, expand=YES, fill=X, padx='3m', pady='3m')

	__put_buttons_in_buttonframe(choices)

	# -------------- the action begins -----------
	# put the focus on the first button
	__firstWidget.focus_force()
	root.mainloop()
	if __a_button_was_clicked: root.destroy()
	return __replyButtonText

#-------------------------------------------------------------------
# enterbox
#-------------------------------------------------------------------
def enterbox(message="Enter something.", title="", argDefaultText=None):
	"""Show a box in which a user can enter some text.
	You may optionally specify some default text, which will appear in the
	enterbox when it is displayed.
	Returns the text that the user entered, or None if he cancels the operation.
	"""

	global root, __enterboxText, __enterboxDefaultText, __a_button_was_clicked, cancelButton, entryWidget, okButton

	if title == None: title == ""
	choices = ["OK", "Cancel"]
	if argDefaultText == None:
		_enterboxDefaultText = ""
	else:
		__enterboxDefaultText = argDefaultText

	__enterboxText = __enterboxDefaultText


	# __a_button_was_clicked will remain 0 if window is closed using the close button]
	# will be changed to 1 if event-loop is quit by a click of one of the buttons.
	__a_button_was_clicked = 0

	root = Tk()
	root.title(title)
	root.iconname('Dialog')
	root.geometry(rootWindowPosition)
	root.bind("Escape", __enterboxCancel)

	# -------------------- put subframes in the root --------------------
	messageFrame = Frame(root)
	messageFrame.pack(side=TOP, fill=BOTH)

	entryFrame = Frame(root)
	entryFrame.pack(side=TOP, fill=BOTH)

	buttonsFrame = Frame(root)
	buttonsFrame.pack(side=BOTTOM, fill=BOTH)

	#-------------------- the message widget ----------------------------
	messageWidget = Message(messageFrame, width="4.5i", text=message)
	messageWidget.pack(side=RIGHT, expand=1, fill=BOTH, padx='3m', pady='3m')

	# --------- entryWidget ----------------------------------------------
	entryWidget = Entry(entryFrame, width=40)
	entryWidget.configure(font=(DEFAULT_FONT_FAMILY,BIG_FONT_SIZE))
	entryWidget.pack(side=LEFT, padx="3m")
	entryWidget.bind("<Return>", __enterboxGetText)
	entryWidget.bind("<Escape>", __enterboxCancel)
	# put text into the entryWidget
	entryWidget.insert(0,__enterboxDefaultText)

	# ------------------ ok button -------------------------------
	okButton = Button(buttonsFrame, takefocus=1, text="OK")
	okButton.pack(expand=1, side=LEFT, padx='3m', pady='3m', ipadx='2m', ipady='1m')
	okButton.bind("<Return>", __enterboxGetText)
	okButton.bind("<Button-1>", __enterboxGetText)

	# ------------------ (possible) restore button -------------------------------
	if argDefaultText != None:
		# make a button to restore the default text
		restoreButton = Button(buttonsFrame, takefocus=1, text="Restore default")
		restoreButton.pack(expand=1, side=LEFT, padx='3m', pady='3m', ipadx='2m', ipady='1m')
		restoreButton.bind("<Return>", __enterboxRestore)
		restoreButton.bind("<Button-1>", __enterboxRestore)

	# ------------------ cancel button -------------------------------
	cancelButton = Button(buttonsFrame, takefocus=1, text="Cancel")
	cancelButton.pack(expand=1, side=RIGHT, padx='3m', pady='3m', ipadx='2m', ipady='1m')
	cancelButton.bind("<Return>", __enterboxCancel)
	cancelButton.bind("<Button-1>", __enterboxCancel)

	# ------------------- time for action! -----------------
	entryWidget.focus_force()    # put the focus on the entryWidget
	root.mainloop()  # run it!

	# -------- after the run has completed ----------------------------------
	if __a_button_was_clicked:
		root.destroy()  # button_click didn't destroy root, so we do it now
		return __enterboxText
	else:
		# No button was clicked, so we know the OK button was not clicked
		__enterboxText = None
		return __enterboxText


def __enterboxGetText(event):
	global root, __enterboxText, entryWidget, __a_button_was_clicked
	__enterboxText = entryWidget.get()
	__a_button_was_clicked = 1
	root.quit()

def __enterboxRestore(event):
	global root, __enterboxText, entryWidget
	entryWidget.delete(0,len(entryWidget.get()))
	entryWidget.insert(0, __enterboxDefaultText)

def __enterboxCancel(event):
	global root,  __enterboxDefaultText, __enterboxText, __a_button_was_clicked
	__enterboxText = None
	__a_button_was_clicked = 1
	root.quit()


#-------------------------------------------------------------------
# choicebox
#-------------------------------------------------------------------
def choicebox(message="Pick something.", title="", choices=["program logic error - no choices specified"]):
	"""Present the user with a list of choices.
	Return the choice that he selected, or return None if he cancelled selection.
	"""
	global root, __choiceboxText, choiceboxWidget, defaultText
	global __a_button_was_clicked # cancelButton, okButton
	global choiceboxWidget, choiceboxChoices, choiceboxChoices

	choiceboxButtons = ["OK", "Cancel"]

	lines_to_show = min(len(choices), 20)
	lines_to_show = 20

	if title == None: title = ""

	# Initialize __choiceboxText
	# This is the value that will be returned if the user clicks the close icon
	__choiceboxText = None

	# __a_button_was_clicked will remain 0 if window is closed using the close button]
	# will be changed to 1 if event-loop is quit by a click of one of the buttons.
	__a_button_was_clicked = 0

	root = Tk()
	screen_width = root.winfo_screenwidth()
	screen_height = root.winfo_screenheight()
	root_width = int((screen_width * 0.8))
	root_height = int((screen_height * 0.5))
	root_xpos = int((screen_width * 0.1))
	root_ypos = int((screen_height * 0.05))

	root.title(title)
	root.iconname('Dialog')
	rootWindowPosition = "+0+0"
	root.geometry(rootWindowPosition)
	root.expand=NO
	root.minsize(root_width, root_height)
	rootWindowPosition = "+" + str(root_xpos) + "+" + str(root_ypos)
	root.geometry(rootWindowPosition)



	# ---------------- put the frames in the window -----------------------------------------
	message_and_buttonsFrame = Frame(root)
	message_and_buttonsFrame.pack(side=TOP, fill=X, expand=YES, pady=0, ipady=0)

	messageFrame = Frame(message_and_buttonsFrame)
	messageFrame.pack(side=LEFT, fill=X, expand=YES)

	buttonsFrame = Frame(message_and_buttonsFrame)
	buttonsFrame.pack(side=RIGHT, expand=NO, pady=0)

	choiceboxFrame = Frame(root)
	choiceboxFrame.pack(side=BOTTOM, fill=BOTH, expand=YES)

	# -------------------------- put the widgets in the frames ------------------------------

	# ---------- put a message widget in the message frame-------------------
	messageWidget = Message(messageFrame, anchor=NW, text=message, width=int(root_width * 0.9))
	messageWidget.configure(font=(DEFAULT_FONT_FAMILY,DEFAULT_FONT_SIZE))
	messageWidget.pack(side=LEFT, expand=YES, fill=BOTH, padx='1m', pady='1m')

	# --------  put the choiceboxWidget in the choiceboxFrame ---------------------------
	choiceboxWidget = Listbox(choiceboxFrame
		, height=lines_to_show
		, borderwidth="1m"
		, relief="flat"
		, bg="white"
		)
	choiceboxWidget.configure(font=(DEFAULT_FONT_FAMILY,DEFAULT_FONT_SIZE))

		# add a vertical scrollbar to the frame
	rightScrollbar = Scrollbar(choiceboxFrame, orient=VERTICAL, command=choiceboxWidget.yview)
	choiceboxWidget.configure(yscrollcommand = rightScrollbar.set)

	# add a horizontal scrollbar to the frame
	bottomScrollbar = Scrollbar(choiceboxFrame, orient=HORIZONTAL, command=choiceboxWidget.xview)
	choiceboxWidget.configure(xscrollcommand = bottomScrollbar.set)

	# pack the Listbox and the scrollbars.  Note that although we must define
	# the textbox first, we must pack it last, so that the bottomScrollbar will
	# be located properly.

	bottomScrollbar.pack(side=BOTTOM, fill = X)
	rightScrollbar.pack(side=RIGHT, fill = Y)

	choiceboxWidget.pack(side=LEFT, padx="1m", pady="1m", expand=YES, fill=BOTH)

	# sort the choices, eliminate duplicates, and put the choices into the choiceboxWidget
	choices.sort( lambda x,y: cmp(x.lower(),    y.lower())) # case-insensitive sort
	lastInserted = None
	choiceboxChoices = []
	for choice in choices:

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看欧美黄色| 奇米影视7777精品一区二区| 欧美日韩在线播放| 国产在线不卡一区| 亚洲综合丝袜美腿| 国产欧美1区2区3区| 3d动漫精品啪啪一区二区竹菊| 高清在线观看日韩| 捆绑变态av一区二区三区| 亚洲视频一区在线观看| 亚洲精品一区二区三区影院| 在线观看不卡视频| 99久久久久久99| 国产成人av资源| 久久精品av麻豆的观看方式| 亚洲成人av资源| 亚洲男女毛片无遮挡| 国产农村妇女毛片精品久久麻豆 | 激情另类小说区图片区视频区| 亚洲免费在线视频| 国产精品美女久久久久高潮 | 一区二区三区四区激情| 亚洲丝袜制服诱惑| 国产性色一区二区| 久久久久久久久久久久电影| 欧美一级片在线观看| 9191国产精品| 7777精品伊人久久久大香线蕉完整版 | 一区二区三区中文字幕电影| 国产精品免费视频网站| 中国色在线观看另类| 久久久美女艺术照精彩视频福利播放| 7777精品伊人久久久大香线蕉完整版 | 久久欧美一区二区| 久久蜜桃av一区精品变态类天堂 | 欧美一区永久视频免费观看| 欧美日韩在线一区二区| 欧美专区日韩专区| 欧美日韩国产bt| 欧美肥胖老妇做爰| 欧美电影一区二区三区| 欧美精选在线播放| 欧美一区永久视频免费观看| 51久久夜色精品国产麻豆| 欧美高清视频在线高清观看mv色露露十八| 欧美在线观看一区| 在线电影一区二区三区| 日韩欧美在线不卡| 精品国产亚洲在线| 久久久久99精品一区| 日本一区二区电影| 国产精品国产三级国产a| 国产精品久久国产精麻豆99网站| 国产精品福利一区| 亚洲日本丝袜连裤袜办公室| 亚洲午夜免费视频| 日韩黄色片在线观看| 男人的天堂久久精品| 国产乱一区二区| 成人av网站在线| 欧美视频一区二区三区四区| 欧美二区乱c少妇| 久久久高清一区二区三区| 国产精品福利一区二区三区| 亚洲韩国精品一区| 激情综合一区二区三区| 成人综合在线观看| 欧美性生活一区| 精品国产百合女同互慰| 中文字幕中文字幕一区| 亚洲成人精品影院| 国内一区二区在线| 色女孩综合影院| 欧美一区二区三区免费观看视频| 久久综合久久综合九色| 亚洲欧美另类图片小说| 蜜桃视频一区二区三区| 不卡在线观看av| 777久久久精品| 中文字幕高清一区| 成人免费黄色大片| 884aa四虎影成人精品一区| 久久久久久久久久电影| 亚洲一二三专区| 国产剧情在线观看一区二区| 色美美综合视频| 久久综合av免费| 亚洲国产日韩一级| 国产激情视频一区二区在线观看 | 欧美日韩成人综合在线一区二区| 久久久精品国产免费观看同学| 一区二区三区精品视频在线| 麻豆精品蜜桃视频网站| 91色婷婷久久久久合中文| 精品久久久久一区二区国产| 一区二区三区在线免费视频| 韩国女主播成人在线| 欧美精品丝袜中出| 亚洲丝袜另类动漫二区| 国产一区二区0| 在线不卡一区二区| 亚洲精品国产无套在线观| 国产乱码精品一品二品| 欧美日韩www| 亚洲精品福利视频网站| 成人污污视频在线观看| 日韩视频一区二区三区| 亚洲mv在线观看| 99天天综合性| 久久精品视频免费| 精品一区二区三区影院在线午夜| 欧美在线看片a免费观看| 亚洲欧洲成人av每日更新| 国产精品911| 亚洲精品一区二区三区在线观看| 日韩精品一二三四| 欧美视频一二三区| 一区二区三区四区激情| 91玉足脚交白嫩脚丫在线播放| 国产欧美精品国产国产专区 | 99久久精品一区二区| 久久久影视传媒| 久久精品99国产精品日本| 欧美日韩免费电影| 亚洲成人免费视频| 欧美日韩精品一区二区三区蜜桃 | 一区二区三区欧美亚洲| 成人av午夜电影| 亚洲国产精品国自产拍av| 国产成人在线看| 久久亚洲综合色一区二区三区| 久久99热狠狠色一区二区| 欧美一级电影网站| 久久精品国产第一区二区三区| 欧美一区二视频| 精品一区二区三区日韩| 日韩免费观看2025年上映的电影| 美女一区二区久久| 精品国产一区二区三区av性色 | 成人一区二区视频| 日本一区二区三级电影在线观看| 国产suv精品一区二区三区| 视频一区二区中文字幕| 欧美欧美欧美欧美| 老司机精品视频线观看86| 久久久精品国产免大香伊| 懂色中文一区二区在线播放| 国产精品久久久久永久免费观看| 成人av手机在线观看| 亚洲免费电影在线| 欧美人狂配大交3d怪物一区| 蜜芽一区二区三区| 久久欧美一区二区| jizzjizzjizz欧美| 亚洲成人一区在线| 日韩精品中文字幕在线不卡尤物| 黄色日韩三级电影| 18涩涩午夜精品.www| 日本福利一区二区| 免费成人结看片| 亚洲国产精品精华液ab| 色综合一个色综合亚洲| 亚洲成人自拍一区| 精品日韩99亚洲| 91免费视频网| 蜜桃视频在线一区| 国产精品美女久久久久久2018| 色婷婷综合在线| 青青草原综合久久大伊人精品| 欧美精品一区男女天堂| 91影视在线播放| 久久精品国产一区二区| 国产精品美女久久久久aⅴ国产馆| 91久久精品国产91性色tv| 美女网站在线免费欧美精品| 中文一区二区在线观看| 欧美日韩国产乱码电影| 国产高清不卡一区二区| 亚洲在线观看免费| 久久久久久久久久久99999| 91丨九色丨蝌蚪富婆spa| 六月丁香综合在线视频| 中文字幕日韩一区| 日韩你懂的电影在线观看| 97久久精品人人做人人爽50路 | 丝袜诱惑制服诱惑色一区在线观看 | 天天影视涩香欲综合网| 久久伊人中文字幕| 欧美无砖专区一中文字| 国产乱码一区二区三区| 亚洲超丰满肉感bbw| 国产精品网站一区| 6080国产精品一区二区| 91丨porny丨首页| 国内成人免费视频| 日韩国产欧美在线视频| 亚洲免费观看高清| 亚洲国产精品av| 精品成人私密视频| 欧美日韩中文一区|