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

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

?? thinking.py

?? Python Tkinter 源碼
?? PY
?? 第 1 頁 / 共 2 頁
字號:
		if choice == lastInserted: pass
		else:
			choiceboxWidget.insert(END, choice)
			choiceboxChoices.append(choice)
			lastInserted = choice

	root.bind('<Any-Key>', KeyboardListener)

	# put the buttons in the buttonsFrame
	if len(choices) > 0:
		okButton = Button(buttonsFrame, takefocus=YES, text="OK", height=1, width=6)
		okButton.pack(expand=NO, side=TOP,  padx='2m', pady='1m', ipady="1m", ipadx="2m")
		okButton.bind("<Return>", __choiceboxChoice)
		okButton.bind("<Button-1>",__choiceboxChoice)

		# now bind the keyboard events
		choiceboxWidget.bind("<Return>", __choiceboxChoice)
		choiceboxWidget.bind("<Double-Button-1>", __choiceboxChoice)
	else:
		# now bind the keyboard events
		choiceboxWidget.bind("<Return>", __choiceboxCancel)
		choiceboxWidget.bind("<Double-Button-1>", __choiceboxCancel)

	cancelButton = Button(buttonsFrame, takefocus=YES, text="Cancel", height=1, width=6)
	cancelButton.pack(expand=NO, side=BOTTOM, padx='2m', pady='1m', ipady="1m", ipadx="2m")
	cancelButton.bind("<Return>", __choiceboxCancel)
	cancelButton.bind("<Button-1>", __choiceboxCancel)

	# -------------------- bind some keyboard events ----------------------------


	root.bind("<Escape>", __choiceboxCancel)

	# --------------------- the action begins -----------------------------------
	# put the focus on the choiceboxWidget, and the select highlight on the first item
	choiceboxWidget.select_set(0)
	choiceboxWidget.focus_force()

	# --- run it! -----
	root.mainloop()
	if __a_button_was_clicked: root.destroy()
	return __choiceboxText


def __choiceboxChoice(event):
	global root, __choiceboxText, __a_button_was_clicked, choiceboxWidget
	choice_index = choiceboxWidget.curselection()
	__choiceboxText = choiceboxWidget.get(choice_index)
	__a_button_was_clicked = 1
	# print "Debugging> mouse-event=", event, " event.type=", event.type
	# print "Debugging> choice =", choice_index, __choiceboxText
	root.quit()


def __choiceboxCancel(event):
	global root, __choiceboxText, __a_button_was_clicked
	__a_button_was_clicked = 1
	__choiceboxText = None
	root.quit()


def KeyboardListener(event):
	global choiceboxChoices, choiceboxWidget
	key = event.keysym
	if len(key) <= 1:
		if key in string.printable:
			## print key
			# now find it in list.....

			## before we clear the list, remember the selected member
			try:
				start_n = int(choiceboxWidget.curselection()[0])
			except IndexError:
				start_n = -1

			## clear the selection.
			choiceboxWidget.selection_clear(0, 'end')

			## start from previous selection +1
			for n in range(start_n+1, len(choiceboxChoices)):
				item = choiceboxChoices[n]
				if item[0].lower() == key.lower():
					choiceboxWidget.selection_set(first=n)
					return
			else:
				# has not found it so loop from top
				for n in range(len(choiceboxChoices)):
					item = choiceboxChoices[n]
					if item[0].lower() == key.lower():
						choiceboxWidget.selection_set(first = n)
						## should call see method but don't have
						## scrollbars in this demo!
						return

				# nothing matched -- we'll look for the next logical choice
				for n in range(len(choiceboxChoices)):
					item = choiceboxChoices[n]
					if item[0].lower() > key.lower():
						if n > 0:
							choiceboxWidget.selection_set(first = (n-1))
						else:
							choiceboxWidget.selection_set(first = 0)
						## should call see method but don't have
						## scrollbars in this demo!
						return

				# still no match (nothing was greater than the key)
				# we set the selection to the first item in the list
				choiceboxWidget.selection_set(first = (len(choiceboxChoices)-1))
				## should call see method but don't have
				## scrollbars in this demo!
				return

#-------------------------------------------------------------------
# codebox
#-------------------------------------------------------------------

def codebox(message="", title="", text=""):
	"""
	Display some text in a monospaced font, with no line wrapping.
	This function is suitable for displaying code and text that is
	formatted using spaces.

	The text parameter should be a string, or a list or tuple of lines to be
	displayed in the textbox.
	"""
	textbox(message, title, text, codebox=1 )

#-------------------------------------------------------------------
# textbox
#-------------------------------------------------------------------
def textbox(message="", title="", text="", codebox=0):
	"""Display some text in a proportional font with line wrapping at word breaks.
	This function is suitable for displaying general written text.

	The text parameter should be a string, or a list or tuple of lines to be
	displayed in the textbox.
	"""

	if message == None: message = ""
	if title == None: title = ""

	global root, __replyButtonText, __a_button_was_clicked, __widgetTexts, buttonsFrame
	choices = ["0K"]
	__replyButtonText = choices[0]
	__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)


	mainframe = Frame(root)
	mainframe.pack(side=TOP, fill=BOTH, expand=YES)

	# ----  put frames in the window -----------------------------------
	# we pack the textboxFrame first, so it will expand first
	textboxFrame = Frame(mainframe, borderwidth=3)
	textboxFrame.pack(side=BOTTOM , fill=BOTH, expand=YES)

	message_and_buttonsFrame = Frame(mainframe)
	message_and_buttonsFrame.pack(side=TOP, fill=X, expand=NO)

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

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

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

	# put a textbox in the top frame
	if codebox:
		character_width = int((root_width * 0.6) / CODEBOX_FONT_SIZE)
		textbox = Text(textboxFrame,height=25,width=character_width, padx="2m", pady="1m")
		textbox.configure(wrap=NONE)
		textbox.configure(font=(MONOSPACE_FONT_FAMILY, CODEBOX_FONT_SIZE))

	else:
		character_width = int((root_width * 0.6) / SMALL_FONT_SIZE)
		textbox = Text(
			textboxFrame
			, height=25
			,width=character_width
			, padx="2m"
			, pady="1m"
			)
		textbox.configure(wrap=WORD)
		textbox.configure(font=(DEFAULT_FONT_FAMILY,TEXTBOX_FONT_SIZE))
 

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

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

	# pack the textbox 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.

	# Note that we need a bottom scrollbar only for code.
	# Text will be displayed with wordwrap, so we don't need to have a horizontal
	# scroll for it.
	if codebox:
		bottomScrollbar.pack(side=BOTTOM, fill=X)
	rightScrollbar.pack(side=RIGHT, fill=Y)

	textbox.pack(side=LEFT, fill=BOTH, expand=YES)


	# ---------- 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 buttons in the buttonsFrame
	okButton = Button(buttonsFrame, takefocus=YES, text="OK", height=1, width=6)
	okButton.pack(expand=NO, side=TOP,  padx='2m', pady='1m', ipady="1m", ipadx="2m")
	okButton.bind("<Return>", __textboxOK)
	okButton.bind("<Button-1>",__textboxOK)


	# ----------------- the action begins ----------------------------------------
	try:
		# load the text into the textbox
		if type(text) == type("abc"): pass
		else:
			try:
				text = "".join(text)  # convert a list or a tuple to a string
			except:
				msgbox("Exception when trying to convert "+ str(type(text)) + " to text in textbox")
				sys.exit(16)
		textbox.insert(END,text, "normal")

		# disable the textbox, so the text cannot be edited
		textbox.configure(state=DISABLED)
	except:
		msgbox("Exception when trying to load the textbox.")
		sys.exit(16)

	try:
		okButton.focus_force()
	except:
		msgbox("Exception when trying to put focus on okButton.")
		sys.exit(16)



	root.mainloop()
	if __a_button_was_clicked: root.destroy()
	return __replyButtonText

def __textboxOK(event):
	global root, __a_button_was_clicked
	__a_button_was_clicked = 1
	root.quit()



#-------------------------------------------------------------------
# diropenbox
#-------------------------------------------------------------------
def diropenbox(msg=None, title=None, startpos=None):
	"""A dialog to get a directory name.
	Returns the name of a directory, or None if user chose to cancel.
	"""
	root = Tk()
	root.withdraw()
	f = tkFileDialog.askdirectory(parent=root, title=title)
	if f == "": return None
	return f

#-------------------------------------------------------------------
# fileopenbox
#-------------------------------------------------------------------
def fileopenbox(msg=None, title=None, startpos=None):
	"""A dialog to get a file name.
	Returns the name of a file, or None if user chose to cancel.
	"""
	root = Tk()
	root.withdraw()
	f = tkFileDialog.askopenfilename(parent=root,title=title)
	if f == "": return None
	return f


#-------------------------------------------------------------------
# filesavebox
#-------------------------------------------------------------------
def filesavebox(msg=None, title=None, startpos=None):
	"""A file to get the name of a file to save.
	Returns the name of a file, or None if user chose to cancel.
	"""
	root = Tk()
	root.withdraw()
	f = tkFileDialog.asksaveasfilename(parent=root, title=title)
	if f == "": return None
	return f


#-------------------------------------------------------------------
# utility routines
#-------------------------------------------------------------------
# These routines are used by several other functions in the EasyGui module.

def __buttonEvent(event):
	"""Handle an event that is generated by a person clicking a button.
	"""
	global  root, __a_button_was_clicked, __widgetTexts, __replyButtonText
	__replyButtonText = __widgetTexts[event.widget]
	__a_button_was_clicked = 1
	root.quit() # quit the main loop


def __put_buttons_in_buttonframe(choices):
	"""Put the buttons in the buttons frame
	"""
	global __widgetTexts, __firstWidget, buttonsFrame

	__widgetTexts = {}
	i = 0

	for buttonText in choices:
		tempButton = Button(buttonsFrame, takefocus=1, text=buttonText)
		tempButton.pack(expand=YES, side=LEFT, padx='1m', pady='1m', ipadx='2m', ipady='1m')

		# remember the text associated with this widget
		__widgetTexts[tempButton] = buttonText

		# remember the first widget, so we can put the focus there
		if i == 0:
			__firstWidget = tempButton
			i = 1

		# bind the keyboard events to the widget
		tempButton.bind("<Return>", __buttonEvent)
		tempButton.bind("<Button-1>", __buttonEvent)



def run_thinking():

	choices = string.split(
"""tt000.py - introduction 
tt010.py - simplest possible Tkinter program: 3 statements 
tt020.py - creating a GUI object; packing; containers vs. widgets 
tt030.py - creating a widget and putting it in a frame 
tt035.py - using a class structure in the program 
tt040.py - some other ways to define a widget 
tt050.py - packing 
tt060.py - event binding 
tt070.py - "focus" and binding a widget to keyboard events 
tt074.py - command binding 
tt075.py - using event binding and command binding together 
tt076.py - sharing information among event handlers 
tt077.py - passing arguments to event handlers (part 1) - the problem 
tt078.py - passing arguments to event handlers (part 2) - solving it with lambda 
tt079.py - passing arguments to event handlers (part 3) - solving it with currying 
tt080.py - widget options and pack settings 
tt090.py - nesting frames 
tt095.py - Window Manager methods & controlling the size of windows with the geometry option 
tt100.py - pack options: side, expand, fill, anchor """, "\n")
	

	title = "Thinking in Tkinter"
	msg = "Pick the 'Thinking in Tkinter' program that you wish to view and run."

	#========================================== END DEMONSTRATION DATA


	while 1: # do forever
		choice = choicebox(msg, title, choices)
		if choice == None: 
			msg = "Thank you for looking at 'Thinking in Tkinter'."
			msgbox(msg, title)
			break
		
		program_filename = choice.split()[0]
		program_name = program_filename.split(".")[0]
		f = open(program_filename, "r")
		t = f.readlines()
		f.close
		msg2 = "Here is the text of " + program_filename \
			+ "\n\nAfter you view the source code of the program, clicking the 'OK'" \
			+" button will run the program."
		codebox(msg2, title, t)

		try:
			exec "reload(" + program_name + ")"
		except:
			exec "import " + program_name 


if __name__ == '__main__':
	run_thinking()

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
6080国产精品一区二区| 99re热视频精品| 欧美一级欧美一级在线播放| 亚洲成人tv网| 91精品国产91久久综合桃花| 人人超碰91尤物精品国产| 日韩欧美一级特黄在线播放| 久久99国产精品久久99果冻传媒| 精品久久久久香蕉网| 国产成人8x视频一区二区| 中文字幕在线观看一区二区| 日本福利一区二区| 青娱乐精品视频在线| 国产欧美视频一区二区三区| 成人白浆超碰人人人人| 亚洲国产欧美日韩另类综合| 欧美一区二区日韩一区二区| 国产一区二区三区四区五区入口 | 国产亚洲污的网站| www.成人网.com| 亚洲网友自拍偷拍| 2023国产一二三区日本精品2022| 成人av网站免费| 亚洲国产中文字幕| 久久众筹精品私拍模特| 在线视频欧美区| 蜜桃在线一区二区三区| 日韩码欧中文字| 欧美丝袜丝交足nylons图片| 国产毛片精品视频| 一区二区三区在线观看网站| 日韩欧美第一区| 91免费精品国自产拍在线不卡| 免费国产亚洲视频| 亚洲精品日产精品乱码不卡| 日韩视频免费观看高清完整版在线观看 | 91啪九色porn原创视频在线观看| 日韩中文字幕麻豆| 国产性做久久久久久| 欧美视频精品在线观看| 国产成人av网站| 人妖欧美一区二区| 亚洲综合清纯丝袜自拍| 国产亚洲精品资源在线26u| 欧美丝袜自拍制服另类| 99在线精品观看| 国产一区二区三区高清播放| 亚洲五码中文字幕| 椎名由奈av一区二区三区| 久久久久国产精品免费免费搜索 | 日韩午夜电影av| 欧美亚洲一区三区| av在线这里只有精品| 激情都市一区二区| 免费观看在线色综合| 亚洲图片一区二区| 亚洲精品国产成人久久av盗摄| 国产三级精品三级在线专区| 日韩一级片在线观看| 欧美色老头old∨ideo| 91色|porny| av一二三不卡影片| 丰满白嫩尤物一区二区| 黄页视频在线91| 久久99国产精品麻豆| 蜜桃一区二区三区在线观看| 偷拍与自拍一区| 亚洲h精品动漫在线观看| 亚洲欧美另类久久久精品2019| 国产精品萝li| 欧美国产国产综合| 国产精品女主播av| 中文字幕一区二区三区视频| 国产精品欧美一区喷水| 国产精品久久午夜夜伦鲁鲁| 国产精品亲子伦对白| 国产欧美一区二区三区网站 | 成人网男人的天堂| 不卡av电影在线播放| 波多野结衣在线一区| 成人av综合在线| 成人精品免费视频| 色综合久久天天| 欧美丝袜丝交足nylons图片| 欧美视频一二三区| 91精品久久久久久蜜臀| 日韩欧美中文字幕制服| 欧美精品一区二区蜜臀亚洲| 久久奇米777| 国产精品嫩草99a| 亚洲色图欧洲色图| 亚洲成av人**亚洲成av**| 亚洲3atv精品一区二区三区| 免费在线观看日韩欧美| 麻豆久久久久久| 国产麻豆成人精品| eeuss鲁片一区二区三区| 色综合久久久久久久久久久| 欧美私人免费视频| 欧美va亚洲va香蕉在线| 国产精品国产三级国产有无不卡 | 亚洲电影你懂得| 免费国产亚洲视频| 成人激情黄色小说| 欧美三级日本三级少妇99| 日韩欧美123| 亚洲欧美日韩国产中文在线| 天天av天天翘天天综合网 | 99riav一区二区三区| 欧美日韩色综合| 久久精品视频在线免费观看| 日韩久久一区二区| 久久狠狠亚洲综合| 99久久精品99国产精品| 欧美一区二区三区的| 国产精品毛片无遮挡高清| 夜夜精品视频一区二区| 国产乱人伦偷精品视频不卡 | 人禽交欧美网站| 成人激情图片网| 日韩手机在线导航| 一区二区高清视频在线观看| 久草热8精品视频在线观看| 91高清视频在线| 久久免费的精品国产v∧| 亚洲精品国产第一综合99久久| 精品一区精品二区高清| 欧美主播一区二区三区美女| 久久先锋影音av鲁色资源网| 亚洲国产日韩精品| 97精品久久久午夜一区二区三区| 欧美一级艳片视频免费观看| 国产精品二三区| 久久精品99国产精品日本| 在线观看日韩电影| 欧美国产成人精品| 韩国女主播成人在线| 56国语精品自产拍在线观看| 亚洲精品高清在线| zzijzzij亚洲日本少妇熟睡| 精品国产乱码久久久久久牛牛 | 亚洲午夜精品网| 99久久久久久| 国产欧美一区二区精品秋霞影院 | 韩国av一区二区三区四区| 欧美色图激情小说| 亚洲另类春色校园小说| 成人黄色在线视频| 国产欧美日韩三级| 国产精品一区二区在线观看网站 | 亚洲视频网在线直播| 国内精品久久久久影院薰衣草 | 国产精品自拍一区| 欧美电影免费提供在线观看| 日日摸夜夜添夜夜添国产精品 | 中文字幕在线播放不卡一区| 国产麻豆精品theporn| 日韩精品一区二区三区在线播放| 午夜视频一区二区三区| 91福利区一区二区三区| 最新日韩在线视频| 91尤物视频在线观看| 中文字幕在线不卡| 色婷婷综合在线| 亚洲国产综合视频在线观看| 色天使色偷偷av一区二区| 亚洲免费伊人电影| 日本道在线观看一区二区| 夜夜操天天操亚洲| 欧美日韩国产不卡| 麻豆一区二区三| 成人欧美一区二区三区在线播放| 国产一区二区三区观看| 国产拍欧美日韩视频二区| 成人一区二区三区视频在线观看| 欧美极品少妇xxxxⅹ高跟鞋| 国产成人精品1024| 中文字幕亚洲不卡| 日本高清成人免费播放| 亚洲影视在线播放| 日韩一区国产二区欧美三区| 另类欧美日韩国产在线| 国产农村妇女毛片精品久久麻豆| 成人精品电影在线观看| 亚洲综合免费观看高清完整版在线| 欧美性感一类影片在线播放| 日精品一区二区三区| 26uuu亚洲综合色欧美| 成人激情图片网| 亚洲一区日韩精品中文字幕| 欧美一级xxx| 成年人午夜久久久| 有码一区二区三区| 欧美福利视频一区| 韩国精品免费视频| 亚洲黄色av一区| 精品国产91洋老外米糕| 成人av午夜电影| 婷婷一区二区三区| 久久看人人爽人人|