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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 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:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区香蕉| 亚洲图片欧美视频| 日韩一二三四区| 欧美高清性hdvideosex| 欧美老人xxxx18| 欧美日韩成人一区二区| 欧美三级资源在线| 在线不卡免费欧美| 欧美日韩国产片| 91麻豆精品国产自产在线观看一区| 在线欧美日韩精品| 欧美精品黑人性xxxx| 日韩亚洲欧美高清| 久久久蜜桃精品| 亚洲欧美在线aaa| 亚洲成人一二三| 久久爱另类一区二区小说| 国产福利电影一区二区三区| 高清视频一区二区| 国产成人免费视| 成人夜色视频网站在线观看| 色老头久久综合| 欧美日韩激情一区二区| 久久午夜老司机| 亚洲欧洲精品一区二区三区| 午夜激情综合网| 国产在线精品一区二区不卡了| www.99精品| 欧美少妇xxx| 欧美成人性福生活免费看| 欧美激情综合五月色丁香| 综合久久久久久| 另类成人小视频在线| www.视频一区| 欧美一卡2卡3卡4卡| 国产精品电影院| 日日夜夜免费精品视频| 国产精品乡下勾搭老头1| 欧美午夜精品免费| 久久久噜噜噜久久人人看| 亚洲欧美区自拍先锋| 麻豆视频观看网址久久| 欧洲国产伦久久久久久久| 精品动漫一区二区三区在线观看| 久久久av毛片精品| 亚洲精品国产无套在线观| 麻豆成人久久精品二区三区红| 99久久综合精品| 久久日韩精品一区二区五区| 亚洲人成亚洲人成在线观看图片| 免费在线一区观看| 成人v精品蜜桃久久一区| 欧美大片国产精品| 亚洲成人免费影院| 99久久免费视频.com| 精品区一区二区| 午夜精品久久久久久久久| 95精品视频在线| 久久久久久久网| 久久成人综合网| 日韩欧美一二三| 亚洲成av人片一区二区| 色视频一区二区| 亚洲婷婷综合色高清在线| 国产精品白丝jk黑袜喷水| 欧美va在线播放| 韩国女主播成人在线| 日韩一区二区在线免费观看| 五月天久久比比资源色| 精品视频在线看| 亚洲国产成人porn| 欧美偷拍一区二区| 亚洲综合色成人| 欧美专区日韩专区| 亚洲影院久久精品| 欧美日韩视频在线第一区 | 亚洲成人资源网| 日本高清无吗v一区| 亚洲老妇xxxxxx| 一本久久a久久免费精品不卡| 国产精品第四页| 丁香天五香天堂综合| 国产精品污污网站在线观看| 99久久国产综合色|国产精品| 国产精品热久久久久夜色精品三区 | 日日摸夜夜添夜夜添精品视频| 色综合天天狠狠| 一区二区三区在线视频播放 | 欧美浪妇xxxx高跟鞋交| 午夜精品视频在线观看| 日韩美一区二区三区| 免费精品视频在线| 久久久久久一级片| 成人av中文字幕| 亚洲综合精品久久| 欧美一区二区三区性视频| 国模冰冰炮一区二区| 国产精品天美传媒沈樵| 欧美性欧美巨大黑白大战| 人人狠狠综合久久亚洲| 久久综合久久鬼色| 91久久精品网| 黄网站免费久久| 亚洲女同ⅹxx女同tv| 91精品欧美一区二区三区综合在| 国产乱码精品1区2区3区| 中文字幕国产一区| 欧美日韩一区二区三区四区| 精品一区二区日韩| 国产精品视频一区二区三区不卡| 欧美视频在线观看一区二区| 久久99国产乱子伦精品免费| 亚洲欧洲精品一区二区三区 | 国产精品亚洲一区二区三区妖精| 亚洲天堂免费看| 久久亚洲捆绑美女| 欧美区在线观看| 成人三级伦理片| 毛片基地黄久久久久久天堂| 久久久久久久电影| 欧美色图一区二区三区| 丁香婷婷综合五月| 美腿丝袜一区二区三区| 亚洲激情自拍视频| 国产欧美日韩不卡免费| 欧美日韩性生活| 成人动漫视频在线| 激情国产一区二区| 午夜伊人狠狠久久| 亚洲人成精品久久久久| 国产午夜精品一区二区三区视频| 欧美日韩免费电影| 91色乱码一区二区三区| 国产黄色成人av| 久久电影网电视剧免费观看| 日韩影视精彩在线| 夜夜精品视频一区二区| 中文字幕二三区不卡| 国产亚洲精品超碰| 久久久久久亚洲综合影院红桃 | 91蜜桃在线免费视频| 国产 日韩 欧美大片| 国产成人午夜电影网| 久久国产欧美日韩精品| 秋霞午夜av一区二区三区| 午夜视频一区二区三区| 伊人夜夜躁av伊人久久| 日韩码欧中文字| 亚洲婷婷综合久久一本伊一区| 久久影院午夜论| 精品国产一区二区三区av性色 | 国内欧美视频一区二区| 日韩精品一二三四| 日本美女一区二区| 肉色丝袜一区二区| 奇米影视一区二区三区| 捆绑调教美女网站视频一区| 另类小说综合欧美亚洲| 精品一区在线看| 国产成人夜色高潮福利影视| 国产乱码精品一区二区三区忘忧草| 久久99久久精品| 国产精品456露脸| 成人高清在线视频| 99国产精品久久久| 欧美日韩在线三级| 欧美日韩国产另类不卡| 欧美一区二区三区色| 欧美大度的电影原声| 久久精品日产第一区二区三区高清版| 国产视频一区在线观看| 亚洲欧美在线aaa| 亚洲成人先锋电影| 国产一区二区日韩精品| 成人性视频免费网站| 在线精品视频一区二区三四| 91麻豆精品国产自产在线| 欧美电影免费观看高清完整版在 | 欧美剧情片在线观看| 欧美电视剧在线观看完整版| 久久精品夜夜夜夜久久| 亚洲欧美精品午睡沙发| 日韩精品国产精品| 国产一区二区久久| 欧美揉bbbbb揉bbbbb| 精品国内二区三区| 亚洲欧美激情小说另类| 免费人成在线不卡| av在线一区二区三区| 欧美三级视频在线| 国产片一区二区| 亚洲愉拍自拍另类高清精品| 国产一区视频在线看| 欧美日韩在线播放| 日本一区二区不卡视频| 免费观看久久久4p| 色八戒一区二区三区| 精品国产一区二区三区久久久蜜月 | 亚洲一区二区三区在线看| 国产在线播放一区|